Re: [PATCH 4/5] vfio/type1: Flush CPU caches on DMA pages in non-coherent domains

From: Alex Williamson
Date: Wed May 22 2024 - 14:22:52 EST


On Wed, 22 May 2024 13:52:21 -0300
Jason Gunthorpe <jgg@xxxxxxxxxx> wrote:

> On Wed, May 22, 2024 at 08:43:18AM -0600, Alex Williamson wrote:
>
> > But I think this also means that regardless of virtualizing
> > PCI_EXP_DEVCTL_NOSNOOP_EN, there will be momentary gaps around device
> > resets where a device could legitimately perform no-snoop
> > transactions.
>
> Isn't memory enable turned off after FLR? If not do we have to make it
> off before doing FLR?
>
> I'm not sure how a no-snoop could leak out around FLR?

Good point, modulo s/memory/bus master/. Yes, we'd likely need to make
sure we enter pci_reset_function() with BM disabled so that we don't
have an ordering issue between restoring the PCIe capability and the
command register. Likewise no-snoop handling would need to avoid gaps
around backdoor resets like we try to do when we're masking INTx
support on the device (vfio_bar_restore). Thanks,

Alex