Hi Jacob,

On 2022/3/30 5:00, Jacob Pan wrote:
Hi BaoLu,

On Tue, 29 Mar 2022 13:37:50 +0800, Lu Baolu<baolu...@linux.intel.com>
wrote:

Use this field to save the pasid/ssid bits that a device is able to
support with its IOMMU hardware. It is a generic attribute of a device
and lifting it into the per-device dev_iommu struct makes it possible
to allocate a PASID for device without calls into the IOMMU drivers.
Any iommu driver which suports PASID related features should set this
field before features are enabled on the devices.

Signed-off-by: Lu Baolu<baolu...@linux.intel.com>
---
  include/linux/iommu.h                       | 1 +
  drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 2 ++
  drivers/iommu/intel/iommu.c                 | 5 ++++-
  3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index 6ef2df258673..36f43af0af53 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -368,6 +368,7 @@ struct dev_iommu {
        struct iommu_fwspec             *fwspec;
        struct iommu_device             *iommu_dev;
        void                            *priv;
+       unsigned int                    pasid_bits;
pasid_width?
PCI spec uses "Max PASID Width"


My understanding is that this field represents "the pasid bits that the
device is able to use with its IOMMU". This field considers the
capabilities of both device and IOMMU. This is the reason why I put it
in the per-device iommu object and initialize it in the iommu
probe_device() callback.

Best regards,
baolu
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Reply via email to