]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iommufd/selftest: Put iopf enablement in domain attach path
authorLu Baolu <baolu.lu@linux.intel.com>
Fri, 18 Apr 2025 08:01:26 +0000 (16:01 +0800)
committerJoerg Roedel <jroedel@suse.de>
Mon, 28 Apr 2025 11:04:33 +0000 (13:04 +0200)
commitc2fa4d4cceb865e1235cf5e0825d488e6b622536
treebfc789ca57782323feb4a12f0683f834c7b5ea7a
parent17fce9d2336d952b95474248303e5e7d9777f2e0
iommufd/selftest: Put iopf enablement in domain attach path

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@linux.intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Yi Liu <yi.l.liu@intel.com>
Reviewed-by: Nicolin Chen <nicolinc@nvidia.com>
Tested-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Link: https://lore.kernel.org/r/20250418080130.1844424-5-baolu.lu@linux.intel.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/iommufd/selftest.c