[PATCH v7 00/31] hw/arm/virt: Introduce Tegra241 CMDQV support for accelerated SMMUv3

Shameer Kolothum posted 31 patches 1 month, 1 week ago
Failed in applying to current master (apply log)
hw/arm/smmuv3-accel.h         |   48 ++
hw/arm/tegra241-cmdqv.h       |  384 +++++++++++
include/hw/arm/smmuv3.h       |    3 +
include/hw/arm/virt.h         |    1 +
include/system/iommufd.h      |   17 +-
include/system/memory.h       |   21 +
backends/iommufd.c            |   64 ++
hw/arm/smmuv3-accel-stubs.c   |   12 +
hw/arm/smmuv3-accel.c         |  194 ++++--
hw/arm/smmuv3.c               |   10 +
hw/arm/tegra241-cmdqv-stubs.c |   16 +
hw/arm/tegra241-cmdqv.c       | 1119 +++++++++++++++++++++++++++++++++
hw/arm/virt-acpi-build.c      |  127 ++--
hw/arm/virt.c                 |   37 ++
hw/vfio/iommufd.c             |    4 +-
hw/vfio/listener.c            |    6 +
system/memory.c               |   10 +
backends/trace-events         |    4 +-
hw/arm/Kconfig                |    5 +
hw/arm/meson.build            |    2 +
hw/arm/trace-events           |   11 +
hw/vfio/trace-events          |    1 +
qemu-options.hx               |    8 +
23 files changed, 2024 insertions(+), 80 deletions(-)
create mode 100644 hw/arm/tegra241-cmdqv.h
create mode 100644 hw/arm/tegra241-cmdqv-stubs.c
create mode 100644 hw/arm/tegra241-cmdqv.c
[PATCH v7 00/31] hw/arm/virt: Introduce Tegra241 CMDQV support for accelerated SMMUv3
Posted by Shameer Kolothum 1 month, 1 week ago
Hi,

Changes from v6:
 https://lore.kernel.org/qemu-devel/20260601114221.457995-1-skolothumtho@nvidia.com/

 - Addressed v6 feedback and picked up R-by/T-by tags. Thanks!
 - mmap the host VINTF Page0 at IOMMU_VIOMMU_ALLOC instead of on VINTF
   enable (patch #14)
 - Reset the per-VCMDQ Page0 cache when a queue is freed (patch #19)
 - Distributed the reset teardown into the patches that introduce each
   resource (patches #18, #21)
 - Added a VCMDQ readiness helper and renamed the Page0 backing-pointer
   helper to vintf_lvcmdq_ptr() (patches #18, #19)
 - Trace the VCMDQ Page0 backing, hw vs cache (patch #19)
 - Renamed patch #24 to reflect the changes accurately
 - Updated the design and lifecycle documentation (patch #30)
 - Based on top of Nathan's "Resolve AUTO properties" v6 series [0].
 
Please find the complete branch here:
 https://github.com/shamiali2008/qemu-master/tree/master-vcmdq-v7-ext
 
Sanity tested on NVIDIA Grace. Further testing in progress.

Feedback and testing are very welcome.

Thanks,
Shameer
[0] https://lore.kernel.org/qemu-devel/20260608174900.2227340-1-nathanc@nvidia.com/

---
Background(from RFCv1):
https://lore.kernel.org/qemu-devel/20251210133737.78257-1-skolothumtho@nvidia.com/

Thanks to Nicolin for the initial patches and testing on which this
is based.

Tegra241 CMDQV extends SMMUv3 by allocating per-VM "virtual interfaces"
(VINTFs), each hosting up to 128 VCMDQs.

Each VINTF exposes two 64KB MMIO pages:
 - Page0 – guest owned control and status registers (directly mapped
           into the VM)
 - Page1 – queue configuration registers (trapped/emulated by QEMU)

Unlike the standard SMMU CMDQ, a guest owned Tegra241 VCMDQ does not
support the full command set. Only a subset, primarily invalidation
related commands, is accepted by the CMDQV hardware. For this reason,
a distinct CMDQV device must be exposed to the guest, and the guest OS
must include a Tegra241 CMDQV aware driver to take advantage of the
hardware acceleration.

VCMDQ support is integrated via the IOMMU_HW_QUEUE_ALLOC mechanism,
allowing QEMU to attach guest configured VCMDQ buffers to the
underlying CMDQV hardware through IOMMUFD. The Linux kernel already
supports the full CMDQV virtualisation model via IOMMUFD[0].
---

Nicolin Chen (15):
  backends/iommufd: Update iommufd_backend_get_device_info
  backends/iommufd: Update iommufd_backend_alloc_viommu to allow user
    ptr
  backends/iommufd: Introduce iommufd_backend_alloc_hw_queue
  backends/iommufd: Introduce iommufd_backend_viommu_mmap
  hw/arm/tegra241-cmdqv: Implement CMDQV init
  hw/arm/tegra241-cmdqv: Implement CMDQV vIOMMU alloc/free
  hw/arm/tegra241-cmdqv: mmap host VINTF Page0 for CMDQV
  hw/arm/tegra241-cmdqv: Emulate CMDQ-V Config region
  hw/arm/tegra241-cmdqv: Emulate VCMDQ register reads
  hw/arm/tegra241-cmdqv: Emulate VCMDQ register writes
  hw/arm/tegra241-cmdqv: Allocate HW VCMDQs once configured
  hw/arm/tegra241-cmdqv: Use mmap'd host VINTF page0 for virtual VINTF
    page0
  hw/arm/tegra241-cmdqv: Initialize register state on reset
  hw/arm/tegra241-cmdqv: Limit queue size based on backend page size
  hw/arm/virt-acpi: Advertise Tegra241 CMDQV nodes in DSDT

Shameer Kolothum (16):
  system/iommufd: Remove unused viommu pointer from IOMMUFDVeventq
  hw/arm/smmuv3-accel: Introduce CMDQV ops interface
  hw/arm/tegra241-cmdqv: Add Tegra241 CMDQV ops backend stub
  hw/arm/smmuv3-accel: Wire CMDQV ops into accel lifecycle
  hw/arm/virt: Use stored SMMUv3 device list for IORT build
  hw/arm/tegra241-cmdqv: Probe host Tegra241 CMDQV support
  hw/arm/virt: Link SMMUv3 CMDQV resources to platform bus
  hw/arm/tegra241-cmdqv: Route allocated VCMDQ Page0 accesses to the
    mmap'd host VINTF page0
  memory: Allow RAM device regions to skip IOMMU mapping
  hw/arm/smmuv3-accel: Introduce common helper for veventq read
  hw/arm/tegra241-cmdqv: Read and propagate Tegra241 CMDQV errors
  hw/arm/smmuv3: Add per-device identifier property
  hw/arm/smmuv3-accel: Introduce helper to query CMDQV type
  hw/arm/smmuv3-accel: Enforce viommu association when CMDQV is active
  hw/arm/tegra241-cmdqv: Document the CMDQV design and lifecycle
  hw/arm/smmuv3: Add cmdqv property for SMMUv3 device

 hw/arm/smmuv3-accel.h         |   48 ++
 hw/arm/tegra241-cmdqv.h       |  384 +++++++++++
 include/hw/arm/smmuv3.h       |    3 +
 include/hw/arm/virt.h         |    1 +
 include/system/iommufd.h      |   17 +-
 include/system/memory.h       |   21 +
 backends/iommufd.c            |   64 ++
 hw/arm/smmuv3-accel-stubs.c   |   12 +
 hw/arm/smmuv3-accel.c         |  194 ++++--
 hw/arm/smmuv3.c               |   10 +
 hw/arm/tegra241-cmdqv-stubs.c |   16 +
 hw/arm/tegra241-cmdqv.c       | 1119 +++++++++++++++++++++++++++++++++
 hw/arm/virt-acpi-build.c      |  127 ++--
 hw/arm/virt.c                 |   37 ++
 hw/vfio/iommufd.c             |    4 +-
 hw/vfio/listener.c            |    6 +
 system/memory.c               |   10 +
 backends/trace-events         |    4 +-
 hw/arm/Kconfig                |    5 +
 hw/arm/meson.build            |    2 +
 hw/arm/trace-events           |   11 +
 hw/vfio/trace-events          |    1 +
 qemu-options.hx               |    8 +
 23 files changed, 2024 insertions(+), 80 deletions(-)
 create mode 100644 hw/arm/tegra241-cmdqv.h
 create mode 100644 hw/arm/tegra241-cmdqv-stubs.c
 create mode 100644 hw/arm/tegra241-cmdqv.c

-- 
2.43.0


Re: [PATCH v7 00/31] hw/arm/virt: Introduce Tegra241 CMDQV support for accelerated SMMUv3
Posted by Eric Auger 1 month, 1 week ago
Hi Shameer, Peter,

On 6/9/26 1:25 PM, Shameer Kolothum wrote:
> Hi,
>
> Changes from v6:
>  https://lore.kernel.org/qemu-devel/20260601114221.457995-1-skolothumtho@nvidia.com/
>
>  - Addressed v6 feedback and picked up R-by/T-by tags. Thanks!
>  - mmap the host VINTF Page0 at IOMMU_VIOMMU_ALLOC instead of on VINTF
>    enable (patch #14)
>  - Reset the per-VCMDQ Page0 cache when a queue is freed (patch #19)
>  - Distributed the reset teardown into the patches that introduce each
>    resource (patches #18, #21)
>  - Added a VCMDQ readiness helper and renamed the Page0 backing-pointer
>    helper to vintf_lvcmdq_ptr() (patches #18, #19)
>  - Trace the VCMDQ Page0 backing, hw vs cache (patch #19)
>  - Renamed patch #24 to reflect the changes accurately
>  - Updated the design and lifecycle documentation (patch #30)
>  - Based on top of Nathan's "Resolve AUTO properties" v6 series [0].
>  
> Please find the complete branch here:
>  https://github.com/shamiali2008/qemu-master/tree/master-vcmdq-v7-ext
>  
> Sanity tested on NVIDIA Grace. Further testing in progress.

Successfully tested on Grace-Hopper. Feel free to take my T-b:

Tested-by: Eric Auger <eric.auger@redhat.com>

All patches are now reviewed. Peter, please consider pulling this if you
are satisfied with it, in addition to

[PATCH v6 0/9] hw/arm/smmuv3-accel: Resolve AUTO properties <https://lore.kernel.org/all/20c8948f-1933-4410-96fc-10a2d53cb40a@redhat.com/#r>
[PATCH v2] hw/pci/pci: Enforce pci_setup_iommu_per_bus() is called only
once per bus

( see
https://lore.kernel.org/all/20c8948f-1933-4410-96fc-10a2d53cb40a@redhat.com/)

Thanks

Eric



>
> Feedback and testing are very welcome.
>
> Thanks,
> Shameer
> [0] https://lore.kernel.org/qemu-devel/20260608174900.2227340-1-nathanc@nvidia.com/
>
> ---
> Background(from RFCv1):
> https://lore.kernel.org/qemu-devel/20251210133737.78257-1-skolothumtho@nvidia.com/
>
> Thanks to Nicolin for the initial patches and testing on which this
> is based.
>
> Tegra241 CMDQV extends SMMUv3 by allocating per-VM "virtual interfaces"
> (VINTFs), each hosting up to 128 VCMDQs.
>
> Each VINTF exposes two 64KB MMIO pages:
>  - Page0 – guest owned control and status registers (directly mapped
>            into the VM)
>  - Page1 – queue configuration registers (trapped/emulated by QEMU)
>
> Unlike the standard SMMU CMDQ, a guest owned Tegra241 VCMDQ does not
> support the full command set. Only a subset, primarily invalidation
> related commands, is accepted by the CMDQV hardware. For this reason,
> a distinct CMDQV device must be exposed to the guest, and the guest OS
> must include a Tegra241 CMDQV aware driver to take advantage of the
> hardware acceleration.
>
> VCMDQ support is integrated via the IOMMU_HW_QUEUE_ALLOC mechanism,
> allowing QEMU to attach guest configured VCMDQ buffers to the
> underlying CMDQV hardware through IOMMUFD. The Linux kernel already
> supports the full CMDQV virtualisation model via IOMMUFD[0].
> ---
>
> Nicolin Chen (15):
>   backends/iommufd: Update iommufd_backend_get_device_info
>   backends/iommufd: Update iommufd_backend_alloc_viommu to allow user
>     ptr
>   backends/iommufd: Introduce iommufd_backend_alloc_hw_queue
>   backends/iommufd: Introduce iommufd_backend_viommu_mmap
>   hw/arm/tegra241-cmdqv: Implement CMDQV init
>   hw/arm/tegra241-cmdqv: Implement CMDQV vIOMMU alloc/free
>   hw/arm/tegra241-cmdqv: mmap host VINTF Page0 for CMDQV
>   hw/arm/tegra241-cmdqv: Emulate CMDQ-V Config region
>   hw/arm/tegra241-cmdqv: Emulate VCMDQ register reads
>   hw/arm/tegra241-cmdqv: Emulate VCMDQ register writes
>   hw/arm/tegra241-cmdqv: Allocate HW VCMDQs once configured
>   hw/arm/tegra241-cmdqv: Use mmap'd host VINTF page0 for virtual VINTF
>     page0
>   hw/arm/tegra241-cmdqv: Initialize register state on reset
>   hw/arm/tegra241-cmdqv: Limit queue size based on backend page size
>   hw/arm/virt-acpi: Advertise Tegra241 CMDQV nodes in DSDT
>
> Shameer Kolothum (16):
>   system/iommufd: Remove unused viommu pointer from IOMMUFDVeventq
>   hw/arm/smmuv3-accel: Introduce CMDQV ops interface
>   hw/arm/tegra241-cmdqv: Add Tegra241 CMDQV ops backend stub
>   hw/arm/smmuv3-accel: Wire CMDQV ops into accel lifecycle
>   hw/arm/virt: Use stored SMMUv3 device list for IORT build
>   hw/arm/tegra241-cmdqv: Probe host Tegra241 CMDQV support
>   hw/arm/virt: Link SMMUv3 CMDQV resources to platform bus
>   hw/arm/tegra241-cmdqv: Route allocated VCMDQ Page0 accesses to the
>     mmap'd host VINTF page0
>   memory: Allow RAM device regions to skip IOMMU mapping
>   hw/arm/smmuv3-accel: Introduce common helper for veventq read
>   hw/arm/tegra241-cmdqv: Read and propagate Tegra241 CMDQV errors
>   hw/arm/smmuv3: Add per-device identifier property
>   hw/arm/smmuv3-accel: Introduce helper to query CMDQV type
>   hw/arm/smmuv3-accel: Enforce viommu association when CMDQV is active
>   hw/arm/tegra241-cmdqv: Document the CMDQV design and lifecycle
>   hw/arm/smmuv3: Add cmdqv property for SMMUv3 device
>
>  hw/arm/smmuv3-accel.h         |   48 ++
>  hw/arm/tegra241-cmdqv.h       |  384 +++++++++++
>  include/hw/arm/smmuv3.h       |    3 +
>  include/hw/arm/virt.h         |    1 +
>  include/system/iommufd.h      |   17 +-
>  include/system/memory.h       |   21 +
>  backends/iommufd.c            |   64 ++
>  hw/arm/smmuv3-accel-stubs.c   |   12 +
>  hw/arm/smmuv3-accel.c         |  194 ++++--
>  hw/arm/smmuv3.c               |   10 +
>  hw/arm/tegra241-cmdqv-stubs.c |   16 +
>  hw/arm/tegra241-cmdqv.c       | 1119 +++++++++++++++++++++++++++++++++
>  hw/arm/virt-acpi-build.c      |  127 ++--
>  hw/arm/virt.c                 |   37 ++
>  hw/vfio/iommufd.c             |    4 +-
>  hw/vfio/listener.c            |    6 +
>  system/memory.c               |   10 +
>  backends/trace-events         |    4 +-
>  hw/arm/Kconfig                |    5 +
>  hw/arm/meson.build            |    2 +
>  hw/arm/trace-events           |   11 +
>  hw/vfio/trace-events          |    1 +
>  qemu-options.hx               |    8 +
>  23 files changed, 2024 insertions(+), 80 deletions(-)
>  create mode 100644 hw/arm/tegra241-cmdqv.h
>  create mode 100644 hw/arm/tegra241-cmdqv-stubs.c
>  create mode 100644 hw/arm/tegra241-cmdqv.c
>


Re: [PATCH v7 00/31] hw/arm/virt: Introduce Tegra241 CMDQV support for accelerated SMMUv3
Posted by Peter Maydell 1 month ago
On Thu, 11 Jun 2026 at 16:52, Eric Auger <eric.auger@redhat.com> wrote:
>
> Hi Shameer, Peter,
>
> On 6/9/26 1:25 PM, Shameer Kolothum wrote:
> > Hi,
> >
> > Changes from v6:
> >  https://lore.kernel.org/qemu-devel/20260601114221.457995-1-skolothumtho@nvidia.com/
> >
> >  - Addressed v6 feedback and picked up R-by/T-by tags. Thanks!
> >  - mmap the host VINTF Page0 at IOMMU_VIOMMU_ALLOC instead of on VINTF
> >    enable (patch #14)
> >  - Reset the per-VCMDQ Page0 cache when a queue is freed (patch #19)
> >  - Distributed the reset teardown into the patches that introduce each
> >    resource (patches #18, #21)
> >  - Added a VCMDQ readiness helper and renamed the Page0 backing-pointer
> >    helper to vintf_lvcmdq_ptr() (patches #18, #19)
> >  - Trace the VCMDQ Page0 backing, hw vs cache (patch #19)
> >  - Renamed patch #24 to reflect the changes accurately
> >  - Updated the design and lifecycle documentation (patch #30)
> >  - Based on top of Nathan's "Resolve AUTO properties" v6 series [0].
> >
> > Please find the complete branch here:
> >  https://github.com/shamiali2008/qemu-master/tree/master-vcmdq-v7-ext
> >
> > Sanity tested on NVIDIA Grace. Further testing in progress.
>
> Successfully tested on Grace-Hopper. Feel free to take my T-b:
>
> Tested-by: Eric Auger <eric.auger@redhat.com>
>
> All patches are now reviewed. Peter, please consider pulling this if you
> are satisfied with it, in addition to
>
> [PATCH v6 0/9] hw/arm/smmuv3-accel: Resolve AUTO properties <https://lore.kernel.org/all/20c8948f-1933-4410-96fc-10a2d53cb40a@redhat.com/#r>
> [PATCH v2] hw/pci/pci: Enforce pci_setup_iommu_per_bus() is called only
> once per bus

Thanks for doing the testing and review; I've applied this to
target-arm.next (after those two other patches).

-- PMM
Re: [PATCH v7 00/31] hw/arm/virt: Introduce Tegra241 CMDQV support for accelerated SMMUv3
Posted by Peter Maydell 1 month ago
On Tue, 9 Jun 2026 at 12:27, Shameer Kolothum <skolothumtho@nvidia.com> wrote:
>
> Hi,
>
> Changes from v6:
>  https://lore.kernel.org/qemu-devel/20260601114221.457995-1-skolothumtho@nvidia.com/
>
>  - Addressed v6 feedback and picked up R-by/T-by tags. Thanks!
>  - mmap the host VINTF Page0 at IOMMU_VIOMMU_ALLOC instead of on VINTF
>    enable (patch #14)
>  - Reset the per-VCMDQ Page0 cache when a queue is freed (patch #19)
>  - Distributed the reset teardown into the patches that introduce each
>    resource (patches #18, #21)
>  - Added a VCMDQ readiness helper and renamed the Page0 backing-pointer
>    helper to vintf_lvcmdq_ptr() (patches #18, #19)
>  - Trace the VCMDQ Page0 backing, hw vs cache (patch #19)
>  - Renamed patch #24 to reflect the changes accurately
>  - Updated the design and lifecycle documentation (patch #30)
>  - Based on top of Nathan's "Resolve AUTO properties" v6 series [0].
>
> Please find the complete branch here:
>  https://github.com/shamiali2008/qemu-master/tree/master-vcmdq-v7-ext
>
> Sanity tested on NVIDIA Grace. Further testing in progress.
>
> Feedback and testing are very welcome.



>  hw/arm/smmuv3-accel.h         |   48 ++
>  hw/arm/tegra241-cmdqv.h       |  384 +++++++++++
>  include/hw/arm/smmuv3.h       |    3 +
>  include/hw/arm/virt.h         |    1 +
>  include/system/iommufd.h      |   17 +-
>  include/system/memory.h       |   21 +
>  backends/iommufd.c            |   64 ++
>  hw/arm/smmuv3-accel-stubs.c   |   12 +
>  hw/arm/smmuv3-accel.c         |  194 ++++--
>  hw/arm/smmuv3.c               |   10 +
>  hw/arm/tegra241-cmdqv-stubs.c |   16 +
>  hw/arm/tegra241-cmdqv.c       | 1119 +++++++++++++++++++++++++++++++++
>  hw/arm/virt-acpi-build.c      |  127 ++--
>  hw/arm/virt.c                 |   37 ++
>  hw/vfio/iommufd.c             |    4 +-
>  hw/vfio/listener.c            |    6 +
>  system/memory.c               |   10 +
>  backends/trace-events         |    4 +-
>  hw/arm/Kconfig                |    5 +
>  hw/arm/meson.build            |    2 +
>  hw/arm/trace-events           |   11 +
>  hw/vfio/trace-events          |    1 +
>  qemu-options.hx               |    8 +
>  23 files changed, 2024 insertions(+), 80 deletions(-)
>  create mode 100644 hw/arm/tegra241-cmdqv.h
>  create mode 100644 hw/arm/tegra241-cmdqv-stubs.c
>  create mode 100644 hw/arm/tegra241-cmdqv.c

Hi -- I just noticed looking at this diffstat that it does not
make any updates to the documentation to describe this
new feature. Please could you add something (e.g. to
docs/system/arm/virt.rst, or elsewhere if more appropriate)
that describes whatever this new thing is and how to use it,
in terms that make sense to somebody who isn't deeply immersed in
the SMMU and this Nvidia specific bit of hardware ?
You can do this as a followup patch, as I've already queued
this series.

Also, a bullet point for the Changelog giving the short
summary of what the new thing is would be nice. This
cover letter was too cryptic for me to be able to guess :-)

thanks
-- PMM
RE: [PATCH v7 00/31] hw/arm/virt: Introduce Tegra241 CMDQV support for accelerated SMMUv3
Posted by Shameer Kolothum Thodi 1 month ago

> -----Original Message-----
> From: Peter Maydell <peter.maydell@linaro.org>
> Sent: 16 June 2026 20:10
> To: Shameer Kolothum Thodi <skolothumtho@nvidia.com>
> Cc: qemu-arm@nongnu.org; qemu-devel@nongnu.org;
> eric.auger@redhat.com; clg@redhat.com; alex@shazbot.org; Nicolin Chen
> <nicolinc@nvidia.com>; Nathan Chen <nathanc@nvidia.com>; Matt Ochs
> <mochs@nvidia.com>; Jiandi An <jan@nvidia.com>; Jason Gunthorpe
> <jgg@nvidia.com>; zhenzhong.duan@intel.com; Krishnakant Jaju
> <kjaju@nvidia.com>; phrdina@redhat.com
> Subject: Re: [PATCH v7 00/31] hw/arm/virt: Introduce Tegra241 CMDQV
> support for accelerated SMMUv3
> 
> External email: Use caution opening links or attachments
> 
> 
> On Tue, 9 Jun 2026 at 12:27, Shameer Kolothum
> <skolothumtho@nvidia.com> wrote:
> >
> > Hi,
> >
> > Changes from v6:
> >
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore.
> kernel.org%2Fqemu-devel%2F20260601114221.457995-1-
> skolothumtho%40nvidia.com%2F&data=05%7C02%7Cskolothumtho%40nvi
> dia.com%7C85054cd29a1d4722ba0908decbdaea61%7C43083d15727340c
> 1b7db39efd9ccc17a%7C0%7C0%7C639172338322799010%7CUnknown%
> 7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAi
> OiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdat
> a=L73ziLGdAYoHaufzjyIBUBafyDdhNnIE9EyaJbzJWjo%3D&reserved=0
> >
> >  - Addressed v6 feedback and picked up R-by/T-by tags. Thanks!
> >  - mmap the host VINTF Page0 at IOMMU_VIOMMU_ALLOC instead of on
> VINTF
> >    enable (patch #14)
> >  - Reset the per-VCMDQ Page0 cache when a queue is freed (patch #19)
> >  - Distributed the reset teardown into the patches that introduce each
> >    resource (patches #18, #21)
> >  - Added a VCMDQ readiness helper and renamed the Page0 backing-pointer
> >    helper to vintf_lvcmdq_ptr() (patches #18, #19)
> >  - Trace the VCMDQ Page0 backing, hw vs cache (patch #19)
> >  - Renamed patch #24 to reflect the changes accurately
> >  - Updated the design and lifecycle documentation (patch #30)
> >  - Based on top of Nathan's "Resolve AUTO properties" v6 series [0].
> >
> > Please find the complete branch here:
> >
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgith
> ub.com%2Fshamiali2008%2Fqemu-master%2Ftree%2Fmaster-vcmdq-v7-
> ext&data=05%7C02%7Cskolothumtho%40nvidia.com%7C85054cd29a1d47
> 22ba0908decbdaea61%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C
> 0%7C639172338322871287%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU
> 1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIs
> IldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=uHKbMM0Gxk6t%2Bw7gRw
> M%2FiTcx9xuDNFKeaDDFZ48qfZA%3D&reserved=0
> >
> > Sanity tested on NVIDIA Grace. Further testing in progress.
> >
> > Feedback and testing are very welcome.
> 
> 
> 
> >  hw/arm/smmuv3-accel.h         |   48 ++
> >  hw/arm/tegra241-cmdqv.h       |  384 +++++++++++
> >  include/hw/arm/smmuv3.h       |    3 +
> >  include/hw/arm/virt.h         |    1 +
> >  include/system/iommufd.h      |   17 +-
> >  include/system/memory.h       |   21 +
> >  backends/iommufd.c            |   64 ++
> >  hw/arm/smmuv3-accel-stubs.c   |   12 +
> >  hw/arm/smmuv3-accel.c         |  194 ++++--
> >  hw/arm/smmuv3.c               |   10 +
> >  hw/arm/tegra241-cmdqv-stubs.c |   16 +
> >  hw/arm/tegra241-cmdqv.c       | 1119
> +++++++++++++++++++++++++++++++++
> >  hw/arm/virt-acpi-build.c      |  127 ++--
> >  hw/arm/virt.c                 |   37 ++
> >  hw/vfio/iommufd.c             |    4 +-
> >  hw/vfio/listener.c            |    6 +
> >  system/memory.c               |   10 +
> >  backends/trace-events         |    4 +-
> >  hw/arm/Kconfig                |    5 +
> >  hw/arm/meson.build            |    2 +
> >  hw/arm/trace-events           |   11 +
> >  hw/vfio/trace-events          |    1 +
> >  qemu-options.hx               |    8 +
> >  23 files changed, 2024 insertions(+), 80 deletions(-)
> >  create mode 100644 hw/arm/tegra241-cmdqv.h
> >  create mode 100644 hw/arm/tegra241-cmdqv-stubs.c
> >  create mode 100644 hw/arm/tegra241-cmdqv.c
> 
> Hi -- I just noticed looking at this diffstat that it does not
> make any updates to the documentation to describe this
> new feature. Please could you add something (e.g. to
> docs/system/arm/virt.rst, or elsewhere if more appropriate)
> that describes whatever this new thing is and how to use it,
> in terms that make sense to somebody who isn't deeply immersed in
> the SMMU and this Nvidia specific bit of hardware ?
> You can do this as a followup patch, as I've already queued
> this series.

Thanks. We have this in qemu-options.hx(patch #31)

+    ``cmdqv=on|off|auto`` (default: auto)
+        Enable hardware Command Queue Virtualization (CMDQV) for the
+        SMMUv3 command queue. Currently only the NVIDIA Tegra241 CMDQV
+        implementation is supported.

We could add a subsection under "User-creatable SMMUv3 devices" in virt.rst
to add a bit more detail. I will send out a patch.

> Also, a bullet point for the Changelog giving the short
> summary of what the new thing is would be nice. This
> cover letter was too cryptic for me to be able to guess :-)

Maybe something like:

NVIDIA Tegra241 Hardware Command Queue Virtualisation (CMDQV) support is
now available via "-device arm-smmuv3,accel=on,cmdqv=on", giving each VM
dedicated hardware SMMUv3 command queues, improving performance.

Thanks,
Shameer