Re: [PATCH v3 0/3] vfio-pci: Block user access to disabled device MMIO
From: Alex Williamson
Date: Fri May 22 2020 - 18:25:57 EST
On Fri, 22 May 2020 18:08:58 -0400
Qian Cai <cai@xxxxxx> wrote:
> On Fri, May 22, 2020 at 01:17:09PM -0600, Alex Williamson wrote:
> > v3:
> >
> > The memory_lock semaphore is only held in the MSI-X path for callouts
> > to functions that may access MSI-X MMIO space of the device, this
> > should resolve the circular locking dependency reported by Qian
> > (re-testing very much appreciated). I've also incorporated the
> > pci_map_rom() and pci_unmap_rom() calls under the memory_lock. Commit
> > 0cfd027be1d6 ("vfio_pci: Enable memory accesses before calling
> > pci_map_rom") made sure memory was enabled on the info path, but did
> > not provide locking to protect that state. The r/w path of the BAR
> > access is expanded to include ROM mapping/unmapping. Unless there
> > are objections, I'll plan to drop v2 from my next branch and replace
> > it with this. Thanks,
>
> FYI, the lockdep warning is gone.
>
Thank you for testing!
Alex