[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z3zDA3xx6w6dSQY+@Asurada-Nvidia>
Date: Mon, 6 Jan 2025 22:00:35 -0800
From: Nicolin Chen <nicolinc@...dia.com>
To: Baolu Lu <baolu.lu@...ux.intel.com>
CC: <jgg@...dia.com>, <kevin.tian@...el.com>, <corbet@....net>,
<will@...nel.org>, <joro@...tes.org>, <suravee.suthikulpanit@....com>,
<robin.murphy@....com>, <dwmw2@...radead.org>, <shuah@...nel.org>,
<linux-kernel@...r.kernel.org>, <iommu@...ts.linux.dev>,
<linux-arm-kernel@...ts.infradead.org>, <linux-kselftest@...r.kernel.org>,
<linux-doc@...r.kernel.org>, <eric.auger@...hat.com>,
<jean-philippe@...aro.org>, <mdf@...nel.org>, <mshavit@...gle.com>,
<shameerali.kolothum.thodi@...wei.com>, <smostafa@...gle.com>,
<ddutile@...hat.com>, <yi.l.liu@...el.com>, <patches@...ts.linux.dev>
Subject: Re: [PATCH v4 14/14] iommu/arm-smmu-v3: Report events that belong to
devices attached to vIOMMU
On Tue, Jan 07, 2025 at 01:54:00PM +0800, Baolu Lu wrote:
> On 1/7/25 12:36, Nicolin Chen wrote:
> > +static bool arm_vsmmu_supports_veventq(unsigned int type)
> > +{
> > + return type == IOMMU_VIOMMU_TYPE_ARM_SMMUV3;
>
> Do you need to check the hardware capabilities before reporting this? I
> am not familiar with the ARM architecture, but typically it's better to
> make it like this,
>
> static bool arm_vsmmu_supports_veventq(struct iommufd_viommu *viommu,
> enum iommu_veventq_type type)
> {
> if (type != IOMMU_VEVENTQ_TYPE_ARM_SMMUV3)
> return false;
>
> if (hardware_not_capable(viommu))
> return false;
I think the ARM version of viommu_alloc op has already implemented
enough capability checks and rejected any of hardware_not_capable.
So, viommu shouldn't be a thing that the driver could actually use
to call this helper :)
Thanks
Nicolin
Powered by blists - more mailing lists