]> git.ipfire.org Git - thirdparty/linux.git/commit
iommu/vt-d: Put iopf enablement in domain attach path
authorLu Baolu <baolu.lu@linux.intel.com>
Fri, 18 Apr 2025 08:01:25 +0000 (16:01 +0800)
committerJoerg Roedel <jroedel@suse.de>
Mon, 28 Apr 2025 11:04:31 +0000 (13:04 +0200)
commit17fce9d2336d952b95474248303e5e7d9777f2e0
tree96cef51731d5d07b7f694da327bc27bd8ff937b8
parent7c8896dd4a2a27c84b04dcf0990e6f6b118cb6b2
iommu/vt-d: Put iopf enablement in domain attach path

Update iopf enablement in the 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.

Place all the logic for controlling the PRI and iopf queue in the domain
set/remove/replace paths. Keep track of the number of domains set to the
device and PASIDs that require iopf. When the first domain requiring iopf
is attached, add the device to the iopf queue and enable PRI. When the
last domain is removed, remove it from the iopf queue and disable PRI.

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>
Tested-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Link: https://lore.kernel.org/r/20250418080130.1844424-4-baolu.lu@linux.intel.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/intel/iommu.c
drivers/iommu/intel/iommu.h
drivers/iommu/intel/nested.c
drivers/iommu/intel/svm.c