Skip to content

vfio/type1/pci: IOMMU PFNMAP invalidation

Alex Williamson kvm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 10 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2vfio: Introduce bus driver to IOMMU invalidation interfacedrivers/vfio/pci/vfio_pci.c drivers/vfio/pci/vfio_pci_private.h drivers/vfio/vfio.c +2 more+142 -351 reply
2/2vfio: Introduce strict PFNMAP mappingsdrivers/vfio/pci/vfio_pci.c drivers/vfio/vfio.c drivers/vfio/vfio_iommu_type1.c +1 more+81 -11 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] vfio/type1/pci: IOMMU PFNMAP invalidation

This is a follow-on series to "vfio-pci: Block user access to disabled device MMIO"[1], which extends user access blocking of disabled MMIO ranges to include unmapping the ranges from the IOMMU. The first patch adds an invalidation callback path, allowing vfio bus drivers to signal the IOMMU backend to unmap ranges with vma level granularity. This signaling is done both when the MMIO range becomes inaccessible due to memory disabling, as well as when a vma is closed, making up for the lack of tracking or pinning for non-page backed vmas. The second patch adds registration and testing interfaces such that the IOMMU backend driver can test whether a given PFNMAP vma is provided by a vfio bus driver supporting invalidation. We can then implement more restricted semantics to only allow PFNMAP DMA mappings when we have such support, which becomes the new default.

Jason, if you'd like Suggested-by credit for the ideas here I'd be glad to add it. Thanks,

Alex

[1]https://lore.kernel.org/kvm/[email protected]/

---

Alex Williamson (2):
vfio: Introduce bus driver to IOMMU invalidation interface
vfio: Introduce strict PFNMAP mappings

 drivers/vfio/pci/vfio_pci.c         |   41 ++++++++++-
 drivers/vfio/pci/vfio_pci_private.h |    1 
 drivers/vfio/vfio.c                 |   76 ++++++++++++++++++++
 drivers/vfio/vfio_iommu_type1.c     |  130 +++++++++++++++++++++++++++--------
 include/linux/vfio.h                |    9 ++
 5 files changed, 222 insertions(+), 35 deletions(-)