Re: [PATCH v2 08/12] iommufd/selftest: Put iopf enablement in domain attach path
From: Baolu Lu
Date: Tue Feb 25 2025 - 23:09:47 EST
On 2/25/25 16:16, Tian, Kevin wrote:
+ ret = mock_dev_enable_iopf(dev, domain);
+ if (ret)
+ return ret;
+
+ mock_dev_disable_iopf(dev, mdev->domain);
You could use the same trick to simplify iopf_for_domain_replace()
in patch7?
Yes, simplify it like this,
static inline int iopf_for_domain_replace(struct iommu_domain *new,
struct iommu_domain *old,
struct device *dev)
{
int ret;
ret = iopf_for_domain_set(new, dev);
if (ret)
return ret;
iopf_for_domain_remove(old, dev);
return 0;
}
Thanks,
baolu