[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8af1a3c7-d5e6-46ca-a946-5d349e843ed6@linux.intel.com>
Date: Tue, 29 Apr 2025 14:11:32 +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,
bagasdotme@...il.com, robin.murphy@....com, joro@...tes.org,
thierry.reding@...il.com, vdumpa@...dia.com, jonathanh@...dia.com,
shuah@...nel.org, jsnitsel@...hat.com, nathan@...nel.org,
peterz@...radead.org, yi.l.liu@...el.com, mshavit@...gle.com,
praan@...gle.com, zhangzekun11@...wei.com, iommu@...ts.linux.dev,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-tegra@...r.kernel.org,
linux-kselftest@...r.kernel.org, patches@...ts.linux.dev, mochs@...dia.com,
alok.a.tiwari@...cle.com, vasant.hegde@....com
Subject: Re: [PATCH v2 10/22] iommufd/viommmu: Add IOMMUFD_CMD_VCMDQ_ALLOC
ioctl
On 4/29/25 02:58, Nicolin Chen wrote:
> On Mon, Apr 28, 2025 at 09:32:04AM +0800, Baolu Lu wrote:
>> On 4/26/25 13:58, Nicolin Chen wrote:
>>> +int iommufd_vcmdq_alloc_ioctl(struct iommufd_ucmd *ucmd)
>>> +{
>>> + struct iommu_vcmdq_alloc *cmd = ucmd->cmd;
>>> + struct iommufd_viommu *viommu;
>>> + struct iommufd_vcmdq *vcmdq;
>>> + struct page **pages;
>>> + int max_npages, i;
>>> + dma_addr_t end;
>>> + int rc;
>>> +
>>> + if (cmd->flags || cmd->type == IOMMU_VCMDQ_TYPE_DEFAULT)
>> I don't follow the check of 'cmd->type == IOMMU_VCMDQ_TYPE_DEFAULT'
>> here. My understanding is that it states that "other values of type are
>> not supported". If so, shouldn't it be,
>>
>> if (cmd->flags || cmd->type != IOMMU_VCMDQ_TYPE_DEFAULT)
>>
>> ?
> No. Only other (new) types will be supported. We have this:
> "* @IOMMU_VCMDQ_TYPE_DEFAULT: Reserved for future use"
> which means driver should define a new type.
>
> We have the same DEFAULT type in vIOMMU/vEVENTQ allocators by
> the way.
Okay, thanks for the explanation.
The iommu driver's callback will return a failure if the type is not
supported. Then it's fine.
Thanks,
baolu
Powered by blists - more mailing lists