Re: [PATCH v3 4/4] vfio/type1: Use iommu_aux_at(de)tach_group() APIs

From: Lu Baolu
Date: Thu Jul 30 2020 - 21:44:38 EST


Hi Yi,

On 7/30/20 5:36 PM, Liu, Yi L wrote:
From: Lu Baolu<baolu.lu@xxxxxxxxxxxxxxx>
Sent: Tuesday, July 14, 2020 1:57 PM

Replace iommu_aux_at(de)tach_device() with iommu_aux_at(de)tach_group().
It also saves the IOMMU_DEV_FEAT_AUX-capable physcail device in the vfio_group
data structure so that it could be reused in other places.

Signed-off-by: Lu Baolu<baolu.lu@xxxxxxxxxxxxxxx>
---
drivers/vfio/vfio_iommu_type1.c | 44 ++++++---------------------------
1 file changed, 7 insertions(+), 37 deletions(-)

diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c
index 5e556ac9102a..f8812e68de77 100644
--- a/drivers/vfio/vfio_iommu_type1.c
+++ b/drivers/vfio/vfio_iommu_type1.c
@@ -100,6 +100,7 @@ struct vfio_dma {
struct vfio_group {
struct iommu_group *iommu_group;
struct list_head next;
+ struct device *iommu_device;
I know mdev group has only one device, so such a group has a single
iommu_device. But I guess may be helpful to add a comment here or in
commit message. Otherwise, it looks weird that a group structure
contains a single iommu_device field instead of a list of iommu_device.


Right! I will add some comments if this is still needed in the next
version.

Best regards,
baolu