[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <150e283f-1858-4282-912d-0bb78719b46b@linux.intel.com>
Date: Tue, 7 Jan 2025 14:27:39 +0800
From: Baolu Lu <baolu.lu@...ux.intel.com>
To: Nicolin Chen <nicolinc@...dia.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 1/7/25 14:00, Nicolin Chen wrote:
> 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 🙂
Okay, fair enough.
Powered by blists - more mailing lists