From: "Cédric Le Goater" <clg@redhat.com>
To: Shameer Kolothum <skolothumtho@nvidia.com>,
qemu-arm@nongnu.org, qemu-devel@nongnu.org
Cc: eric.auger@redhat.com, peter.maydell@linaro.org, jgg@nvidia.com,
nicolinc@nvidia.com, ddutile@redhat.com, berrange@redhat.com,
nathanc@nvidia.com, mochs@nvidia.com, smostafa@google.com,
wangzhou1@hisilicon.com, jiangkunkun@huawei.com,
jonathan.cameron@huawei.com, zhangfei.gao@linaro.org,
zhenzhong.duan@intel.com, yi.l.liu@intel.com, kjaju@nvidia.com
Subject: Re: [PATCH v6 30/33] backends/iommufd: Retrieve PASID width from iommufd_backend_get_device_info()
Date: Thu, 11 Dec 2025 16:24:35 +0100 [thread overview]
Message-ID: <4fd538c5-842c-4c96-83ed-dae4da8f8783@redhat.com> (raw)
In-Reply-To: <20251120132213.56581-31-skolothumtho@nvidia.com>
On 11/20/25 14:22, Shameer Kolothum wrote:
> Retrieve PASID width from iommufd_backend_get_device_info() and store it
> in HostIOMMUDeviceCaps for later use.
>
> Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
> Reviewed-by: Eric Auger <eric.auger@redhat.com>
> Tested-by: Zhangfei Gao <zhangfei.gao@linaro.org>
> Signed-off-by: Shameer Kolothum <skolothumtho@nvidia.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Thanks,
C.
> ---
> backends/iommufd.c | 6 +++++-
> hw/arm/smmuv3-accel.c | 3 ++-
> hw/vfio/iommufd.c | 7 +++++--
> include/system/host_iommu_device.h | 3 +++
> include/system/iommufd.h | 3 ++-
> 5 files changed, 17 insertions(+), 5 deletions(-)
>
> diff --git a/backends/iommufd.c b/backends/iommufd.c
> index e68a2c934f..6381f9664b 100644
> --- a/backends/iommufd.c
> +++ b/backends/iommufd.c
> @@ -388,7 +388,8 @@ bool iommufd_backend_get_dirty_bitmap(IOMMUFDBackend *be,
>
> bool iommufd_backend_get_device_info(IOMMUFDBackend *be, uint32_t devid,
> uint32_t *type, void *data, uint32_t len,
> - uint64_t *caps, Error **errp)
> + uint64_t *caps, uint8_t *max_pasid_log2,
> + Error **errp)
> {
> struct iommu_hw_info info = {
> .size = sizeof(info),
> @@ -407,6 +408,9 @@ bool iommufd_backend_get_device_info(IOMMUFDBackend *be, uint32_t devid,
> g_assert(caps);
> *caps = info.out_capabilities;
>
> + if (max_pasid_log2) {
> + *max_pasid_log2 = info.out_max_pasid_log2;
> + }
> return true;
> }
>
> diff --git a/hw/arm/smmuv3-accel.c b/hw/arm/smmuv3-accel.c
> index 35a94c720a..254d29ee2d 100644
> --- a/hw/arm/smmuv3-accel.c
> +++ b/hw/arm/smmuv3-accel.c
> @@ -113,7 +113,8 @@ smmuv3_accel_hw_compatible(SMMUv3State *s, HostIOMMUDeviceIOMMUFD *idev,
> uint64_t caps;
>
> if (!iommufd_backend_get_device_info(idev->iommufd, idev->devid, &data_type,
> - &info, sizeof(info), &caps, errp)) {
> + &info, sizeof(info), &caps, NULL,
> + errp)) {
> return false;
> }
>
> diff --git a/hw/vfio/iommufd.c b/hw/vfio/iommufd.c
> index ca8a6b7029..bbe944d7cc 100644
> --- a/hw/vfio/iommufd.c
> +++ b/hw/vfio/iommufd.c
> @@ -353,7 +353,8 @@ static bool iommufd_cdev_autodomains_get(VFIODevice *vbasedev,
> * instead.
> */
> if (!iommufd_backend_get_device_info(vbasedev->iommufd, vbasedev->devid,
> - &type, NULL, 0, &hw_caps, errp)) {
> + &type, NULL, 0, &hw_caps, NULL,
> + errp)) {
> return false;
> }
>
> @@ -889,19 +890,21 @@ static bool hiod_iommufd_vfio_realize(HostIOMMUDevice *hiod, void *opaque,
> HostIOMMUDeviceCaps *caps = &hiod->caps;
> VendorCaps *vendor_caps = &caps->vendor_caps;
> enum iommu_hw_info_type type;
> + uint8_t max_pasid_log2;
> uint64_t hw_caps;
>
> hiod->agent = opaque;
>
> if (!iommufd_backend_get_device_info(vdev->iommufd, vdev->devid, &type,
> vendor_caps, sizeof(*vendor_caps),
> - &hw_caps, errp)) {
> + &hw_caps, &max_pasid_log2, errp)) {
> return false;
> }
>
> hiod->name = g_strdup(vdev->name);
> caps->type = type;
> caps->hw_caps = hw_caps;
> + caps->max_pasid_log2 = max_pasid_log2;
>
> idev = HOST_IOMMU_DEVICE_IOMMUFD(hiod);
> idev->iommufd = vdev->iommufd;
> diff --git a/include/system/host_iommu_device.h b/include/system/host_iommu_device.h
> index ab849a4a82..bfb2b60478 100644
> --- a/include/system/host_iommu_device.h
> +++ b/include/system/host_iommu_device.h
> @@ -30,6 +30,8 @@ typedef union VendorCaps {
> * @hw_caps: host platform IOMMU capabilities (e.g. on IOMMUFD this represents
> * the @out_capabilities value returned from IOMMU_GET_HW_INFO ioctl)
> *
> + * @max_pasid_log2: width of PASIDs supported by host IOMMU device
> + *
> * @vendor_caps: host platform IOMMU vendor specific capabilities (e.g. on
> * IOMMUFD this represents a user-space buffer filled by kernel
> * with host IOMMU @type specific hardware information data)
> @@ -37,6 +39,7 @@ typedef union VendorCaps {
> typedef struct HostIOMMUDeviceCaps {
> uint32_t type;
> uint64_t hw_caps;
> + uint8_t max_pasid_log2;
> VendorCaps vendor_caps;
> } HostIOMMUDeviceCaps;
> #endif
> diff --git a/include/system/iommufd.h b/include/system/iommufd.h
> index 41e216c677..aa78bf1e1d 100644
> --- a/include/system/iommufd.h
> +++ b/include/system/iommufd.h
> @@ -71,7 +71,8 @@ int iommufd_backend_unmap_dma(IOMMUFDBackend *be, uint32_t ioas_id,
> hwaddr iova, uint64_t size);
> bool iommufd_backend_get_device_info(IOMMUFDBackend *be, uint32_t devid,
> uint32_t *type, void *data, uint32_t len,
> - uint64_t *caps, Error **errp);
> + uint64_t *caps, uint8_t *max_pasid_log2,
> + Error **errp);
> bool iommufd_backend_alloc_hwpt(IOMMUFDBackend *be, uint32_t dev_id,
> uint32_t pt_id, uint32_t flags,
> uint32_t data_type, uint32_t data_len,
next prev parent reply other threads:[~2025-12-11 15:25 UTC|newest]
Thread overview: 101+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-20 13:21 [PATCH v6 00/33] hw/arm/virt: Add support for user-creatable accelerated SMMUv3 Shameer Kolothum
2025-11-20 13:21 ` [PATCH v6 01/33] backends/iommufd: Introduce iommufd_backend_alloc_viommu Shameer Kolothum
2025-11-20 13:21 ` [PATCH v6 02/33] backends/iommufd: Introduce iommufd_backend_alloc_vdev Shameer Kolothum
2025-11-20 13:21 ` [PATCH v6 03/33] hw/arm/smmu-common: Factor out common helper functions and export Shameer Kolothum
2025-11-20 13:21 ` [PATCH v6 04/33] hw/arm/smmu-common: Make iommu ops part of SMMUState Shameer Kolothum
2025-12-11 11:03 ` Cédric Le Goater
2025-11-20 13:21 ` [PATCH v6 05/33] hw/arm/smmuv3-accel: Introduce smmuv3 accel device Shameer Kolothum
2025-12-11 12:54 ` Cédric Le Goater
2025-12-12 5:48 ` Shameer Kolothum
2025-11-20 13:21 ` [PATCH v6 06/33] hw/arm/smmuv3-accel: Initialize shared system address space Shameer Kolothum
2025-12-08 17:05 ` Eric Auger
2025-11-20 13:21 ` [PATCH v6 07/33] hw/pci/pci: Move pci_init_bus_master() after adding device to bus Shameer Kolothum
2025-11-20 20:44 ` Nicolin Chen
2025-11-20 13:21 ` [PATCH v6 08/33] hw/pci/pci: Add optional supports_address_space() callback Shameer Kolothum
2025-11-20 20:51 ` Nicolin Chen
2025-11-21 10:38 ` Shameer Kolothum
2025-11-21 17:28 ` Nicolin Chen
2025-11-21 17:32 ` Shameer Kolothum
2025-12-11 14:40 ` Cédric Le Goater
2025-12-12 5:54 ` Shameer Kolothum
2025-11-20 13:21 ` [PATCH v6 09/33] hw/pci-bridge/pci_expander_bridge: Move TYPE_PXB_PCIE_DEV to header Shameer Kolothum
2025-11-20 20:52 ` Nicolin Chen
2025-11-20 13:21 ` [PATCH v6 10/33] hw/arm/smmuv3-accel: Restrict accelerated SMMUv3 to vfio-pci endpoints with iommufd Shameer Kolothum
2025-11-20 13:21 ` [PATCH v6 11/33] hw/arm/smmuv3: Implement get_viommu_cap() callback Shameer Kolothum
2025-11-20 13:21 ` [PATCH v6 12/33] hw/arm/smmuv3-accel: Add set/unset_iommu_device callback Shameer Kolothum
2025-12-09 7:57 ` Eric Auger
2025-12-11 13:41 ` Cédric Le Goater
2025-11-20 13:21 ` [PATCH v6 13/33] hw/arm/smmuv3: propagate smmuv3_cmdq_consume() errors to caller Shameer Kolothum
2025-11-20 20:59 ` Nicolin Chen
2025-12-04 16:28 ` Eric Auger
2025-11-20 13:21 ` [PATCH v6 14/33] hw/arm/smmuv3-accel: Add nested vSTE install/uninstall support Shameer Kolothum
2025-12-09 8:14 ` Eric Auger
2025-11-20 13:21 ` [PATCH v6 15/33] hw/arm/smmuv3-accel: Install SMMUv3 GBPA based hwpt Shameer Kolothum
2025-11-20 21:03 ` Nicolin Chen
2025-11-20 13:21 ` [PATCH v6 16/33] hw/pci/pci: Introduce a callback to retrieve the MSI doorbell GPA directly Shameer Kolothum
2025-11-20 21:05 ` Nicolin Chen
2025-12-04 16:38 ` Eric Auger
2025-12-04 18:57 ` Shameer Kolothum
2025-12-08 17:03 ` Eric Auger
2025-11-20 13:21 ` [PATCH v6 17/33] hw/arm/smmuv3: Add support for providing a direct MSI doorbell GPA Shameer Kolothum
2025-11-20 21:21 ` Nicolin Chen
2025-11-21 9:57 ` Shameer Kolothum
2025-11-21 17:56 ` Nicolin Chen
2025-11-24 8:05 ` Shameer Kolothum
2025-11-24 18:34 ` Nicolin Chen
2025-11-24 19:01 ` Shameer Kolothum
2025-11-24 20:08 ` Nicolin Chen
2025-12-11 14:03 ` Cédric Le Goater
2025-11-20 13:21 ` [PATCH v6 18/33] hw/arm/smmuv3-accel: Add support to issue invalidation cmd to host Shameer Kolothum
2025-11-20 13:21 ` [PATCH v6 19/33] hw/arm/smmuv3: Initialize ID registers early during realize() Shameer Kolothum
2025-11-20 13:22 ` [PATCH v6 20/33] hw/arm/smmuv3-accel: Get host SMMUv3 hw info and validate Shameer Kolothum
2025-11-20 21:27 ` Nicolin Chen
2025-11-20 21:30 ` Nicolin Chen
2025-11-20 13:22 ` [PATCH v6 21/33] hw/pci-host/gpex: Allow to generate preserve boot config DSM #5 Shameer Kolothum
2025-11-20 13:22 ` [PATCH v6 22/33] hw/arm/virt: Set PCI preserve_config for accel SMMUv3 Shameer Kolothum
2025-11-20 13:22 ` [PATCH v6 23/33] tests/qtest/bios-tables-test: Prepare for IORT revison upgrade Shameer Kolothum
2025-11-20 13:22 ` [PATCH v6 24/33] hw/arm/virt-acpi-build: Add IORT RMR regions to handle MSI nested binding Shameer Kolothum
2025-11-20 13:22 ` [PATCH v6 25/33] tests/qtest/bios-tables-test: Update IORT blobs after revision upgrade Shameer Kolothum
2025-11-20 13:22 ` [PATCH v6 26/33] hw/arm/smmuv3: Add accel property for SMMUv3 device Shameer Kolothum
2025-12-11 15:11 ` Cédric Le Goater
2025-11-20 13:22 ` [PATCH v6 27/33] hw/arm/smmuv3-accel: Add a property to specify RIL support Shameer Kolothum
2025-11-20 21:34 ` Nicolin Chen via
2025-11-21 10:04 ` Shameer Kolothum
2025-12-11 15:14 ` Cédric Le Goater
2025-11-20 13:22 ` [PATCH v6 28/33] hw/arm/smmuv3-accel: Add support for ATS Shameer Kolothum
2025-11-20 21:40 ` Nicolin Chen
2025-11-24 12:00 ` Zhangfei Gao
2025-11-24 12:48 ` Shameer Kolothum
2025-12-08 17:36 ` Eric Auger
2025-11-20 13:22 ` [PATCH v6 29/33] hw/arm/smmuv3-accel: Add property to specify OAS bits Shameer Kolothum
2025-11-20 21:47 ` Nicolin Chen
2025-12-08 17:17 ` Eric Auger
2025-12-11 15:23 ` Cédric Le Goater
2025-11-20 13:22 ` [PATCH v6 30/33] backends/iommufd: Retrieve PASID width from iommufd_backend_get_device_info() Shameer Kolothum
2025-11-20 21:50 ` Nicolin Chen
2025-12-11 15:24 ` Cédric Le Goater [this message]
2025-11-20 13:22 ` [PATCH v6 31/33] Extend get_cap() callback to support PASID Shameer Kolothum
2025-11-20 21:56 ` Nicolin Chen
2025-12-08 17:20 ` Eric Auger
2025-12-11 15:26 ` Cédric Le Goater
2025-11-20 13:22 ` [PATCH v6 32/33] vfio: Synthesize vPASID capability to VM Shameer Kolothum
2025-11-20 21:59 ` Nicolin Chen
2025-12-09 9:51 ` Eric Auger
2025-12-09 11:17 ` Yi Liu
2025-11-20 13:22 ` [PATCH v6 33/33] hw/arm/smmuv3-accel: Add support for PASID enable Shameer Kolothum
2025-11-20 22:09 ` Nicolin Chen
2025-11-21 10:22 ` Shameer Kolothum
2025-11-21 17:50 ` Nicolin Chen
2025-11-21 18:36 ` Nicolin Chen
2025-11-21 18:44 ` Jason Gunthorpe
2025-11-24 8:17 ` Shameer Kolothum
2025-11-20 17:06 ` [PATCH v6 00/33] hw/arm/virt: Add support for user-creatable accelerated SMMUv3 Nicolin Chen
2025-11-24 12:09 ` Zhangfei Gao
2025-12-08 10:08 ` Duan, Zhenzhong
2025-12-08 11:15 ` Shameer Kolothum
2025-12-09 2:30 ` Duan, Zhenzhong
2025-12-09 3:33 ` Yi Liu
2025-12-09 10:31 ` Cédric Le Goater
2025-12-10 15:07 ` Shameer Kolothum
2025-12-10 16:07 ` Cédric Le Goater
2025-12-10 16:18 ` Eric Auger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4fd538c5-842c-4c96-83ed-dae4da8f8783@redhat.com \
--to=clg@redhat.com \
--cc=berrange@redhat.com \
--cc=ddutile@redhat.com \
--cc=eric.auger@redhat.com \
--cc=jgg@nvidia.com \
--cc=jiangkunkun@huawei.com \
--cc=jonathan.cameron@huawei.com \
--cc=kjaju@nvidia.com \
--cc=mochs@nvidia.com \
--cc=nathanc@nvidia.com \
--cc=nicolinc@nvidia.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=skolothumtho@nvidia.com \
--cc=smostafa@google.com \
--cc=wangzhou1@hisilicon.com \
--cc=yi.l.liu@intel.com \
--cc=zhangfei.gao@linaro.org \
--cc=zhenzhong.duan@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).