[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <28e513ec-4d8b-4967-a241-d6f63d533050@linux.intel.com>
Date: Mon, 28 Apr 2025 09:09:19 +0800
From: Baolu Lu <baolu.lu@...ux.intel.com>
To: Nicolin Chen <nicolinc@...dia.com>, jgg@...dia.com, kevin.tian@...el.com,
corbet@....net, will@...nel.org
Cc: 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 09/22] iommufd/viommu: Introduce IOMMUFD_OBJ_VCMDQ and
its related struct
On 4/26/25 13:58, Nicolin Chen wrote:
> Add a new IOMMUFD_OBJ_VCMDQ with an iommufd_vcmdq structure, representing
> a command queue type of physical HW passed to a user space VM. This vCMDQ
> object, is a subset of vIOMMU resources of a physical IOMMU's, such as:
> - NVIDIA's virtual command queue
> - AMD vIOMMU's command buffer
>
> Inroduce a struct iommufd_vcmdq and its allocator iommufd_vcmdq_alloc().
> Also add a pair of viommu ops for iommufd to forward user space ioctls to
> IOMMU drivers.
>
> Signed-off-by: Nicolin Chen<nicolinc@...dia.com>
Reviewed-by: Lu Baolu <baolu.lu@...ux.intel.com>
with a small nit below ...
> ---
> include/linux/iommufd.h | 35 +++++++++++++++++++++++++++++++++++
> 1 file changed, 35 insertions(+)
>
> diff --git a/include/linux/iommufd.h b/include/linux/iommufd.h
> index ef0d3c4765cf..e91381aaec5a 100644
> --- a/include/linux/iommufd.h
> +++ b/include/linux/iommufd.h
> @@ -37,6 +37,7 @@ enum iommufd_object_type {
> IOMMUFD_OBJ_VIOMMU,
> IOMMUFD_OBJ_VDEVICE,
> IOMMUFD_OBJ_VEVENTQ,
> + IOMMUFD_OBJ_VCMDQ,
> #ifdef CONFIG_IOMMUFD_TEST
> IOMMUFD_OBJ_SELFTEST,
> #endif
> @@ -112,6 +113,14 @@ struct iommufd_vdevice {
> u64 id; /* per-vIOMMU virtual ID */
> };
>
> +struct iommufd_vcmdq {
> + struct iommufd_object obj;
> + struct iommufd_ctx *ictx;
> + struct iommufd_viommu *viommu;
> + dma_addr_t addr;
It's better to add a comment to state that @addr is a guest physical
address. Or not?
> + size_t length;
> +};
Thanks,
baolu
Powered by blists - more mailing lists