On Mon, Jan 06, 2025 at 08:37:04PM -0800, Nicolin Chen wrote:
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