• Linus Torvalds's avatar
    Merge tag 'for-linus-iommufd' of git://git.kernel.org/pub/scm/linux/kernel/git/jgg/iommufd · 08cdc215
    Linus Torvalds authored
    Pull iommufd implementation from Jason Gunthorpe:
     "iommufd is the user API to control the IOMMU subsystem as it relates
      to managing IO page tables that point at user space memory.
    
      It takes over from drivers/vfio/vfio_iommu_type1.c (aka the VFIO
      container) which is the VFIO specific interface for a similar idea.
    
      We see a broad need for extended features, some being highly IOMMU
      device specific:
       - Binding iommu_domain's to PASID/SSID
       - Userspace IO page tables, for ARM, x86 and S390
       - Kernel bypassed invalidation of user page tables
       - Re-use of the KVM page table in the IOMMU
       - Dirty page tracking in the IOMMU
       - Runtime Increase/Decrease of IOPTE size
       - PRI support with faults resolved in userspace
    
      Many of these HW features exist to support VM use cases - for instance
      the combination of PASID, PRI and Userspace IO Page Tables allows an
      implementation of DMA Shared Virtual Addressing (vSVA) within a guest.
      Dirty tracking enables VM live migration with SRIOV devices and PASID
      support allow creating "scalable IOV" devices, among other things.
    
      As these features are fundamental to a VM platform they need to be
      uniformly exposed to all the driver families that do DMA into VMs,
      which is currently VFIO and VDPA"
    
    For more background, see the extended explanations in Jason's pull request:
    
      https://lore.kernel.org/lkml/Y5dzTU8dlmXTbzoJ@nvidia.com/
    
    * tag 'for-linus-iommufd' of git://git.kernel.org/pub/scm/linux/kernel/git/jgg/iommufd: (62 commits)
      iommufd: Change the order of MSI setup
      iommufd: Improve a few unclear bits of code
      iommufd: Fix comment typos
      vfio: Move vfio group specific code into group.c
      vfio: Refactor dma APIs for emulated devices
      vfio: Wrap vfio group module init/clean code into helpers
      vfio: Refactor vfio_device open and close
      vfio: Make vfio_device_open() truly device specific
      vfio: Swap order of vfio_device_container_register() and open_device()
      vfio: Set device->group in helper function
      vfio: Create wrappers for group register/unregister
      vfio: Move the sanity check of the group to vfio_create_group()
      vfio: Simplify vfio_create_group()
      iommufd: Allow iommufd to supply /dev/vfio/vfio
      vfio: Make vfio_container optionally compiled
      vfio: Move container related MODULE_ALIAS statements into container.c
      vfio-iommufd: Support iommufd for emulated VFIO devices
      vfio-iommufd: Support iommufd for physical VFIO devices
      vfio-iommufd: Allow iommufd to be used in place of a container fd
      vfio: Use IOMMU_CAP_ENFORCE_CACHE_COHERENCY for vfio_file_enforced_coherent()
      ...
    08cdc215
.clang-format 20 KB