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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux