This series aims to enhance the iommu_aux_at(de)tach_device() api's so that some generic iommu api's like iommu_get_domain_for_dev() could also work for vfio/mdev device. The initial version of this series was post at https://lkml.org/lkml/2020/6/26/1118 This version is evolved according to Robin's feedback. Your comments are very appreciated. Best regards, baolu Lu Baolu (2): iommu: iommu_aux_at(de)tach_device() extension iommu: Add aux_domain_attached flag to iommu_group drivers/iommu/iommu.c | 98 +++++++++++++++++++++++++++++---- drivers/vfio/vfio_iommu_type1.c | 5 +- include/linux/iommu.h | 12 ++-- 3 files changed, 99 insertions(+), 16 deletions(-) -- 2.17.1