Re: [PATCH v4 3/8] iommu/vt-d: Put iopf enablement in domain attach path

From: Yi Liu
Date: Tue Mar 18 2025 - 05:53:59 EST


On 2025/3/13 13:19, Lu Baolu wrote:
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.

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

a nit. It appears to me the PRI cap and IOMMU PRI enable bit is set in the
probe_device() now after the below patch. This commit now is more dealing
with iopf_refcount and adding the device to the iopf queue.

https://lore.kernel.org/linux-iommu/20250228092631.3425464-6-baolu.lu@xxxxxxxxxxxxxxx/

Regards,
Yi Liu