[PATCH for-11.0 v4 0/8] hw/arm/smmuv3-accel: Support AUTO properties

Nathan Chen posted 8 patches 2 weeks, 4 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260318184907.4060030-1-nathanc@nvidia.com
Maintainers: Eric Auger <eric.auger@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, "Michael S. Tsirkin" <mst@redhat.com>, Igor Mammedov <imammedo@redhat.com>, Ani Sinha <anisinha@redhat.com>, Shannon Zhao <shannon.zhaosl@gmail.com>, Paolo Bonzini <pbonzini@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Eric Blake <eblake@redhat.com>, Markus Armbruster <armbru@redhat.com>
There is a newer version of this series
hw/arm/smmuv3-accel.c                    | 41 ++++++++++++---
hw/arm/smmuv3.c                          | 63 +++++++++++++++---------
hw/arm/virt-acpi-build.c                 |  2 +-
hw/core/qdev-properties-system.c         | 27 ++++++++++
include/hw/arm/smmuv3-common.h           |  3 --
include/hw/arm/smmuv3.h                  | 11 +++--
include/hw/core/qdev-properties-system.h |  6 +++
qapi/misc-arm.json                       | 44 +++++++++++++++++
qapi/pragma.json                         |  1 +
qemu-options.hx                          | 32 +++++++++++-
10 files changed, 192 insertions(+), 38 deletions(-)
[PATCH for-11.0 v4 0/8] hw/arm/smmuv3-accel: Support AUTO properties
Posted by Nathan Chen 2 weeks, 4 days ago
Hi,

This is a follow-up to the previous series [0] that introduces support
for specifying 'auto' for arm-smmuv3 accelerated mode's ATS, RIL,
SSIDSIZE, and OAS feature properties.

In QEMU 11.0 we introduced new options for vSMMU [1], but feedback received
when starting the integration of layered products shows the need for
auto/host-retrieved values. To avoid breaking JSON/QMP compat, we want
to fix the option types so that they can later support the auto mode. At
the moment the auto mode is not supported though.

A future series will introduce support for resolving the 'auto' values
based on host SMMUv3 IDR values, as well as setting per-device ATS
capability.

A complete branch can be found here:
https://github.com/NathanChenNVIDIA/qemu/tree/smmuv3-accel-auto-v4

Please take a look and let me know your feedback.

Thanks,
Nathan

Changes from v3:
- Revise auto support error message
- Restore original comment for ATS in smmuv3_accel_idr_override()
- Update the description in object_class_property_set_description()
  to mention auto mode not supported.
- Move auto mode check before check for accel=on
- Remove SMMU_OAS_44BIT/_48BIT and SMMU_SSID_MAX_BITS defines
- Consolidate documentation notes about properties only being
  available for accel=on and not supporting auto mode.
- Include R-by and T-by tags from v3, thanks Eric and Shameer!

Changes from v2:
- Enforce 'auto' value not being supported for HW-accel SMMUv3 props
- Revise docs to mention auto is not supported and these properties
  are only applicable when accel=on.
- Only override non-defaults in smmuv3_accel_idr_override()
- Remove check for SSIDSIZE AUTO in smmuv3_accel_idr_override() as
  smmu_validate_property() checks for AUTO beforehand
- Consolidate comments for ssidsize_mode_to_value()
- Include Fixes tags in commit descriptions
- Include R-by tags from v2

Changes from RFCv1:
- Remove changes that resolve the 'auto' values based on host SMMUv3
- Restore defaults values for RIL, OAS, SSIDSIZE, and ATS
- Update OasMode to accept all OAS sizes instead of only auto, 44, and
  48
- Include comment in SsidSizeMode schema clarifying enum value
  ordering
- Replace ats-enabled prop with a helper that accepts the dynamic
  casted TYPE_ARM_SMMUV3 object
- Separate out guest vs. host ATS check in
  smmuv3_accel_check_hw_compatible() to a different commit
- Document accel, RIL, OAS, SSIDSIZE, and ATS properties in
  qemu-options.hx

Testing:
Basic sanity testing was performed on an NVIDIA Grace platform with GPU
device assignment and running CUDA test apps on the guest. Additional
testing and feedback are welcome.

[0] https://lore.kernel.org/qemu-devel/20260317183755.3721625-1-nathanc@nvidia.com/
[1] https://lore.kernel.org/all/20260126104342.253965-1-skolothumtho@nvidia.com/

Nathan Chen (8):
  hw/arm/smmuv3-accel: Check ATS compatibility between host and guest
  hw/arm/smmuv3-accel: Change ATS property to OnOffAuto
  hw/arm/smmuv3-accel: Change RIL property to OnOffAuto
  qdev: Add a SsidSizeMode property
  hw/arm/smmuv3-accel: Change SSIDSIZE property to SsidSizeMode
  qdev: Add an OasMode property
  hw/arm/smmuv3-accel: Change OAS property to OasMode
  qemu-options.hx: Document arm-smmuv3 device's accel properties

 hw/arm/smmuv3-accel.c                    | 41 ++++++++++++---
 hw/arm/smmuv3.c                          | 63 +++++++++++++++---------
 hw/arm/virt-acpi-build.c                 |  2 +-
 hw/core/qdev-properties-system.c         | 27 ++++++++++
 include/hw/arm/smmuv3-common.h           |  3 --
 include/hw/arm/smmuv3.h                  | 11 +++--
 include/hw/core/qdev-properties-system.h |  6 +++
 qapi/misc-arm.json                       | 44 +++++++++++++++++
 qapi/pragma.json                         |  1 +
 qemu-options.hx                          | 32 +++++++++++-
 10 files changed, 192 insertions(+), 38 deletions(-)

-- 
2.43.0
Re: [PATCH for-11.0 v4 0/8] hw/arm/smmuv3-accel: Support AUTO properties
Posted by Eric Auger 2 weeks, 4 days ago
Hi Nathan,

On 3/18/26 7:48 PM, Nathan Chen wrote:
> Hi,
>
> This is a follow-up to the previous series [0] that introduces support
> for specifying 'auto' for arm-smmuv3 accelerated mode's ATS, RIL,
> SSIDSIZE, and OAS feature properties.
>
> In QEMU 11.0 we introduced new options for vSMMU [1], but feedback received
> when starting the integration of layered products shows the need for
> auto/host-retrieved values. To avoid breaking JSON/QMP compat, we want
> to fix the option types so that they can later support the auto mode. At
> the moment the auto mode is not supported though.
>
> A future series will introduce support for resolving the 'auto' values
> based on host SMMUv3 IDR values, as well as setting per-device ATS
> capability.
>
> A complete branch can be found here:
> https://github.com/NathanChenNVIDIA/qemu/tree/smmuv3-accel-auto-v4
>
> Please take a look and let me know your feedback.

Thank you for having respinned quickly. This looks good. All patches
collected R-bs and this was tested.
This brings (late) fixes to features introduced in qemu 11.0. Changing
the option types is future proof because layered products notified it
was tricky to retrieve the host values for those parameters. If we
really care of not breaking JSON/QMP compat, it is still time to
consider getting this in 11.0.

Thanks

Eric
>
> Thanks,
> Nathan
>
> Changes from v3:
> - Revise auto support error message
> - Restore original comment for ATS in smmuv3_accel_idr_override()
> - Update the description in object_class_property_set_description()
>   to mention auto mode not supported.
> - Move auto mode check before check for accel=on
> - Remove SMMU_OAS_44BIT/_48BIT and SMMU_SSID_MAX_BITS defines
> - Consolidate documentation notes about properties only being
>   available for accel=on and not supporting auto mode.
> - Include R-by and T-by tags from v3, thanks Eric and Shameer!
>
> Changes from v2:
> - Enforce 'auto' value not being supported for HW-accel SMMUv3 props
> - Revise docs to mention auto is not supported and these properties
>   are only applicable when accel=on.
> - Only override non-defaults in smmuv3_accel_idr_override()
> - Remove check for SSIDSIZE AUTO in smmuv3_accel_idr_override() as
>   smmu_validate_property() checks for AUTO beforehand
> - Consolidate comments for ssidsize_mode_to_value()
> - Include Fixes tags in commit descriptions
> - Include R-by tags from v2
>
> Changes from RFCv1:
> - Remove changes that resolve the 'auto' values based on host SMMUv3
> - Restore defaults values for RIL, OAS, SSIDSIZE, and ATS
> - Update OasMode to accept all OAS sizes instead of only auto, 44, and
>   48
> - Include comment in SsidSizeMode schema clarifying enum value
>   ordering
> - Replace ats-enabled prop with a helper that accepts the dynamic
>   casted TYPE_ARM_SMMUV3 object
> - Separate out guest vs. host ATS check in
>   smmuv3_accel_check_hw_compatible() to a different commit
> - Document accel, RIL, OAS, SSIDSIZE, and ATS properties in
>   qemu-options.hx
>
> Testing:
> Basic sanity testing was performed on an NVIDIA Grace platform with GPU
> device assignment and running CUDA test apps on the guest. Additional
> testing and feedback are welcome.
>
> [0] https://lore.kernel.org/qemu-devel/20260317183755.3721625-1-nathanc@nvidia.com/
> [1] https://lore.kernel.org/all/20260126104342.253965-1-skolothumtho@nvidia.com/
>
> Nathan Chen (8):
>   hw/arm/smmuv3-accel: Check ATS compatibility between host and guest
>   hw/arm/smmuv3-accel: Change ATS property to OnOffAuto
>   hw/arm/smmuv3-accel: Change RIL property to OnOffAuto
>   qdev: Add a SsidSizeMode property
>   hw/arm/smmuv3-accel: Change SSIDSIZE property to SsidSizeMode
>   qdev: Add an OasMode property
>   hw/arm/smmuv3-accel: Change OAS property to OasMode
>   qemu-options.hx: Document arm-smmuv3 device's accel properties
>
>  hw/arm/smmuv3-accel.c                    | 41 ++++++++++++---
>  hw/arm/smmuv3.c                          | 63 +++++++++++++++---------
>  hw/arm/virt-acpi-build.c                 |  2 +-
>  hw/core/qdev-properties-system.c         | 27 ++++++++++
>  include/hw/arm/smmuv3-common.h           |  3 --
>  include/hw/arm/smmuv3.h                  | 11 +++--
>  include/hw/core/qdev-properties-system.h |  6 +++
>  qapi/misc-arm.json                       | 44 +++++++++++++++++
>  qapi/pragma.json                         |  1 +
>  qemu-options.hx                          | 32 +++++++++++-
>  10 files changed, 192 insertions(+), 38 deletions(-)
>
RE: [PATCH for-11.0 v4 0/8] hw/arm/smmuv3-accel: Support AUTO properties
Posted by Shameer Kolothum Thodi 2 weeks, 4 days ago

> -----Original Message-----
> From: Nathan Chen <nathanc@nvidia.com>
> Sent: 18 March 2026 18:49
> To: qemu-devel@nongnu.org; qemu-arm@nongnu.org
> Cc: Eric Auger <eric.auger@redhat.com>; Peter Maydell
> <peter.maydell@linaro.org>; Michael S . Tsirkin <mst@redhat.com>; Igor
> Mammedov <imammedo@redhat.com>; Ani Sinha <anisinha@redhat.com>;
> Shannon Zhao <shannon.zhaosl@gmail.com>; Paolo Bonzini
> <pbonzini@redhat.com>; Daniel P . Berrangé <berrange@redhat.com>; Eric
> Blake <eblake@redhat.com>; Markus Armbruster <armbru@redhat.com>;
> Shameer Kolothum Thodi <skolothumtho@nvidia.com>; Matt Ochs
> <mochs@nvidia.com>; Nicolin Chen <nicolinc@nvidia.com>; Nathan Chen
> <nathanc@nvidia.com>
> Subject: [PATCH for-11.0 v4 0/8] hw/arm/smmuv3-accel: Support AUTO
> properties
> 
> Hi,
> 
> This is a follow-up to the previous series [0] that introduces support for
> specifying 'auto' for arm-smmuv3 accelerated mode's ATS, RIL, SSIDSIZE, and
> OAS feature properties.
> 
> In QEMU 11.0 we introduced new options for vSMMU [1], but feedback
> received when starting the integration of layered products shows the need for
> auto/host-retrieved values. To avoid breaking JSON/QMP compat, we want to
> fix the option types so that they can later support the auto mode. At the
> moment the auto mode is not supported though.
> 
> A future series will introduce support for resolving the 'auto' values based on
> host SMMUv3 IDR values, as well as setting per-device ATS capability.
> 
> A complete branch can be found here:
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgith
> ub.com%2FNathanChenNVIDIA%2Fqemu%2Ftree%2Fsmmuv3-accel-auto-
> v4&data=05%7C02%7Cskolothumtho%40nvidia.com%7Ce894f98044b0461
> 9099d08de851f1164%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C
> 0%7C639094565649714469%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU
> 1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIs
> IldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=x4bC1VgRZAfMHWHbJBD7rQ
> 3WNcxNncPk7Py3SmMXg1g%3D&reserved=0
> 
> Please take a look and let me know your feedback.

I tried this on a GB200 system and everything looks good.

Tested-by: Shameer Kolothum <skolothumtho@nvidia.com>

Thanks,
Shameer