Thread (31 messages) 31 messages, 2 authors, 2025-01-07

Re: [PATCH v4 14/14] iommu/arm-smmu-v3: Report events that belong to devices attached to vIOMMU

From: Nicolin Chen <hidden>
Date: 2025-01-07 05:33:38
Also in: linux-doc, linux-iommu, linux-kselftest, linux-patches, lkml

On Mon, Jan 06, 2025 at 08:37:04PM -0800, Nicolin Chen wrote:
quoted hunk ↗ jump to hunk
I added something like this. Will send a v5.
diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c
index 0c7a5894ba07..348179f3cf2a 100644
--- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c
+++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c
@@ -399,9 +399,15 @@ static int arm_vsmmu_cache_invalidate(struct iommufd_viommu *viommu,
 	return ret;
 }
 
+static bool arm_vsmmu_supports_veventq(unsigned int type)
+{
+	return type == IOMMU_VIOMMU_TYPE_ARM_SMMUV3;
Oops. Corrected this: IOMMU_VEVENTQ_TYPE_ARM_SMMUV3

And added your bits too:
@@ -83,6 +83,9 @@ int iommufd_viommu_report_event(struct iommufd_viommu *viommu,

        if (!viommu)
                return -ENODEV;
+       if (WARN_ON_ONCE(!viommu->ops || !viommu->ops->supports_veventq ||
+                        !viommu->ops->supports_veventq(type)))
+               return -EOPNOTSUPP;
        if (WARN_ON_ONCE(!data_len || !event_data))
                return -EINVAL;
Thanks!
Nicolin
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help