• Jason Gunthorpe's avatar
    kvm/vfio: Remove vfio_group from kvm · 3e5449d5
    Jason Gunthorpe authored
    None of the VFIO APIs take in the vfio_group anymore, so we can remove it
    completely.
    
    This has a subtle side effect on the enforced coherency tracking. The
    vfio_group_get_external_user() was holding on to the container_users which
    would prevent the iommu_domain and thus the enforced coherency value from
    changing while the group is registered with kvm.
    
    It changes the security proof slightly into 'user must hold a group FD
    that has a device that cannot enforce DMA coherence'. As opening the group
    FD, not attaching the container, is the privileged operation this doesn't
    change the security properties much.
    
    On the flip side it paves the way to changing the iommu_domain/container
    attached to a group at runtime which is something that will be required to
    support nested translation.
    Reviewed-by: default avatarKevin Tian <kevin.tian@intel.com>
    Reviewed-by: Christoph Hellwig <hch@lst.de>i
    Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
    Link: https://lore.kernel.org/r/7-v3-f7729924a7ea+25e33-vfio_kvm_no_group_jgg@nvidia.comSigned-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
    3e5449d5
vfio.c 7.44 KB