Re: [PATCH v4 4/8] iommufd/selftest: Put iopf enablement in domain attach path

From: Yi Liu
Date: Tue Mar 18 2025 - 06:20:05 EST


On 2025/3/13 13:19, Lu Baolu wrote:
Update iopf enablement in the iommufd mock device driver to use the new
method, similar to the arm-smmu-v3 driver. Enable iopf support when any
domain with an iopf_handler is attached, and disable it when the domain
is removed.

Add a refcount in the mock device state structure to keep track of the
number of domains set to the device and PASIDs that require iopf.

Signed-off-by: Lu Baolu <baolu.lu@xxxxxxxxxxxxxxx>
Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx>
Tested-by: Zhangfei Gao <zhangfei.gao@xxxxxxxxxx>
---
drivers/iommu/iommufd/selftest.c | 64 ++++++++++++++++++++++++++------
1 file changed, 53 insertions(+), 11 deletions(-)

Reviewed-by: Yi Liu <yi.l.liu@xxxxxxxxx>

Regards,
Yi Liu