Message ID | 159017449210.18853.15037950701494323009.stgit@gimli.home (mailing list archive) |
---|---|
Headers | show |
Series | vfio-pci: Block user access to disabled device MMIO | expand |
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.
On Fri, 22 May 2020 18:08:58 -0400 Qian Cai <cai@lca.pw> 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