public inbox for qemu-devel@nongnu.org
 help / color / mirror / Atom feed
* [PATCH for-11.0 v4 0/8] hw/arm/smmuv3-accel: Support AUTO properties
@ 2026-03-18 18:48 Nathan Chen
  2026-03-18 18:49 ` [PATCH v4 1/8] hw/arm/smmuv3-accel: Check ATS compatibility between host and guest Nathan Chen
                   ` (9 more replies)
  0 siblings, 10 replies; 35+ messages in thread
From: Nathan Chen @ 2026-03-18 18:48 UTC (permalink / raw)
  To: qemu-devel, qemu-arm
  Cc: Eric Auger, Peter Maydell, Michael S . Tsirkin, Igor Mammedov,
	Ani Sinha, Shannon Zhao, Paolo Bonzini, Daniel P . Berrangé,
	Eric Blake, Markus Armbruster, Shameer Kolothum, Matt Ochs,
	Nicolin Chen, Nathan Chen

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



^ permalink raw reply	[flat|nested] 35+ messages in thread

* [PATCH v4 1/8] hw/arm/smmuv3-accel: Check ATS compatibility between host and guest
  2026-03-18 18:48 [PATCH for-11.0 v4 0/8] hw/arm/smmuv3-accel: Support AUTO properties Nathan Chen
@ 2026-03-18 18:49 ` Nathan Chen
  2026-03-18 18:49 ` [PATCH v4 2/8] hw/arm/smmuv3-accel: Change ATS property to OnOffAuto Nathan Chen
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 35+ messages in thread
From: Nathan Chen @ 2026-03-18 18:49 UTC (permalink / raw)
  To: qemu-devel, qemu-arm
  Cc: Eric Auger, Peter Maydell, Michael S . Tsirkin, Igor Mammedov,
	Ani Sinha, Shannon Zhao, Paolo Bonzini, Daniel P . Berrangé,
	Eric Blake, Markus Armbruster, Shameer Kolothum, Matt Ochs,
	Nicolin Chen, Nathan Chen

From: Nathan Chen <nathanc@nvidia.com>

Compare the host SMMUv3 ATS support bit with the guest SMMUv3 ATS support
bit in IDR0 and fail the compatibility check if ATS support is opted as
enabled on the guest SMMUv3 when it is not supported on host SMMUv3.

Fixes: f7f5013a55a3 ("hw/arm/smmuv3-accel: Add support for ATS")
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Shameer Kolothum <skolothumtho@nvidia.com>
Signed-off-by: Nathan Chen <nathanc@nvidia.com>
---
 hw/arm/smmuv3-accel.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/hw/arm/smmuv3-accel.c b/hw/arm/smmuv3-accel.c
index 17306cd04b..2bb142c47f 100644
--- a/hw/arm/smmuv3-accel.c
+++ b/hw/arm/smmuv3-accel.c
@@ -101,6 +101,12 @@ smmuv3_accel_check_hw_compatible(SMMUv3State *s,
                    smmuv3_oas_bits(FIELD_EX32(s->idr[5], IDR5, OAS)));
         return false;
     }
+    /* Check ATS value opted is compatible with Host SMMUv3 */
+    if (FIELD_EX32(info->idr[0], IDR0, ATS) <
+                FIELD_EX32(s->idr[0], IDR0, ATS)) {
+        error_setg(errp, "Host SMMUv3 doesn't support Address Translation Services");
+        return false;
+    }
 
     /* QEMU SMMUv3 supports GRAN4K/GRAN16K/GRAN64K translation granules */
     if (FIELD_EX32(info->idr[5], IDR5, GRAN4K) !=
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH v4 2/8] hw/arm/smmuv3-accel: Change ATS property to OnOffAuto
  2026-03-18 18:48 [PATCH for-11.0 v4 0/8] hw/arm/smmuv3-accel: Support AUTO properties Nathan Chen
  2026-03-18 18:49 ` [PATCH v4 1/8] hw/arm/smmuv3-accel: Check ATS compatibility between host and guest Nathan Chen
@ 2026-03-18 18:49 ` Nathan Chen
  2026-03-19  8:10   ` Shameer Kolothum Thodi
                     ` (2 more replies)
  2026-03-18 18:49 ` [PATCH v4 3/8] hw/arm/smmuv3-accel: Change RIL " Nathan Chen
                   ` (7 subsequent siblings)
  9 siblings, 3 replies; 35+ messages in thread
From: Nathan Chen @ 2026-03-18 18:49 UTC (permalink / raw)
  To: qemu-devel, qemu-arm
  Cc: Eric Auger, Peter Maydell, Michael S . Tsirkin, Igor Mammedov,
	Ani Sinha, Shannon Zhao, Paolo Bonzini, Daniel P . Berrangé,
	Eric Blake, Markus Armbruster, Shameer Kolothum, Matt Ochs,
	Nicolin Chen, Nathan Chen

From: Nathan Chen <nathanc@nvidia.com>

Change accel SMMUv3 ATS property from bool to OnOffAuto. The 'auto'
value is not implemented, as this commit is meant to set the property
to the correct type and avoid breaking JSON/QMP when the auto mode is
introduced. A future patch will implement resolution of the 'auto'
value to match the host SMMUv3 ATS support.

Fixes: f7f5013a55a3 ("hw/arm/smmuv3-accel: Add support for ATS")
Tested-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Nathan Chen <nathanc@nvidia.com>
---
 hw/arm/smmuv3-accel.c    |  4 +++-
 hw/arm/smmuv3.c          | 17 ++++++++++++++---
 hw/arm/virt-acpi-build.c |  2 +-
 include/hw/arm/smmuv3.h  |  4 +++-
 4 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/hw/arm/smmuv3-accel.c b/hw/arm/smmuv3-accel.c
index 2bb142c47f..f21a6a9997 100644
--- a/hw/arm/smmuv3-accel.c
+++ b/hw/arm/smmuv3-accel.c
@@ -827,7 +827,9 @@ void smmuv3_accel_idr_override(SMMUv3State *s)
     s->idr[3] = FIELD_DP32(s->idr[3], IDR3, RIL, s->ril);
 
     /* QEMU SMMUv3 has no ATS. Advertise ATS if opt-in by property */
-    s->idr[0] = FIELD_DP32(s->idr[0], IDR0, ATS, s->ats);
+    if (s->ats == ON_OFF_AUTO_ON) {
+        s->idr[0] = FIELD_DP32(s->idr[0], IDR0, ATS, 1);
+    }
 
     /* Advertise 48-bit OAS in IDR5 when requested (default is 44 bits). */
     if (s->oas == SMMU_OAS_48BIT) {
diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c
index 068108e49b..a683402a0c 100644
--- a/hw/arm/smmuv3.c
+++ b/hw/arm/smmuv3.c
@@ -317,6 +317,11 @@ static void smmuv3_init_id_regs(SMMUv3State *s)
     smmuv3_accel_idr_override(s);
 }
 
+bool smmuv3_ats_enabled(SMMUv3State *s)
+{
+    return FIELD_EX32(s->idr[0], IDR0, ATS);
+}
+
 static void smmuv3_reset(SMMUv3State *s)
 {
     s->cmdq.base = deposit64(s->cmdq.base, 0, 5, SMMU_CMDQS);
@@ -1966,12 +1971,17 @@ static bool smmu_validate_property(SMMUv3State *s, Error **errp)
     }
 #endif
 
+    if (s->ats == ON_OFF_AUTO_AUTO) {
+        error_setg(errp, "ats auto mode is not supported");
+        return false;
+    }
+
     if (!s->accel) {
         if (!s->ril) {
             error_setg(errp, "ril can only be disabled if accel=on");
             return false;
         }
-        if (s->ats) {
+        if (s->ats == ON_OFF_AUTO_ON) {
             error_setg(errp, "ats can only be enabled if accel=on");
             return false;
         }
@@ -2128,7 +2138,7 @@ static const Property smmuv3_properties[] = {
     DEFINE_PROP_UINT64("msi-gpa", SMMUv3State, msi_gpa, 0),
     /* RIL can be turned off for accel cases */
     DEFINE_PROP_BOOL("ril", SMMUv3State, ril, true),
-    DEFINE_PROP_BOOL("ats", SMMUv3State, ats, false),
+    DEFINE_PROP_ON_OFF_AUTO("ats", SMMUv3State, ats, ON_OFF_AUTO_OFF),
     DEFINE_PROP_UINT8("oas", SMMUv3State, oas, 44),
     DEFINE_PROP_UINT8("ssidsize", SMMUv3State, ssidsize, 0),
 };
@@ -2160,7 +2170,8 @@ static void smmuv3_class_init(ObjectClass *klass, const void *data)
         "Disable range invalidation support (for accel=on)");
     object_class_property_set_description(klass, "ats",
         "Enable/disable ATS support (for accel=on). Please ensure host "
-        "platform has ATS support before enabling this");
+        "platform has ATS support before enabling this. ats=auto is not "
+        "supported.");
     object_class_property_set_description(klass, "oas",
         "Specify Output Address Size (for accel=on). Supported values "
         "are 44 or 48 bits. Defaults to 44 bits");
diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
index 719d2f994e..591cfc993c 100644
--- a/hw/arm/virt-acpi-build.c
+++ b/hw/arm/virt-acpi-build.c
@@ -402,7 +402,7 @@ static int iort_smmuv3_devices(Object *obj, void *opaque)
 
     bus = PCI_BUS(object_property_get_link(obj, "primary-bus", &error_abort));
     sdev.accel = object_property_get_bool(obj, "accel", &error_abort);
-    sdev.ats = object_property_get_bool(obj, "ats", &error_abort);
+    sdev.ats = smmuv3_ats_enabled(ARM_SMMUV3(obj));
     pbus = PLATFORM_BUS_DEVICE(vms->platform_bus_dev);
     sbdev = SYS_BUS_DEVICE(obj);
     sdev.base = platform_bus_get_mmio_addr(pbus, sbdev, 0);
diff --git a/include/hw/arm/smmuv3.h b/include/hw/arm/smmuv3.h
index 26b2fc42fd..ce51a5b9b4 100644
--- a/include/hw/arm/smmuv3.h
+++ b/include/hw/arm/smmuv3.h
@@ -70,7 +70,7 @@ struct SMMUv3State {
     uint64_t msi_gpa;
     Error *migration_blocker;
     bool ril;
-    bool ats;
+    OnOffAuto ats;
     uint8_t oas;
     uint8_t ssidsize;
 };
@@ -91,6 +91,8 @@ struct SMMUv3Class {
     ResettablePhases parent_phases;
 };
 
+bool smmuv3_ats_enabled(struct SMMUv3State *s);
+
 #define TYPE_ARM_SMMUV3   "arm-smmuv3"
 OBJECT_DECLARE_TYPE(SMMUv3State, SMMUv3Class, ARM_SMMUV3)
 
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH v4 3/8] hw/arm/smmuv3-accel: Change RIL property to OnOffAuto
  2026-03-18 18:48 [PATCH for-11.0 v4 0/8] hw/arm/smmuv3-accel: Support AUTO properties Nathan Chen
  2026-03-18 18:49 ` [PATCH v4 1/8] hw/arm/smmuv3-accel: Check ATS compatibility between host and guest Nathan Chen
  2026-03-18 18:49 ` [PATCH v4 2/8] hw/arm/smmuv3-accel: Change ATS property to OnOffAuto Nathan Chen
@ 2026-03-18 18:49 ` Nathan Chen
  2026-03-19  8:12   ` Shameer Kolothum Thodi
                     ` (2 more replies)
  2026-03-18 18:49 ` [PATCH v4 4/8] qdev: Add a SsidSizeMode property Nathan Chen
                   ` (6 subsequent siblings)
  9 siblings, 3 replies; 35+ messages in thread
From: Nathan Chen @ 2026-03-18 18:49 UTC (permalink / raw)
  To: qemu-devel, qemu-arm
  Cc: Eric Auger, Peter Maydell, Michael S . Tsirkin, Igor Mammedov,
	Ani Sinha, Shannon Zhao, Paolo Bonzini, Daniel P . Berrangé,
	Eric Blake, Markus Armbruster, Shameer Kolothum, Matt Ochs,
	Nicolin Chen, Nathan Chen

From: Nathan Chen <nathanc@nvidia.com>

Change accel SMMUv3 RIL property from bool to OnOffAuto. The 'auto'
value is not implemented, as this commit is meant to set the property
to the correct type and avoid breaking JSON/QMP when the auto mode is
introduced. A future patch will implement resolution of the 'auto'
value to match the host SMMUv3 RIL support.

Fixes: bd715ff5bda9 ("hw/arm/smmuv3-accel: Add a property to specify RIL support")
Tested-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Nathan Chen <nathanc@nvidia.com>
---
 hw/arm/smmuv3-accel.c   |  6 ++++--
 hw/arm/smmuv3.c         | 11 ++++++++---
 include/hw/arm/smmuv3.h |  2 +-
 3 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/hw/arm/smmuv3-accel.c b/hw/arm/smmuv3-accel.c
index f21a6a9997..c31b64295e 100644
--- a/hw/arm/smmuv3-accel.c
+++ b/hw/arm/smmuv3-accel.c
@@ -823,8 +823,10 @@ void smmuv3_accel_idr_override(SMMUv3State *s)
         return;
     }
 
-    /* By default QEMU SMMUv3 has RIL. Update IDR3 if user has disabled it */
-    s->idr[3] = FIELD_DP32(s->idr[3], IDR3, RIL, s->ril);
+    /* Only override RIL if user explicitly set OFF */
+    if (s->ril == ON_OFF_AUTO_OFF) {
+        s->idr[3] = FIELD_DP32(s->idr[3], IDR3, RIL, 0);
+    }
 
     /* QEMU SMMUv3 has no ATS. Advertise ATS if opt-in by property */
     if (s->ats == ON_OFF_AUTO_ON) {
diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c
index a683402a0c..ea285bdf64 100644
--- a/hw/arm/smmuv3.c
+++ b/hw/arm/smmuv3.c
@@ -1975,9 +1975,13 @@ static bool smmu_validate_property(SMMUv3State *s, Error **errp)
         error_setg(errp, "ats auto mode is not supported");
         return false;
     }
+    if (s->ril == ON_OFF_AUTO_AUTO) {
+        error_setg(errp, "ril auto mode is not supported");
+        return false;
+    }
 
     if (!s->accel) {
-        if (!s->ril) {
+        if (s->ril == ON_OFF_AUTO_OFF) {
             error_setg(errp, "ril can only be disabled if accel=on");
             return false;
         }
@@ -2137,7 +2141,7 @@ static const Property smmuv3_properties[] = {
     /* GPA of MSI doorbell, for SMMUv3 accel use. */
     DEFINE_PROP_UINT64("msi-gpa", SMMUv3State, msi_gpa, 0),
     /* RIL can be turned off for accel cases */
-    DEFINE_PROP_BOOL("ril", SMMUv3State, ril, true),
+    DEFINE_PROP_ON_OFF_AUTO("ril", SMMUv3State, ril, ON_OFF_AUTO_ON),
     DEFINE_PROP_ON_OFF_AUTO("ats", SMMUv3State, ats, ON_OFF_AUTO_OFF),
     DEFINE_PROP_UINT8("oas", SMMUv3State, oas, 44),
     DEFINE_PROP_UINT8("ssidsize", SMMUv3State, ssidsize, 0),
@@ -2167,7 +2171,8 @@ static void smmuv3_class_init(ObjectClass *klass, const void *data)
         "Enable SMMUv3 accelerator support. Allows host SMMUv3 to be "
         "configured in nested mode for vfio-pci dev assignment");
     object_class_property_set_description(klass, "ril",
-        "Disable range invalidation support (for accel=on)");
+        "Disable range invalidation support (for accel=on). ril=auto "
+        "is not supported.");
     object_class_property_set_description(klass, "ats",
         "Enable/disable ATS support (for accel=on). Please ensure host "
         "platform has ATS support before enabling this. ats=auto is not "
diff --git a/include/hw/arm/smmuv3.h b/include/hw/arm/smmuv3.h
index ce51a5b9b4..c35e599bbc 100644
--- a/include/hw/arm/smmuv3.h
+++ b/include/hw/arm/smmuv3.h
@@ -69,7 +69,7 @@ struct SMMUv3State {
     struct SMMUv3AccelState *s_accel;
     uint64_t msi_gpa;
     Error *migration_blocker;
-    bool ril;
+    OnOffAuto ril;
     OnOffAuto ats;
     uint8_t oas;
     uint8_t ssidsize;
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH v4 4/8] qdev: Add a SsidSizeMode property
  2026-03-18 18:48 [PATCH for-11.0 v4 0/8] hw/arm/smmuv3-accel: Support AUTO properties Nathan Chen
                   ` (2 preceding siblings ...)
  2026-03-18 18:49 ` [PATCH v4 3/8] hw/arm/smmuv3-accel: Change RIL " Nathan Chen
@ 2026-03-18 18:49 ` Nathan Chen
  2026-03-19 12:02   ` Markus Armbruster
  2026-03-19 12:08   ` Markus Armbruster
  2026-03-18 18:49 ` [PATCH v4 5/8] hw/arm/smmuv3-accel: Change SSIDSIZE property to SsidSizeMode Nathan Chen
                   ` (5 subsequent siblings)
  9 siblings, 2 replies; 35+ messages in thread
From: Nathan Chen @ 2026-03-18 18:49 UTC (permalink / raw)
  To: qemu-devel, qemu-arm
  Cc: Eric Auger, Peter Maydell, Michael S . Tsirkin, Igor Mammedov,
	Ani Sinha, Shannon Zhao, Paolo Bonzini, Daniel P . Berrangé,
	Eric Blake, Markus Armbruster, Shameer Kolothum, Matt Ochs,
	Nicolin Chen, Nathan Chen

From: Nathan Chen <nathanc@nvidia.com>

Introduce a new enum type property allowing to set a Substream ID size
for HW-accelerated smmuv3. Values are auto and 0..20. The auto value
allows SSID size property to be derived from host IOMMU capabilities.
A value of 0 disables SubstreamID, while non-zero values specify the
SSID size in bits.

Reviewed-by: Eric Auger <eric.auger@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Nathan Chen <nathanc@nvidia.com>
---
 hw/core/qdev-properties-system.c         | 14 ++++++++++++++
 include/hw/core/qdev-properties-system.h |  3 +++
 qapi/misc-arm.json                       | 16 ++++++++++++++++
 qapi/pragma.json                         |  1 +
 4 files changed, 34 insertions(+)

diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c
index a402321f42..4aca1d4326 100644
--- a/hw/core/qdev-properties-system.c
+++ b/hw/core/qdev-properties-system.c
@@ -18,6 +18,7 @@
 #include "qapi/qapi-types-block.h"
 #include "qapi/qapi-types-machine.h"
 #include "qapi/qapi-types-migration.h"
+#include "qapi/qapi-types-misc-arm.h"
 #include "qapi/qapi-visit-virtio.h"
 #include "qapi/qmp/qerror.h"
 #include "qemu/ctype.h"
@@ -723,6 +724,19 @@ const PropertyInfo qdev_prop_zero_page_detection = {
     .set_default_value = qdev_propinfo_set_default_value_enum,
 };
 
+/* --- SsidSizeMode --- */
+
+QEMU_BUILD_BUG_ON(sizeof(SsidSizeMode) != sizeof(int));
+
+const PropertyInfo qdev_prop_ssidsize_mode = {
+    .type = "SsidSizeMode",
+    .description = "ssidsize mode: auto, 0-20",
+    .enum_table = &SsidSizeMode_lookup,
+    .get = qdev_propinfo_get_enum,
+    .set = qdev_propinfo_set_enum,
+    .set_default_value = qdev_propinfo_set_default_value_enum,
+};
+
 /* --- Reserved Region --- */
 
 /*
diff --git a/include/hw/core/qdev-properties-system.h b/include/hw/core/qdev-properties-system.h
index ec21732ce5..4708885164 100644
--- a/include/hw/core/qdev-properties-system.h
+++ b/include/hw/core/qdev-properties-system.h
@@ -14,6 +14,7 @@ extern const PropertyInfo qdev_prop_multifd_compression;
 extern const PropertyInfo qdev_prop_mig_mode;
 extern const PropertyInfo qdev_prop_granule_mode;
 extern const PropertyInfo qdev_prop_zero_page_detection;
+extern const PropertyInfo qdev_prop_ssidsize_mode;
 extern const PropertyInfo qdev_prop_losttickpolicy;
 extern const PropertyInfo qdev_prop_blockdev_on_error;
 extern const PropertyInfo qdev_prop_bios_chs_trans;
@@ -61,6 +62,8 @@ extern const PropertyInfo qdev_prop_virtio_gpu_output_list;
 #define DEFINE_PROP_ZERO_PAGE_DETECTION(_n, _s, _f, _d) \
     DEFINE_PROP_SIGNED(_n, _s, _f, _d, qdev_prop_zero_page_detection, \
                        ZeroPageDetection)
+#define DEFINE_PROP_SSIDSIZE_MODE(_n, _s, _f, _d) \
+    DEFINE_PROP_SIGNED(_n, _s, _f, _d, qdev_prop_ssidsize_mode, SsidSizeMode)
 #define DEFINE_PROP_LOSTTICKPOLICY(_n, _s, _f, _d) \
     DEFINE_PROP_SIGNED(_n, _s, _f, _d, qdev_prop_losttickpolicy, \
                         LostTickPolicy)
diff --git a/qapi/misc-arm.json b/qapi/misc-arm.json
index f921d740f1..76ea0a09fa 100644
--- a/qapi/misc-arm.json
+++ b/qapi/misc-arm.json
@@ -45,3 +45,19 @@
 #                     { "version": 3, "emulated": false, "kernel": true } ] }
 ##
 { 'command': 'query-gic-capabilities', 'returns': ['GICCapability'] }
+
+##
+# @SsidSizeMode:
+#
+# SMMUv3 SubstreamID size configuration mode.
+#
+# @auto: derive from host IOMMU capabilities
+#
+# Values 0-20: SSIDSIZE value in bits.  0 disables SubstreamID.
+#
+# Since: 11.0
+##
+{ 'enum': 'SsidSizeMode',
+  'data': [ 'auto', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
+            '10', '11', '12', '13', '14', '15', '16', '17', '18',
+            '19', '20' ] } # order matters, see ssid_size_mode_auto()
diff --git a/qapi/pragma.json b/qapi/pragma.json
index 193bc39059..24aebbe8f5 100644
--- a/qapi/pragma.json
+++ b/qapi/pragma.json
@@ -68,6 +68,7 @@
         'S390CpuEntitlement',
         'S390CpuPolarization',
         'S390CpuState',
+        'SsidSizeMode',
         'String',
         'StringWrapper',
         'SysEmuTarget',
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH v4 5/8] hw/arm/smmuv3-accel: Change SSIDSIZE property to SsidSizeMode
  2026-03-18 18:48 [PATCH for-11.0 v4 0/8] hw/arm/smmuv3-accel: Support AUTO properties Nathan Chen
                   ` (3 preceding siblings ...)
  2026-03-18 18:49 ` [PATCH v4 4/8] qdev: Add a SsidSizeMode property Nathan Chen
@ 2026-03-18 18:49 ` Nathan Chen
  2026-03-19  8:35   ` Shameer Kolothum Thodi
                     ` (2 more replies)
  2026-03-18 18:49 ` [PATCH v4 6/8] qdev: Add an OasMode property Nathan Chen
                   ` (4 subsequent siblings)
  9 siblings, 3 replies; 35+ messages in thread
From: Nathan Chen @ 2026-03-18 18:49 UTC (permalink / raw)
  To: qemu-devel, qemu-arm
  Cc: Eric Auger, Peter Maydell, Michael S . Tsirkin, Igor Mammedov,
	Ani Sinha, Shannon Zhao, Paolo Bonzini, Daniel P . Berrangé,
	Eric Blake, Markus Armbruster, Shameer Kolothum, Matt Ochs,
	Nicolin Chen, Nathan Chen

From: Nathan Chen <nathanc@nvidia.com>

Change accel SMMUv3 SSIDSIZE property from uint8_t to SsidSizeMode.
The 'auto' value is not implemented, as this commit is meant to set the
property to the correct type and avoid breaking JSON/QMP when the auto
mode is introduced. A future patch will implement resolution of 'auto'
value to match the host SMMUv3 SSIDSIZE value.

Fixes: b8c6f8a69d27 ("hw/arm/smmuv3-accel: Make SubstreamID support configurable")
Tested-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Nathan Chen <nathanc@nvidia.com>
---
 hw/arm/smmuv3-accel.c          | 23 +++++++++++++++++++++--
 hw/arm/smmuv3.c                | 19 ++++++++++---------
 include/hw/arm/smmuv3-common.h |  1 -
 include/hw/arm/smmuv3.h        |  3 ++-
 4 files changed, 33 insertions(+), 13 deletions(-)

diff --git a/hw/arm/smmuv3-accel.c b/hw/arm/smmuv3-accel.c
index c31b64295e..bc6cbfebc2 100644
--- a/hw/arm/smmuv3-accel.c
+++ b/hw/arm/smmuv3-accel.c
@@ -802,7 +802,7 @@ static uint64_t smmuv3_accel_get_viommu_flags(void *opaque)
     SMMUState *bs = opaque;
     SMMUv3State *s = ARM_SMMUV3(bs);
 
-    if (s->ssidsize) {
+    if (s->ssidsize > SSID_SIZE_MODE_0) {
         flags |= VIOMMU_FLAG_PASID_SUPPORTED;
     }
     return flags;
@@ -817,6 +817,22 @@ static const PCIIOMMUOps smmuv3_accel_ops = {
     .get_msi_direct_gpa = smmuv3_accel_get_msi_gpa,
 };
 
+/*
+ * This returns the value of a SsidSizeMode value offset by 1 to
+ * account for the enum values offset by 1 from actual values.
+ *
+ * SSID_SIZE_MODE_0 = 1, SSID_SIZE_MODE_1 = 2, etc. so return 0
+ * if SSID_SIZE_MODE_0 is passed as input, return 1 if
+ * SSID_SIZE_MODE_1 is passed as input, etc.
+ */
+static uint8_t ssidsize_mode_to_value(SsidSizeMode mode)
+{
+    if (mode == SSID_SIZE_MODE_AUTO) {
+        return 0;
+    }
+    return mode - 1;
+}
+
 void smmuv3_accel_idr_override(SMMUv3State *s)
 {
     if (!s->accel) {
@@ -842,7 +858,10 @@ void smmuv3_accel_idr_override(SMMUv3State *s)
      * By default QEMU SMMUv3 has no SubstreamID support. Update IDR1 if user
      * has enabled it.
      */
-    s->idr[1] = FIELD_DP32(s->idr[1], IDR1, SSIDSIZE, s->ssidsize);
+    if (s->ssidsize > SSID_SIZE_MODE_0) {
+        s->idr[1] = FIELD_DP32(s->idr[1], IDR1, SSIDSIZE,
+                               ssidsize_mode_to_value(s->ssidsize));
+    }
 }
 
 /* Based on SMUUv3 GPBA.ABORT configuration, attach a corresponding HWPT */
diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c
index ea285bdf64..79018f8d66 100644
--- a/hw/arm/smmuv3.c
+++ b/hw/arm/smmuv3.c
@@ -20,6 +20,7 @@
 #include "qemu/bitops.h"
 #include "hw/core/irq.h"
 #include "hw/core/sysbus.h"
+#include "hw/core/qdev-properties-system.h"
 #include "migration/blocker.h"
 #include "migration/vmstate.h"
 #include "hw/core/qdev-properties.h"
@@ -625,7 +626,7 @@ static int decode_ste(SMMUv3State *s, SMMUTransCfg *cfg,
     }
 
     /* Multiple context descriptors require SubstreamID support */
-    if (!s->ssidsize && STE_S1CDMAX(ste) != 0) {
+    if (s->ssidsize == SSID_SIZE_MODE_0 && STE_S1CDMAX(ste) != 0) {
         qemu_log_mask(LOG_UNIMP,
                 "SMMUv3: multiple S1 context descriptors require SubstreamID support. "
                 "Configure ssidsize > 0 (requires accel=on)\n");
@@ -1979,6 +1980,10 @@ static bool smmu_validate_property(SMMUv3State *s, Error **errp)
         error_setg(errp, "ril auto mode is not supported");
         return false;
     }
+    if (s->ssidsize == SSID_SIZE_MODE_AUTO) {
+        error_setg(errp, "ssidsize auto mode is not supported");
+        return false;
+    }
 
     if (!s->accel) {
         if (s->ril == ON_OFF_AUTO_OFF) {
@@ -1993,7 +1998,7 @@ static bool smmu_validate_property(SMMUv3State *s, Error **errp)
             error_setg(errp, "OAS must be 44 bits when accel=off");
             return false;
         }
-        if (s->ssidsize) {
+        if (s->ssidsize > SSID_SIZE_MODE_0) {
             error_setg(errp, "ssidsize can only be set if accel=on");
             return false;
         }
@@ -2011,11 +2016,6 @@ static bool smmu_validate_property(SMMUv3State *s, Error **errp)
         error_setg(errp, "OAS can only be set to 44 or 48 bits");
         return false;
     }
-    if (s->ssidsize > SMMU_SSID_MAX_BITS) {
-        error_setg(errp, "ssidsize must be in the range 0 to %d",
-                   SMMU_SSID_MAX_BITS);
-        return false;
-    }
 
     return true;
 }
@@ -2144,7 +2144,8 @@ static const Property smmuv3_properties[] = {
     DEFINE_PROP_ON_OFF_AUTO("ril", SMMUv3State, ril, ON_OFF_AUTO_ON),
     DEFINE_PROP_ON_OFF_AUTO("ats", SMMUv3State, ats, ON_OFF_AUTO_OFF),
     DEFINE_PROP_UINT8("oas", SMMUv3State, oas, 44),
-    DEFINE_PROP_UINT8("ssidsize", SMMUv3State, ssidsize, 0),
+    DEFINE_PROP_SSIDSIZE_MODE("ssidsize", SMMUv3State, ssidsize,
+                              SSID_SIZE_MODE_0),
 };
 
 static void smmuv3_instance_init(Object *obj)
@@ -2185,7 +2186,7 @@ static void smmuv3_class_init(ObjectClass *klass, const void *data)
         "A value of N allows SSIDs in the range [0 .. 2^N - 1]. "
         "Valid range is 0-20, where 0 disables SubstreamID support. "
         "Defaults to 0. A value greater than 0 is required to enable "
-        "PASID support.");
+        "PASID support. ssidsize=auto is not supported.");
 }
 
 static int smmuv3_notify_flag_changed(IOMMUMemoryRegion *iommu,
diff --git a/include/hw/arm/smmuv3-common.h b/include/hw/arm/smmuv3-common.h
index 9f78bbe89e..7f0f992dfd 100644
--- a/include/hw/arm/smmuv3-common.h
+++ b/include/hw/arm/smmuv3-common.h
@@ -311,7 +311,6 @@ REG32(IDR1,                0x4)
     FIELD(IDR1, TABLES_PRESET, 30, 1)
     FIELD(IDR1, ECMDQ,        31, 1)
 
-#define SMMU_SSID_MAX_BITS 20
 #define SMMU_IDR1_SIDSIZE 16
 #define SMMU_CMDQS   19
 #define SMMU_EVENTQS 19
diff --git a/include/hw/arm/smmuv3.h b/include/hw/arm/smmuv3.h
index c35e599bbc..ddf472493d 100644
--- a/include/hw/arm/smmuv3.h
+++ b/include/hw/arm/smmuv3.h
@@ -21,6 +21,7 @@
 
 #include "hw/arm/smmu-common.h"
 #include "qom/object.h"
+#include "qapi/qapi-types-misc-arm.h"
 
 #define TYPE_SMMUV3_IOMMU_MEMORY_REGION "smmuv3-iommu-memory-region"
 
@@ -72,7 +73,7 @@ struct SMMUv3State {
     OnOffAuto ril;
     OnOffAuto ats;
     uint8_t oas;
-    uint8_t ssidsize;
+    SsidSizeMode ssidsize;
 };
 
 typedef enum {
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH v4 6/8] qdev: Add an OasMode property
  2026-03-18 18:48 [PATCH for-11.0 v4 0/8] hw/arm/smmuv3-accel: Support AUTO properties Nathan Chen
                   ` (4 preceding siblings ...)
  2026-03-18 18:49 ` [PATCH v4 5/8] hw/arm/smmuv3-accel: Change SSIDSIZE property to SsidSizeMode Nathan Chen
@ 2026-03-18 18:49 ` Nathan Chen
  2026-03-19 12:16   ` Markus Armbruster
  2026-03-18 18:49 ` [PATCH v4 7/8] hw/arm/smmuv3-accel: Change OAS property to OasMode Nathan Chen
                   ` (3 subsequent siblings)
  9 siblings, 1 reply; 35+ messages in thread
From: Nathan Chen @ 2026-03-18 18:49 UTC (permalink / raw)
  To: qemu-devel, qemu-arm
  Cc: Eric Auger, Peter Maydell, Michael S . Tsirkin, Igor Mammedov,
	Ani Sinha, Shannon Zhao, Paolo Bonzini, Daniel P . Berrangé,
	Eric Blake, Markus Armbruster, Shameer Kolothum, Matt Ochs,
	Nicolin Chen, Nathan Chen

From: Nathan Chen <nathanc@nvidia.com>

Introduce a new enum type property allowing to set an Output Address
Size. Values are auto, 32, 36, 40, 42, 44, 48, 52, and 56, where a
value of N specifies an N-bit OAS.

Reviewed-by: Eric Auger <eric.auger@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Nathan Chen <nathanc@nvidia.com>
---
 hw/core/qdev-properties-system.c         | 13 +++++++++++
 include/hw/core/qdev-properties-system.h |  3 +++
 qapi/misc-arm.json                       | 28 ++++++++++++++++++++++++
 3 files changed, 44 insertions(+)

diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c
index 4aca1d4326..a805ee2e1f 100644
--- a/hw/core/qdev-properties-system.c
+++ b/hw/core/qdev-properties-system.c
@@ -737,6 +737,19 @@ const PropertyInfo qdev_prop_ssidsize_mode = {
     .set_default_value = qdev_propinfo_set_default_value_enum,
 };
 
+/* --- OasMode --- */
+
+QEMU_BUILD_BUG_ON(sizeof(OasMode) != sizeof(int));
+
+const PropertyInfo qdev_prop_oas_mode = {
+    .type = "OasMode",
+    .description = "oas mode: auto, 32, 36, 40, 42, 44, 48, 52, 56",
+    .enum_table = &OasMode_lookup,
+    .get = qdev_propinfo_get_enum,
+    .set = qdev_propinfo_set_enum,
+    .set_default_value = qdev_propinfo_set_default_value_enum,
+};
+
 /* --- Reserved Region --- */
 
 /*
diff --git a/include/hw/core/qdev-properties-system.h b/include/hw/core/qdev-properties-system.h
index 4708885164..2cbea16d61 100644
--- a/include/hw/core/qdev-properties-system.h
+++ b/include/hw/core/qdev-properties-system.h
@@ -15,6 +15,7 @@ extern const PropertyInfo qdev_prop_mig_mode;
 extern const PropertyInfo qdev_prop_granule_mode;
 extern const PropertyInfo qdev_prop_zero_page_detection;
 extern const PropertyInfo qdev_prop_ssidsize_mode;
+extern const PropertyInfo qdev_prop_oas_mode;
 extern const PropertyInfo qdev_prop_losttickpolicy;
 extern const PropertyInfo qdev_prop_blockdev_on_error;
 extern const PropertyInfo qdev_prop_bios_chs_trans;
@@ -64,6 +65,8 @@ extern const PropertyInfo qdev_prop_virtio_gpu_output_list;
                        ZeroPageDetection)
 #define DEFINE_PROP_SSIDSIZE_MODE(_n, _s, _f, _d) \
     DEFINE_PROP_SIGNED(_n, _s, _f, _d, qdev_prop_ssidsize_mode, SsidSizeMode)
+#define DEFINE_PROP_OAS_MODE(_n, _s, _f, _d) \
+    DEFINE_PROP_SIGNED(_n, _s, _f, _d, qdev_prop_oas_mode, OasMode)
 #define DEFINE_PROP_LOSTTICKPOLICY(_n, _s, _f, _d) \
     DEFINE_PROP_SIGNED(_n, _s, _f, _d, qdev_prop_losttickpolicy, \
                         LostTickPolicy)
diff --git a/qapi/misc-arm.json b/qapi/misc-arm.json
index 76ea0a09fa..5dbb4add91 100644
--- a/qapi/misc-arm.json
+++ b/qapi/misc-arm.json
@@ -61,3 +61,31 @@
   'data': [ 'auto', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
             '10', '11', '12', '13', '14', '15', '16', '17', '18',
             '19', '20' ] } # order matters, see ssid_size_mode_auto()
+
+##
+# @OasMode:
+#
+# SMMUv3 Output Address Size configuration mode.
+#
+# @auto: derive from host IOMMU capabilities
+#
+# @32: 32-bit output address size
+#
+# @36: 36-bit output address size
+#
+# @40: 40-bit output address size
+#
+# @42: 42-bit output address size
+#
+# @44: 44-bit output address size
+#
+# @48: 48-bit output address size
+#
+# @52: 52-bit output address size
+#
+# @56: 56-bit output address size
+#
+# Since: 11.0
+##
+{ 'enum': 'OasMode',
+  'data': [ 'auto', '32', '36', '40', '42', '44', '48', '52', '56' ] }
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH v4 7/8] hw/arm/smmuv3-accel: Change OAS property to OasMode
  2026-03-18 18:48 [PATCH for-11.0 v4 0/8] hw/arm/smmuv3-accel: Support AUTO properties Nathan Chen
                   ` (5 preceding siblings ...)
  2026-03-18 18:49 ` [PATCH v4 6/8] qdev: Add an OasMode property Nathan Chen
@ 2026-03-18 18:49 ` Nathan Chen
  2026-03-19  8:39   ` Shameer Kolothum Thodi
                     ` (2 more replies)
  2026-03-18 18:49 ` [PATCH v4 8/8] qemu-options.hx: Document arm-smmuv3 device's accel properties Nathan Chen
                   ` (2 subsequent siblings)
  9 siblings, 3 replies; 35+ messages in thread
From: Nathan Chen @ 2026-03-18 18:49 UTC (permalink / raw)
  To: qemu-devel, qemu-arm
  Cc: Eric Auger, Peter Maydell, Michael S . Tsirkin, Igor Mammedov,
	Ani Sinha, Shannon Zhao, Paolo Bonzini, Daniel P . Berrangé,
	Eric Blake, Markus Armbruster, Shameer Kolothum, Matt Ochs,
	Nicolin Chen, Nathan Chen

From: Nathan Chen <nathanc@nvidia.com>

Change accel SMMUv3 OAS property from uint8_t to OasMode. The
'auto' value is not implemented, as this commit is meant to
set the property to the correct type and avoid breaking JSON/QMP
when the auto mode is introduced. A future patch will implement
resolution of 'auto' value to match the host SMMUv3 OAS value.

Fixes: a015ac990fd3 ("hw/arm/smmuv3-accel: Add property to specify OAS bits")
Tested-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Nathan Chen <nathanc@nvidia.com>
---
 hw/arm/smmuv3-accel.c          |  2 +-
 hw/arm/smmuv3.c                | 16 ++++++++--------
 include/hw/arm/smmuv3-common.h |  2 --
 include/hw/arm/smmuv3.h        |  2 +-
 4 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/hw/arm/smmuv3-accel.c b/hw/arm/smmuv3-accel.c
index bc6cbfebc2..65c2f44880 100644
--- a/hw/arm/smmuv3-accel.c
+++ b/hw/arm/smmuv3-accel.c
@@ -850,7 +850,7 @@ void smmuv3_accel_idr_override(SMMUv3State *s)
     }
 
     /* Advertise 48-bit OAS in IDR5 when requested (default is 44 bits). */
-    if (s->oas == SMMU_OAS_48BIT) {
+    if (s->oas == OAS_MODE_48) {
         s->idr[5] = FIELD_DP32(s->idr[5], IDR5, OAS, SMMU_IDR5_OAS_48);
     }
 
diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c
index 79018f8d66..c67819d6f2 100644
--- a/hw/arm/smmuv3.c
+++ b/hw/arm/smmuv3.c
@@ -1984,6 +1984,10 @@ static bool smmu_validate_property(SMMUv3State *s, Error **errp)
         error_setg(errp, "ssidsize auto mode is not supported");
         return false;
     }
+    if (s->oas != OAS_MODE_44 && s->oas != OAS_MODE_48) {
+        error_setg(errp, "OAS can only be set to 44 or 48 bits");
+        return false;
+    }
 
     if (!s->accel) {
         if (s->ril == ON_OFF_AUTO_OFF) {
@@ -1994,7 +1998,7 @@ static bool smmu_validate_property(SMMUv3State *s, Error **errp)
             error_setg(errp, "ats can only be enabled if accel=on");
             return false;
         }
-        if (s->oas != SMMU_OAS_44BIT) {
+        if (s->oas > OAS_MODE_44) {
             error_setg(errp, "OAS must be 44 bits when accel=off");
             return false;
         }
@@ -2012,11 +2016,6 @@ static bool smmu_validate_property(SMMUv3State *s, Error **errp)
         return false;
     }
 
-    if (s->oas != SMMU_OAS_44BIT && s->oas != SMMU_OAS_48BIT) {
-        error_setg(errp, "OAS can only be set to 44 or 48 bits");
-        return false;
-    }
-
     return true;
 }
 
@@ -2143,7 +2142,7 @@ static const Property smmuv3_properties[] = {
     /* RIL can be turned off for accel cases */
     DEFINE_PROP_ON_OFF_AUTO("ril", SMMUv3State, ril, ON_OFF_AUTO_ON),
     DEFINE_PROP_ON_OFF_AUTO("ats", SMMUv3State, ats, ON_OFF_AUTO_OFF),
-    DEFINE_PROP_UINT8("oas", SMMUv3State, oas, 44),
+    DEFINE_PROP_OAS_MODE("oas", SMMUv3State, oas, OAS_MODE_44),
     DEFINE_PROP_SSIDSIZE_MODE("ssidsize", SMMUv3State, ssidsize,
                               SSID_SIZE_MODE_0),
 };
@@ -2180,7 +2179,8 @@ static void smmuv3_class_init(ObjectClass *klass, const void *data)
         "supported.");
     object_class_property_set_description(klass, "oas",
         "Specify Output Address Size (for accel=on). Supported values "
-        "are 44 or 48 bits. Defaults to 44 bits");
+        "are 44 or 48 bits. Defaults to 44 bits. oas=auto is not "
+        "supported.");
     object_class_property_set_description(klass, "ssidsize",
         "Number of bits used to represent SubstreamIDs (SSIDs). "
         "A value of N allows SSIDs in the range [0 .. 2^N - 1]. "
diff --git a/include/hw/arm/smmuv3-common.h b/include/hw/arm/smmuv3-common.h
index 7f0f992dfd..4609975edf 100644
--- a/include/hw/arm/smmuv3-common.h
+++ b/include/hw/arm/smmuv3-common.h
@@ -342,8 +342,6 @@ REG32(IDR5,                0x14)
      FIELD(IDR5, VAX,        10, 2);
      FIELD(IDR5, STALL_MAX,  16, 16);
 
-#define SMMU_OAS_44BIT 44
-#define SMMU_OAS_48BIT 48
 #define SMMU_IDR5_OAS_44 4
 #define SMMU_IDR5_OAS_48 5
 
diff --git a/include/hw/arm/smmuv3.h b/include/hw/arm/smmuv3.h
index ddf472493d..82f18eb090 100644
--- a/include/hw/arm/smmuv3.h
+++ b/include/hw/arm/smmuv3.h
@@ -72,7 +72,7 @@ struct SMMUv3State {
     Error *migration_blocker;
     OnOffAuto ril;
     OnOffAuto ats;
-    uint8_t oas;
+    OasMode oas;
     SsidSizeMode ssidsize;
 };
 
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 35+ messages in thread

* [PATCH v4 8/8] qemu-options.hx: Document arm-smmuv3 device's accel properties
  2026-03-18 18:48 [PATCH for-11.0 v4 0/8] hw/arm/smmuv3-accel: Support AUTO properties Nathan Chen
                   ` (6 preceding siblings ...)
  2026-03-18 18:49 ` [PATCH v4 7/8] hw/arm/smmuv3-accel: Change OAS property to OasMode Nathan Chen
@ 2026-03-18 18:49 ` Nathan Chen
  2026-03-19 12:21   ` Markus Armbruster
  2026-03-19 10:01 ` [PATCH for-11.0 v4 0/8] hw/arm/smmuv3-accel: Support AUTO properties Eric Auger
  2026-03-19 10:15 ` Shameer Kolothum Thodi
  9 siblings, 1 reply; 35+ messages in thread
From: Nathan Chen @ 2026-03-18 18:49 UTC (permalink / raw)
  To: qemu-devel, qemu-arm
  Cc: Eric Auger, Peter Maydell, Michael S . Tsirkin, Igor Mammedov,
	Ani Sinha, Shannon Zhao, Paolo Bonzini, Daniel P . Berrangé,
	Eric Blake, Markus Armbruster, Shameer Kolothum, Matt Ochs,
	Nicolin Chen, Nathan Chen

From: Nathan Chen <nathanc@nvidia.com>

Document arm-smmuv3 properties for setting HW-acceleration,
Range Invalidation, and Address Translation Services support, as
well as setting Output Address size and Substream ID size.

Reviewed-by: Eric Auger <eric.auger@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Shameer Kolothum <skolothumtho@nvidia.com>
Signed-off-by: Nathan Chen <nathanc@nvidia.com>
---
 qemu-options.hx | 32 +++++++++++++++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)

diff --git a/qemu-options.hx b/qemu-options.hx
index 69e5a874c1..f8da35513a 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -1279,13 +1279,43 @@ SRST
     ``aw-bits=val`` (val between 32 and 64, default depends on machine)
         This decides the address width of the IOVA address space.
 
-``-device arm-smmuv3,primary-bus=id``
+``-device arm-smmuv3,primary-bus=id[,option=...]``
     This is only supported by ``-machine virt`` (ARM).
 
     ``primary-bus=id``
         Accepts either the default root complex (pcie.0) or a
         pxb-pcie based root complex.
 
+    ``accel=on|off`` (default: off)
+        Enables guest to leverage host SMMUv3 features for acceleration.
+        Enabling accel configures the host SMMUv3 in nested mode to support
+        vfio-pci passthrough.
+
+     The following options are available when accel=on.
+     Note: 'auto' mode is not currently supported.
+
+    ``ril=on|off`` (default: on)
+        Support for Range Invalidation, which allows the SMMUv3 driver to
+        invalidate TLB entries for a range of IOVAs at once instead of issuing
+        separate commands to invalidate each page. Must match with host SMMUv3
+        Range Invalidation support.
+
+    ``ats=on|off`` (default: off)
+        Support for Address Translation Services, which enables PCIe devices to
+        cache address translations in their local TLB and reduce latency. Host
+        SMMUv3 must support ATS in order to enable this feature for the vIOMMU.
+
+    ``oas=val`` (supported values are 44 and 48. default: 44)
+        Sets the Output Address Size in bits. The value set here must be less
+        than or equal to the host SMMUv3's supported OAS, so that the
+        intermediate physical addresses (IPA) consumed by host SMMU for stage-2
+        translation do not exceed the host's max supported IPA size.
+
+    ``ssidsize=val`` (val between 0 and 20. default: 0)
+        Sets the Substream ID size in bits. When set to a non-zero value,
+        PASID capability is advertised to the vIOMMU and accelerated use cases
+        such as Shared Virtual Addressing (SVA) are supported.
+
 ``-device amd-iommu[,option=...]``
     Enables emulation of an AMD-Vi I/O Memory Management Unit (IOMMU).
     Only available with ``-machine q35``, it supports the following options:
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 35+ messages in thread

* RE: [PATCH v4 2/8] hw/arm/smmuv3-accel: Change ATS property to OnOffAuto
  2026-03-18 18:49 ` [PATCH v4 2/8] hw/arm/smmuv3-accel: Change ATS property to OnOffAuto Nathan Chen
@ 2026-03-19  8:10   ` Shameer Kolothum Thodi
  2026-03-19  9:35   ` Eric Auger
  2026-03-19 11:54   ` Markus Armbruster
  2 siblings, 0 replies; 35+ messages in thread
From: Shameer Kolothum Thodi @ 2026-03-19  8:10 UTC (permalink / raw)
  To: Nathan Chen, qemu-devel@nongnu.org, qemu-arm@nongnu.org
  Cc: Eric Auger, Peter Maydell, Michael S . Tsirkin, Igor Mammedov,
	Ani Sinha, Shannon Zhao, Paolo Bonzini, Daniel P . Berrangé,
	Eric Blake, Markus Armbruster, Matt Ochs, Nicolin Chen



> -----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 v4 2/8] hw/arm/smmuv3-accel: Change ATS property to
> OnOffAuto
> 
> From: Nathan Chen <nathanc@nvidia.com>
> 
> Change accel SMMUv3 ATS property from bool to OnOffAuto. The 'auto'
> value is not implemented, as this commit is meant to set the property
> to the correct type and avoid breaking JSON/QMP when the auto mode is
> introduced. A future patch will implement resolution of the 'auto'
> value to match the host SMMUv3 ATS support.
> 
> Fixes: f7f5013a55a3 ("hw/arm/smmuv3-accel: Add support for ATS")
> Tested-by: Eric Auger <eric.auger@redhat.com>
> Signed-off-by: Nathan Chen <nathanc@nvidia.com>

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

Thanks,
Shameer


^ permalink raw reply	[flat|nested] 35+ messages in thread

* RE: [PATCH v4 3/8] hw/arm/smmuv3-accel: Change RIL property to OnOffAuto
  2026-03-18 18:49 ` [PATCH v4 3/8] hw/arm/smmuv3-accel: Change RIL " Nathan Chen
@ 2026-03-19  8:12   ` Shameer Kolothum Thodi
  2026-03-19  9:37   ` Eric Auger
  2026-03-19 11:55   ` Markus Armbruster
  2 siblings, 0 replies; 35+ messages in thread
From: Shameer Kolothum Thodi @ 2026-03-19  8:12 UTC (permalink / raw)
  To: Nathan Chen, qemu-devel@nongnu.org, qemu-arm@nongnu.org
  Cc: Eric Auger, Peter Maydell, Michael S . Tsirkin, Igor Mammedov,
	Ani Sinha, Shannon Zhao, Paolo Bonzini, Daniel P . Berrangé,
	Eric Blake, Markus Armbruster, Matt Ochs, Nicolin Chen



> -----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 v4 3/8] hw/arm/smmuv3-accel: Change RIL property to
> OnOffAuto
> 
> From: Nathan Chen <nathanc@nvidia.com>
> 
> Change accel SMMUv3 RIL property from bool to OnOffAuto. The 'auto'
> value is not implemented, as this commit is meant to set the property
> to the correct type and avoid breaking JSON/QMP when the auto mode is
> introduced. A future patch will implement resolution of the 'auto'
> value to match the host SMMUv3 RIL support.
> 
> Fixes: bd715ff5bda9 ("hw/arm/smmuv3-accel: Add a property to specify RIL
> support")
> Tested-by: Eric Auger <eric.auger@redhat.com>
> Signed-off-by: Nathan Chen <nathanc@nvidia.com>

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

Thanks,
Shameer


^ permalink raw reply	[flat|nested] 35+ messages in thread

* RE: [PATCH v4 5/8] hw/arm/smmuv3-accel: Change SSIDSIZE property to SsidSizeMode
  2026-03-18 18:49 ` [PATCH v4 5/8] hw/arm/smmuv3-accel: Change SSIDSIZE property to SsidSizeMode Nathan Chen
@ 2026-03-19  8:35   ` Shameer Kolothum Thodi
  2026-03-19  9:48   ` Eric Auger
  2026-03-19 12:14   ` Markus Armbruster
  2 siblings, 0 replies; 35+ messages in thread
From: Shameer Kolothum Thodi @ 2026-03-19  8:35 UTC (permalink / raw)
  To: Nathan Chen, qemu-devel@nongnu.org, qemu-arm@nongnu.org
  Cc: Eric Auger, Peter Maydell, Michael S . Tsirkin, Igor Mammedov,
	Ani Sinha, Shannon Zhao, Paolo Bonzini, Daniel P . Berrangé,
	Eric Blake, Markus Armbruster, Matt Ochs, Nicolin Chen



> -----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 v4 5/8] hw/arm/smmuv3-accel: Change SSIDSIZE property to
> SsidSizeMode
> 
> From: Nathan Chen <nathanc@nvidia.com>
> 
> Change accel SMMUv3 SSIDSIZE property from uint8_t to SsidSizeMode.
> The 'auto' value is not implemented, as this commit is meant to set the
> property to the correct type and avoid breaking JSON/QMP when the auto
> mode is introduced. A future patch will implement resolution of 'auto'
> value to match the host SMMUv3 SSIDSIZE value.
> 
> Fixes: b8c6f8a69d27 ("hw/arm/smmuv3-accel: Make SubstreamID support
> configurable")
> Tested-by: Eric Auger <eric.auger@redhat.com>
> Signed-off-by: Nathan Chen <nathanc@nvidia.com>

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

Thanks,
Shameer


^ permalink raw reply	[flat|nested] 35+ messages in thread

* RE: [PATCH v4 7/8] hw/arm/smmuv3-accel: Change OAS property to OasMode
  2026-03-18 18:49 ` [PATCH v4 7/8] hw/arm/smmuv3-accel: Change OAS property to OasMode Nathan Chen
@ 2026-03-19  8:39   ` Shameer Kolothum Thodi
  2026-03-19  9:51   ` Eric Auger
  2026-03-19 12:20   ` Markus Armbruster
  2 siblings, 0 replies; 35+ messages in thread
From: Shameer Kolothum Thodi @ 2026-03-19  8:39 UTC (permalink / raw)
  To: Nathan Chen, qemu-devel@nongnu.org, qemu-arm@nongnu.org
  Cc: Eric Auger, Peter Maydell, Michael S . Tsirkin, Igor Mammedov,
	Ani Sinha, Shannon Zhao, Paolo Bonzini, Daniel P . Berrangé,
	Eric Blake, Markus Armbruster, Matt Ochs, Nicolin Chen



> -----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 v4 7/8] hw/arm/smmuv3-accel: Change OAS property to
> OasMode
> 
> From: Nathan Chen <nathanc@nvidia.com>
> 
> Change accel SMMUv3 OAS property from uint8_t to OasMode. The
> 'auto' value is not implemented, as this commit is meant to
> set the property to the correct type and avoid breaking JSON/QMP
> when the auto mode is introduced. A future patch will implement
> resolution of 'auto' value to match the host SMMUv3 OAS value.
> 
> Fixes: a015ac990fd3 ("hw/arm/smmuv3-accel: Add property to specify OAS
> bits")
> Tested-by: Eric Auger <eric.auger@redhat.com>
> Signed-off-by: Nathan Chen <nathanc@nvidia.com>

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

Thanks,
Shameer


^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v4 2/8] hw/arm/smmuv3-accel: Change ATS property to OnOffAuto
  2026-03-18 18:49 ` [PATCH v4 2/8] hw/arm/smmuv3-accel: Change ATS property to OnOffAuto Nathan Chen
  2026-03-19  8:10   ` Shameer Kolothum Thodi
@ 2026-03-19  9:35   ` Eric Auger
  2026-03-19 11:54   ` Markus Armbruster
  2 siblings, 0 replies; 35+ messages in thread
From: Eric Auger @ 2026-03-19  9:35 UTC (permalink / raw)
  To: Nathan Chen, qemu-devel, qemu-arm
  Cc: Peter Maydell, Michael S . Tsirkin, Igor Mammedov, Ani Sinha,
	Shannon Zhao, Paolo Bonzini, Daniel P . Berrangé, Eric Blake,
	Markus Armbruster, Shameer Kolothum, Matt Ochs, Nicolin Chen



On 3/18/26 7:49 PM, Nathan Chen wrote:
> From: Nathan Chen <nathanc@nvidia.com>
>
> Change accel SMMUv3 ATS property from bool to OnOffAuto. The 'auto'
> value is not implemented, as this commit is meant to set the property
> to the correct type and avoid breaking JSON/QMP when the auto mode is
> introduced. A future patch will implement resolution of the 'auto'
> value to match the host SMMUv3 ATS support.
>
> Fixes: f7f5013a55a3 ("hw/arm/smmuv3-accel: Add support for ATS")
> Tested-by: Eric Auger <eric.auger@redhat.com>
> Signed-off-by: Nathan Chen <nathanc@nvidia.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>

Eric
> ---
>  hw/arm/smmuv3-accel.c    |  4 +++-
>  hw/arm/smmuv3.c          | 17 ++++++++++++++---
>  hw/arm/virt-acpi-build.c |  2 +-
>  include/hw/arm/smmuv3.h  |  4 +++-
>  4 files changed, 21 insertions(+), 6 deletions(-)
>
> diff --git a/hw/arm/smmuv3-accel.c b/hw/arm/smmuv3-accel.c
> index 2bb142c47f..f21a6a9997 100644
> --- a/hw/arm/smmuv3-accel.c
> +++ b/hw/arm/smmuv3-accel.c
> @@ -827,7 +827,9 @@ void smmuv3_accel_idr_override(SMMUv3State *s)
>      s->idr[3] = FIELD_DP32(s->idr[3], IDR3, RIL, s->ril);
>  
>      /* QEMU SMMUv3 has no ATS. Advertise ATS if opt-in by property */
> -    s->idr[0] = FIELD_DP32(s->idr[0], IDR0, ATS, s->ats);
> +    if (s->ats == ON_OFF_AUTO_ON) {
> +        s->idr[0] = FIELD_DP32(s->idr[0], IDR0, ATS, 1);
> +    }
>  
>      /* Advertise 48-bit OAS in IDR5 when requested (default is 44 bits). */
>      if (s->oas == SMMU_OAS_48BIT) {
> diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c
> index 068108e49b..a683402a0c 100644
> --- a/hw/arm/smmuv3.c
> +++ b/hw/arm/smmuv3.c
> @@ -317,6 +317,11 @@ static void smmuv3_init_id_regs(SMMUv3State *s)
>      smmuv3_accel_idr_override(s);
>  }
>  
> +bool smmuv3_ats_enabled(SMMUv3State *s)
> +{
> +    return FIELD_EX32(s->idr[0], IDR0, ATS);
> +}
> +
>  static void smmuv3_reset(SMMUv3State *s)
>  {
>      s->cmdq.base = deposit64(s->cmdq.base, 0, 5, SMMU_CMDQS);
> @@ -1966,12 +1971,17 @@ static bool smmu_validate_property(SMMUv3State *s, Error **errp)
>      }
>  #endif
>  
> +    if (s->ats == ON_OFF_AUTO_AUTO) {
> +        error_setg(errp, "ats auto mode is not supported");
> +        return false;
> +    }
> +
>      if (!s->accel) {
>          if (!s->ril) {
>              error_setg(errp, "ril can only be disabled if accel=on");
>              return false;
>          }
> -        if (s->ats) {
> +        if (s->ats == ON_OFF_AUTO_ON) {
>              error_setg(errp, "ats can only be enabled if accel=on");
>              return false;
>          }
> @@ -2128,7 +2138,7 @@ static const Property smmuv3_properties[] = {
>      DEFINE_PROP_UINT64("msi-gpa", SMMUv3State, msi_gpa, 0),
>      /* RIL can be turned off for accel cases */
>      DEFINE_PROP_BOOL("ril", SMMUv3State, ril, true),
> -    DEFINE_PROP_BOOL("ats", SMMUv3State, ats, false),
> +    DEFINE_PROP_ON_OFF_AUTO("ats", SMMUv3State, ats, ON_OFF_AUTO_OFF),
>      DEFINE_PROP_UINT8("oas", SMMUv3State, oas, 44),
>      DEFINE_PROP_UINT8("ssidsize", SMMUv3State, ssidsize, 0),
>  };
> @@ -2160,7 +2170,8 @@ static void smmuv3_class_init(ObjectClass *klass, const void *data)
>          "Disable range invalidation support (for accel=on)");
>      object_class_property_set_description(klass, "ats",
>          "Enable/disable ATS support (for accel=on). Please ensure host "
> -        "platform has ATS support before enabling this");
> +        "platform has ATS support before enabling this. ats=auto is not "
> +        "supported.");
>      object_class_property_set_description(klass, "oas",
>          "Specify Output Address Size (for accel=on). Supported values "
>          "are 44 or 48 bits. Defaults to 44 bits");
> diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
> index 719d2f994e..591cfc993c 100644
> --- a/hw/arm/virt-acpi-build.c
> +++ b/hw/arm/virt-acpi-build.c
> @@ -402,7 +402,7 @@ static int iort_smmuv3_devices(Object *obj, void *opaque)
>  
>      bus = PCI_BUS(object_property_get_link(obj, "primary-bus", &error_abort));
>      sdev.accel = object_property_get_bool(obj, "accel", &error_abort);
> -    sdev.ats = object_property_get_bool(obj, "ats", &error_abort);
> +    sdev.ats = smmuv3_ats_enabled(ARM_SMMUV3(obj));
>      pbus = PLATFORM_BUS_DEVICE(vms->platform_bus_dev);
>      sbdev = SYS_BUS_DEVICE(obj);
>      sdev.base = platform_bus_get_mmio_addr(pbus, sbdev, 0);
> diff --git a/include/hw/arm/smmuv3.h b/include/hw/arm/smmuv3.h
> index 26b2fc42fd..ce51a5b9b4 100644
> --- a/include/hw/arm/smmuv3.h
> +++ b/include/hw/arm/smmuv3.h
> @@ -70,7 +70,7 @@ struct SMMUv3State {
>      uint64_t msi_gpa;
>      Error *migration_blocker;
>      bool ril;
> -    bool ats;
> +    OnOffAuto ats;
>      uint8_t oas;
>      uint8_t ssidsize;
>  };
> @@ -91,6 +91,8 @@ struct SMMUv3Class {
>      ResettablePhases parent_phases;
>  };
>  
> +bool smmuv3_ats_enabled(struct SMMUv3State *s);
> +
>  #define TYPE_ARM_SMMUV3   "arm-smmuv3"
>  OBJECT_DECLARE_TYPE(SMMUv3State, SMMUv3Class, ARM_SMMUV3)
>  



^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v4 3/8] hw/arm/smmuv3-accel: Change RIL property to OnOffAuto
  2026-03-18 18:49 ` [PATCH v4 3/8] hw/arm/smmuv3-accel: Change RIL " Nathan Chen
  2026-03-19  8:12   ` Shameer Kolothum Thodi
@ 2026-03-19  9:37   ` Eric Auger
  2026-03-19 11:55   ` Markus Armbruster
  2 siblings, 0 replies; 35+ messages in thread
From: Eric Auger @ 2026-03-19  9:37 UTC (permalink / raw)
  To: Nathan Chen, qemu-devel, qemu-arm
  Cc: Peter Maydell, Michael S . Tsirkin, Igor Mammedov, Ani Sinha,
	Shannon Zhao, Paolo Bonzini, Daniel P . Berrangé, Eric Blake,
	Markus Armbruster, Shameer Kolothum, Matt Ochs, Nicolin Chen



On 3/18/26 7:49 PM, Nathan Chen wrote:
> From: Nathan Chen <nathanc@nvidia.com>
>
> Change accel SMMUv3 RIL property from bool to OnOffAuto. The 'auto'
> value is not implemented, as this commit is meant to set the property
> to the correct type and avoid breaking JSON/QMP when the auto mode is
> introduced. A future patch will implement resolution of the 'auto'
> value to match the host SMMUv3 RIL support.
>
> Fixes: bd715ff5bda9 ("hw/arm/smmuv3-accel: Add a property to specify RIL support")
> Tested-by: Eric Auger <eric.auger@redhat.com>
> Signed-off-by: Nathan Chen <nathanc@nvidia.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>

Eric
> ---
>  hw/arm/smmuv3-accel.c   |  6 ++++--
>  hw/arm/smmuv3.c         | 11 ++++++++---
>  include/hw/arm/smmuv3.h |  2 +-
>  3 files changed, 13 insertions(+), 6 deletions(-)
>
> diff --git a/hw/arm/smmuv3-accel.c b/hw/arm/smmuv3-accel.c
> index f21a6a9997..c31b64295e 100644
> --- a/hw/arm/smmuv3-accel.c
> +++ b/hw/arm/smmuv3-accel.c
> @@ -823,8 +823,10 @@ void smmuv3_accel_idr_override(SMMUv3State *s)
>          return;
>      }
>  
> -    /* By default QEMU SMMUv3 has RIL. Update IDR3 if user has disabled it */
> -    s->idr[3] = FIELD_DP32(s->idr[3], IDR3, RIL, s->ril);
> +    /* Only override RIL if user explicitly set OFF */
> +    if (s->ril == ON_OFF_AUTO_OFF) {
> +        s->idr[3] = FIELD_DP32(s->idr[3], IDR3, RIL, 0);
> +    }
>  
>      /* QEMU SMMUv3 has no ATS. Advertise ATS if opt-in by property */
>      if (s->ats == ON_OFF_AUTO_ON) {
> diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c
> index a683402a0c..ea285bdf64 100644
> --- a/hw/arm/smmuv3.c
> +++ b/hw/arm/smmuv3.c
> @@ -1975,9 +1975,13 @@ static bool smmu_validate_property(SMMUv3State *s, Error **errp)
>          error_setg(errp, "ats auto mode is not supported");
>          return false;
>      }
> +    if (s->ril == ON_OFF_AUTO_AUTO) {
> +        error_setg(errp, "ril auto mode is not supported");
> +        return false;
> +    }
>  
>      if (!s->accel) {
> -        if (!s->ril) {
> +        if (s->ril == ON_OFF_AUTO_OFF) {
>              error_setg(errp, "ril can only be disabled if accel=on");
>              return false;
>          }
> @@ -2137,7 +2141,7 @@ static const Property smmuv3_properties[] = {
>      /* GPA of MSI doorbell, for SMMUv3 accel use. */
>      DEFINE_PROP_UINT64("msi-gpa", SMMUv3State, msi_gpa, 0),
>      /* RIL can be turned off for accel cases */
> -    DEFINE_PROP_BOOL("ril", SMMUv3State, ril, true),
> +    DEFINE_PROP_ON_OFF_AUTO("ril", SMMUv3State, ril, ON_OFF_AUTO_ON),
>      DEFINE_PROP_ON_OFF_AUTO("ats", SMMUv3State, ats, ON_OFF_AUTO_OFF),
>      DEFINE_PROP_UINT8("oas", SMMUv3State, oas, 44),
>      DEFINE_PROP_UINT8("ssidsize", SMMUv3State, ssidsize, 0),
> @@ -2167,7 +2171,8 @@ static void smmuv3_class_init(ObjectClass *klass, const void *data)
>          "Enable SMMUv3 accelerator support. Allows host SMMUv3 to be "
>          "configured in nested mode for vfio-pci dev assignment");
>      object_class_property_set_description(klass, "ril",
> -        "Disable range invalidation support (for accel=on)");
> +        "Disable range invalidation support (for accel=on). ril=auto "
> +        "is not supported.");
>      object_class_property_set_description(klass, "ats",
>          "Enable/disable ATS support (for accel=on). Please ensure host "
>          "platform has ATS support before enabling this. ats=auto is not "
> diff --git a/include/hw/arm/smmuv3.h b/include/hw/arm/smmuv3.h
> index ce51a5b9b4..c35e599bbc 100644
> --- a/include/hw/arm/smmuv3.h
> +++ b/include/hw/arm/smmuv3.h
> @@ -69,7 +69,7 @@ struct SMMUv3State {
>      struct SMMUv3AccelState *s_accel;
>      uint64_t msi_gpa;
>      Error *migration_blocker;
> -    bool ril;
> +    OnOffAuto ril;
>      OnOffAuto ats;
>      uint8_t oas;
>      uint8_t ssidsize;



^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v4 5/8] hw/arm/smmuv3-accel: Change SSIDSIZE property to SsidSizeMode
  2026-03-18 18:49 ` [PATCH v4 5/8] hw/arm/smmuv3-accel: Change SSIDSIZE property to SsidSizeMode Nathan Chen
  2026-03-19  8:35   ` Shameer Kolothum Thodi
@ 2026-03-19  9:48   ` Eric Auger
  2026-03-19 12:14   ` Markus Armbruster
  2 siblings, 0 replies; 35+ messages in thread
From: Eric Auger @ 2026-03-19  9:48 UTC (permalink / raw)
  To: Nathan Chen, qemu-devel, qemu-arm
  Cc: Peter Maydell, Michael S . Tsirkin, Igor Mammedov, Ani Sinha,
	Shannon Zhao, Paolo Bonzini, Daniel P . Berrangé, Eric Blake,
	Markus Armbruster, Shameer Kolothum, Matt Ochs, Nicolin Chen



On 3/18/26 7:49 PM, Nathan Chen wrote:
> From: Nathan Chen <nathanc@nvidia.com>
>
> Change accel SMMUv3 SSIDSIZE property from uint8_t to SsidSizeMode.
> The 'auto' value is not implemented, as this commit is meant to set the
> property to the correct type and avoid breaking JSON/QMP when the auto
> mode is introduced. A future patch will implement resolution of 'auto'
> value to match the host SMMUv3 SSIDSIZE value.
>
> Fixes: b8c6f8a69d27 ("hw/arm/smmuv3-accel: Make SubstreamID support configurable")
> Tested-by: Eric Auger <eric.auger@redhat.com>
> Signed-off-by: Nathan Chen <nathanc@nvidia.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>

Eric
> ---
>  hw/arm/smmuv3-accel.c          | 23 +++++++++++++++++++++--
>  hw/arm/smmuv3.c                | 19 ++++++++++---------
>  include/hw/arm/smmuv3-common.h |  1 -
>  include/hw/arm/smmuv3.h        |  3 ++-
>  4 files changed, 33 insertions(+), 13 deletions(-)
>
> diff --git a/hw/arm/smmuv3-accel.c b/hw/arm/smmuv3-accel.c
> index c31b64295e..bc6cbfebc2 100644
> --- a/hw/arm/smmuv3-accel.c
> +++ b/hw/arm/smmuv3-accel.c
> @@ -802,7 +802,7 @@ static uint64_t smmuv3_accel_get_viommu_flags(void *opaque)
>      SMMUState *bs = opaque;
>      SMMUv3State *s = ARM_SMMUV3(bs);
>  
> -    if (s->ssidsize) {
> +    if (s->ssidsize > SSID_SIZE_MODE_0) {
>          flags |= VIOMMU_FLAG_PASID_SUPPORTED;
>      }
>      return flags;
> @@ -817,6 +817,22 @@ static const PCIIOMMUOps smmuv3_accel_ops = {
>      .get_msi_direct_gpa = smmuv3_accel_get_msi_gpa,
>  };
>  
> +/*
> + * This returns the value of a SsidSizeMode value offset by 1 to
> + * account for the enum values offset by 1 from actual values.
> + *
> + * SSID_SIZE_MODE_0 = 1, SSID_SIZE_MODE_1 = 2, etc. so return 0
> + * if SSID_SIZE_MODE_0 is passed as input, return 1 if
> + * SSID_SIZE_MODE_1 is passed as input, etc.
> + */
> +static uint8_t ssidsize_mode_to_value(SsidSizeMode mode)
> +{
> +    if (mode == SSID_SIZE_MODE_AUTO) {
> +        return 0;
> +    }
> +    return mode - 1;
> +}
> +
>  void smmuv3_accel_idr_override(SMMUv3State *s)
>  {
>      if (!s->accel) {
> @@ -842,7 +858,10 @@ void smmuv3_accel_idr_override(SMMUv3State *s)
>       * By default QEMU SMMUv3 has no SubstreamID support. Update IDR1 if user
>       * has enabled it.
>       */
> -    s->idr[1] = FIELD_DP32(s->idr[1], IDR1, SSIDSIZE, s->ssidsize);
> +    if (s->ssidsize > SSID_SIZE_MODE_0) {
> +        s->idr[1] = FIELD_DP32(s->idr[1], IDR1, SSIDSIZE,
> +                               ssidsize_mode_to_value(s->ssidsize));
> +    }
>  }
>  
>  /* Based on SMUUv3 GPBA.ABORT configuration, attach a corresponding HWPT */
> diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c
> index ea285bdf64..79018f8d66 100644
> --- a/hw/arm/smmuv3.c
> +++ b/hw/arm/smmuv3.c
> @@ -20,6 +20,7 @@
>  #include "qemu/bitops.h"
>  #include "hw/core/irq.h"
>  #include "hw/core/sysbus.h"
> +#include "hw/core/qdev-properties-system.h"
>  #include "migration/blocker.h"
>  #include "migration/vmstate.h"
>  #include "hw/core/qdev-properties.h"
> @@ -625,7 +626,7 @@ static int decode_ste(SMMUv3State *s, SMMUTransCfg *cfg,
>      }
>  
>      /* Multiple context descriptors require SubstreamID support */
> -    if (!s->ssidsize && STE_S1CDMAX(ste) != 0) {
> +    if (s->ssidsize == SSID_SIZE_MODE_0 && STE_S1CDMAX(ste) != 0) {
>          qemu_log_mask(LOG_UNIMP,
>                  "SMMUv3: multiple S1 context descriptors require SubstreamID support. "
>                  "Configure ssidsize > 0 (requires accel=on)\n");
> @@ -1979,6 +1980,10 @@ static bool smmu_validate_property(SMMUv3State *s, Error **errp)
>          error_setg(errp, "ril auto mode is not supported");
>          return false;
>      }
> +    if (s->ssidsize == SSID_SIZE_MODE_AUTO) {
> +        error_setg(errp, "ssidsize auto mode is not supported");
> +        return false;
> +    }
>  
>      if (!s->accel) {
>          if (s->ril == ON_OFF_AUTO_OFF) {
> @@ -1993,7 +1998,7 @@ static bool smmu_validate_property(SMMUv3State *s, Error **errp)
>              error_setg(errp, "OAS must be 44 bits when accel=off");
>              return false;
>          }
> -        if (s->ssidsize) {
> +        if (s->ssidsize > SSID_SIZE_MODE_0) {
>              error_setg(errp, "ssidsize can only be set if accel=on");
>              return false;
>          }
> @@ -2011,11 +2016,6 @@ static bool smmu_validate_property(SMMUv3State *s, Error **errp)
>          error_setg(errp, "OAS can only be set to 44 or 48 bits");
>          return false;
>      }
> -    if (s->ssidsize > SMMU_SSID_MAX_BITS) {
> -        error_setg(errp, "ssidsize must be in the range 0 to %d",
> -                   SMMU_SSID_MAX_BITS);
> -        return false;
> -    }
>  
>      return true;
>  }
> @@ -2144,7 +2144,8 @@ static const Property smmuv3_properties[] = {
>      DEFINE_PROP_ON_OFF_AUTO("ril", SMMUv3State, ril, ON_OFF_AUTO_ON),
>      DEFINE_PROP_ON_OFF_AUTO("ats", SMMUv3State, ats, ON_OFF_AUTO_OFF),
>      DEFINE_PROP_UINT8("oas", SMMUv3State, oas, 44),
> -    DEFINE_PROP_UINT8("ssidsize", SMMUv3State, ssidsize, 0),
> +    DEFINE_PROP_SSIDSIZE_MODE("ssidsize", SMMUv3State, ssidsize,
> +                              SSID_SIZE_MODE_0),
>  };
>  
>  static void smmuv3_instance_init(Object *obj)
> @@ -2185,7 +2186,7 @@ static void smmuv3_class_init(ObjectClass *klass, const void *data)
>          "A value of N allows SSIDs in the range [0 .. 2^N - 1]. "
>          "Valid range is 0-20, where 0 disables SubstreamID support. "
>          "Defaults to 0. A value greater than 0 is required to enable "
> -        "PASID support.");
> +        "PASID support. ssidsize=auto is not supported.");
>  }
>  
>  static int smmuv3_notify_flag_changed(IOMMUMemoryRegion *iommu,
> diff --git a/include/hw/arm/smmuv3-common.h b/include/hw/arm/smmuv3-common.h
> index 9f78bbe89e..7f0f992dfd 100644
> --- a/include/hw/arm/smmuv3-common.h
> +++ b/include/hw/arm/smmuv3-common.h
> @@ -311,7 +311,6 @@ REG32(IDR1,                0x4)
>      FIELD(IDR1, TABLES_PRESET, 30, 1)
>      FIELD(IDR1, ECMDQ,        31, 1)
>  
> -#define SMMU_SSID_MAX_BITS 20
>  #define SMMU_IDR1_SIDSIZE 16
>  #define SMMU_CMDQS   19
>  #define SMMU_EVENTQS 19
> diff --git a/include/hw/arm/smmuv3.h b/include/hw/arm/smmuv3.h
> index c35e599bbc..ddf472493d 100644
> --- a/include/hw/arm/smmuv3.h
> +++ b/include/hw/arm/smmuv3.h
> @@ -21,6 +21,7 @@
>  
>  #include "hw/arm/smmu-common.h"
>  #include "qom/object.h"
> +#include "qapi/qapi-types-misc-arm.h"
>  
>  #define TYPE_SMMUV3_IOMMU_MEMORY_REGION "smmuv3-iommu-memory-region"
>  
> @@ -72,7 +73,7 @@ struct SMMUv3State {
>      OnOffAuto ril;
>      OnOffAuto ats;
>      uint8_t oas;
> -    uint8_t ssidsize;
> +    SsidSizeMode ssidsize;
>  };
>  
>  typedef enum {



^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v4 7/8] hw/arm/smmuv3-accel: Change OAS property to OasMode
  2026-03-18 18:49 ` [PATCH v4 7/8] hw/arm/smmuv3-accel: Change OAS property to OasMode Nathan Chen
  2026-03-19  8:39   ` Shameer Kolothum Thodi
@ 2026-03-19  9:51   ` Eric Auger
  2026-03-19 12:20   ` Markus Armbruster
  2 siblings, 0 replies; 35+ messages in thread
From: Eric Auger @ 2026-03-19  9:51 UTC (permalink / raw)
  To: Nathan Chen, qemu-devel, qemu-arm
  Cc: Peter Maydell, Michael S . Tsirkin, Igor Mammedov, Ani Sinha,
	Shannon Zhao, Paolo Bonzini, Daniel P . Berrangé, Eric Blake,
	Markus Armbruster, Shameer Kolothum, Matt Ochs, Nicolin Chen



On 3/18/26 7:49 PM, Nathan Chen wrote:
> From: Nathan Chen <nathanc@nvidia.com>
>
> Change accel SMMUv3 OAS property from uint8_t to OasMode. The
> 'auto' value is not implemented, as this commit is meant to
> set the property to the correct type and avoid breaking JSON/QMP
> when the auto mode is introduced. A future patch will implement
> resolution of 'auto' value to match the host SMMUv3 OAS value.
>
> Fixes: a015ac990fd3 ("hw/arm/smmuv3-accel: Add property to specify OAS bits")
> Tested-by: Eric Auger <eric.auger@redhat.com>
> Signed-off-by: Nathan Chen <nathanc@nvidia.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>

Eric
> ---
>  hw/arm/smmuv3-accel.c          |  2 +-
>  hw/arm/smmuv3.c                | 16 ++++++++--------
>  include/hw/arm/smmuv3-common.h |  2 --
>  include/hw/arm/smmuv3.h        |  2 +-
>  4 files changed, 10 insertions(+), 12 deletions(-)
>
> diff --git a/hw/arm/smmuv3-accel.c b/hw/arm/smmuv3-accel.c
> index bc6cbfebc2..65c2f44880 100644
> --- a/hw/arm/smmuv3-accel.c
> +++ b/hw/arm/smmuv3-accel.c
> @@ -850,7 +850,7 @@ void smmuv3_accel_idr_override(SMMUv3State *s)
>      }
>  
>      /* Advertise 48-bit OAS in IDR5 when requested (default is 44 bits). */
> -    if (s->oas == SMMU_OAS_48BIT) {
> +    if (s->oas == OAS_MODE_48) {
>          s->idr[5] = FIELD_DP32(s->idr[5], IDR5, OAS, SMMU_IDR5_OAS_48);
>      }
>  
> diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c
> index 79018f8d66..c67819d6f2 100644
> --- a/hw/arm/smmuv3.c
> +++ b/hw/arm/smmuv3.c
> @@ -1984,6 +1984,10 @@ static bool smmu_validate_property(SMMUv3State *s, Error **errp)
>          error_setg(errp, "ssidsize auto mode is not supported");
>          return false;
>      }
> +    if (s->oas != OAS_MODE_44 && s->oas != OAS_MODE_48) {
> +        error_setg(errp, "OAS can only be set to 44 or 48 bits");
> +        return false;
> +    }
>  
>      if (!s->accel) {
>          if (s->ril == ON_OFF_AUTO_OFF) {
> @@ -1994,7 +1998,7 @@ static bool smmu_validate_property(SMMUv3State *s, Error **errp)
>              error_setg(errp, "ats can only be enabled if accel=on");
>              return false;
>          }
> -        if (s->oas != SMMU_OAS_44BIT) {
> +        if (s->oas > OAS_MODE_44) {
>              error_setg(errp, "OAS must be 44 bits when accel=off");
>              return false;
>          }
> @@ -2012,11 +2016,6 @@ static bool smmu_validate_property(SMMUv3State *s, Error **errp)
>          return false;
>      }
>  
> -    if (s->oas != SMMU_OAS_44BIT && s->oas != SMMU_OAS_48BIT) {
> -        error_setg(errp, "OAS can only be set to 44 or 48 bits");
> -        return false;
> -    }
> -
>      return true;
>  }
>  
> @@ -2143,7 +2142,7 @@ static const Property smmuv3_properties[] = {
>      /* RIL can be turned off for accel cases */
>      DEFINE_PROP_ON_OFF_AUTO("ril", SMMUv3State, ril, ON_OFF_AUTO_ON),
>      DEFINE_PROP_ON_OFF_AUTO("ats", SMMUv3State, ats, ON_OFF_AUTO_OFF),
> -    DEFINE_PROP_UINT8("oas", SMMUv3State, oas, 44),
> +    DEFINE_PROP_OAS_MODE("oas", SMMUv3State, oas, OAS_MODE_44),
>      DEFINE_PROP_SSIDSIZE_MODE("ssidsize", SMMUv3State, ssidsize,
>                                SSID_SIZE_MODE_0),
>  };
> @@ -2180,7 +2179,8 @@ static void smmuv3_class_init(ObjectClass *klass, const void *data)
>          "supported.");
>      object_class_property_set_description(klass, "oas",
>          "Specify Output Address Size (for accel=on). Supported values "
> -        "are 44 or 48 bits. Defaults to 44 bits");
> +        "are 44 or 48 bits. Defaults to 44 bits. oas=auto is not "
> +        "supported.");
>      object_class_property_set_description(klass, "ssidsize",
>          "Number of bits used to represent SubstreamIDs (SSIDs). "
>          "A value of N allows SSIDs in the range [0 .. 2^N - 1]. "
> diff --git a/include/hw/arm/smmuv3-common.h b/include/hw/arm/smmuv3-common.h
> index 7f0f992dfd..4609975edf 100644
> --- a/include/hw/arm/smmuv3-common.h
> +++ b/include/hw/arm/smmuv3-common.h
> @@ -342,8 +342,6 @@ REG32(IDR5,                0x14)
>       FIELD(IDR5, VAX,        10, 2);
>       FIELD(IDR5, STALL_MAX,  16, 16);
>  
> -#define SMMU_OAS_44BIT 44
> -#define SMMU_OAS_48BIT 48
>  #define SMMU_IDR5_OAS_44 4
>  #define SMMU_IDR5_OAS_48 5
>  
> diff --git a/include/hw/arm/smmuv3.h b/include/hw/arm/smmuv3.h
> index ddf472493d..82f18eb090 100644
> --- a/include/hw/arm/smmuv3.h
> +++ b/include/hw/arm/smmuv3.h
> @@ -72,7 +72,7 @@ struct SMMUv3State {
>      Error *migration_blocker;
>      OnOffAuto ril;
>      OnOffAuto ats;
> -    uint8_t oas;
> +    OasMode oas;
>      SsidSizeMode ssidsize;
>  };
>  



^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH for-11.0 v4 0/8] hw/arm/smmuv3-accel: Support AUTO properties
  2026-03-18 18:48 [PATCH for-11.0 v4 0/8] hw/arm/smmuv3-accel: Support AUTO properties Nathan Chen
                   ` (7 preceding siblings ...)
  2026-03-18 18:49 ` [PATCH v4 8/8] qemu-options.hx: Document arm-smmuv3 device's accel properties Nathan Chen
@ 2026-03-19 10:01 ` Eric Auger
  2026-03-19 10:15 ` Shameer Kolothum Thodi
  9 siblings, 0 replies; 35+ messages in thread
From: Eric Auger @ 2026-03-19 10:01 UTC (permalink / raw)
  To: Nathan Chen, qemu-devel, qemu-arm
  Cc: Peter Maydell, Michael S . Tsirkin, Igor Mammedov, Ani Sinha,
	Shannon Zhao, Paolo Bonzini, Daniel P . Berrangé, Eric Blake,
	Markus Armbruster, Shameer Kolothum, Matt Ochs, Nicolin Chen

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(-)
>



^ permalink raw reply	[flat|nested] 35+ messages in thread

* RE: [PATCH for-11.0 v4 0/8] hw/arm/smmuv3-accel: Support AUTO properties
  2026-03-18 18:48 [PATCH for-11.0 v4 0/8] hw/arm/smmuv3-accel: Support AUTO properties Nathan Chen
                   ` (8 preceding siblings ...)
  2026-03-19 10:01 ` [PATCH for-11.0 v4 0/8] hw/arm/smmuv3-accel: Support AUTO properties Eric Auger
@ 2026-03-19 10:15 ` Shameer Kolothum Thodi
  9 siblings, 0 replies; 35+ messages in thread
From: Shameer Kolothum Thodi @ 2026-03-19 10:15 UTC (permalink / raw)
  To: Nathan Chen, qemu-devel@nongnu.org, qemu-arm@nongnu.org
  Cc: Eric Auger, Peter Maydell, Michael S . Tsirkin, Igor Mammedov,
	Ani Sinha, Shannon Zhao, Paolo Bonzini, Daniel P . Berrangé,
	Eric Blake, Markus Armbruster, Matt Ochs, Nicolin Chen



> -----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


^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v4 2/8] hw/arm/smmuv3-accel: Change ATS property to OnOffAuto
  2026-03-18 18:49 ` [PATCH v4 2/8] hw/arm/smmuv3-accel: Change ATS property to OnOffAuto Nathan Chen
  2026-03-19  8:10   ` Shameer Kolothum Thodi
  2026-03-19  9:35   ` Eric Auger
@ 2026-03-19 11:54   ` Markus Armbruster
  2 siblings, 0 replies; 35+ messages in thread
From: Markus Armbruster @ 2026-03-19 11:54 UTC (permalink / raw)
  To: Nathan Chen
  Cc: qemu-devel, qemu-arm, Eric Auger, Peter Maydell,
	Michael S . Tsirkin, Igor Mammedov, Ani Sinha, Shannon Zhao,
	Paolo Bonzini, Daniel P . Berrangé, Eric Blake,
	Shameer Kolothum, Matt Ochs, Nicolin Chen

Nathan Chen <nathanc@nvidia.com> writes:

> From: Nathan Chen <nathanc@nvidia.com>
>
> Change accel SMMUv3 ATS property from bool to OnOffAuto. The 'auto'

Incompatible change; okay because property "ats" is new in this release.
Spelling such things out in the commit message helps reviewers.  Not
worth a respin.

> value is not implemented, as this commit is meant to set the property
> to the correct type and avoid breaking JSON/QMP when the auto mode is
> introduced. A future patch will implement resolution of the 'auto'
> value to match the host SMMUv3 ATS support.
>
> Fixes: f7f5013a55a3 ("hw/arm/smmuv3-accel: Add support for ATS")
> Tested-by: Eric Auger <eric.auger@redhat.com>
> Signed-off-by: Nathan Chen <nathanc@nvidia.com>

Acked-by: Markus Armbruster <armbru@redhat.com>



^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v4 3/8] hw/arm/smmuv3-accel: Change RIL property to OnOffAuto
  2026-03-18 18:49 ` [PATCH v4 3/8] hw/arm/smmuv3-accel: Change RIL " Nathan Chen
  2026-03-19  8:12   ` Shameer Kolothum Thodi
  2026-03-19  9:37   ` Eric Auger
@ 2026-03-19 11:55   ` Markus Armbruster
  2 siblings, 0 replies; 35+ messages in thread
From: Markus Armbruster @ 2026-03-19 11:55 UTC (permalink / raw)
  To: Nathan Chen
  Cc: qemu-devel, qemu-arm, Eric Auger, Peter Maydell,
	Michael S . Tsirkin, Igor Mammedov, Ani Sinha, Shannon Zhao,
	Paolo Bonzini, Daniel P . Berrangé, Eric Blake,
	Shameer Kolothum, Matt Ochs, Nicolin Chen

Nathan Chen <nathanc@nvidia.com> writes:

> From: Nathan Chen <nathanc@nvidia.com>
>
> Change accel SMMUv3 RIL property from bool to OnOffAuto. The 'auto'

Incompatible change; okay because property "ril" is new in this release.
Spelling such things out in the commit message helps reviewers.  Not
worth a respin.

> value is not implemented, as this commit is meant to set the property
> to the correct type and avoid breaking JSON/QMP when the auto mode is
> introduced. A future patch will implement resolution of the 'auto'
> value to match the host SMMUv3 RIL support.
>
> Fixes: bd715ff5bda9 ("hw/arm/smmuv3-accel: Add a property to specify RIL support")
> Tested-by: Eric Auger <eric.auger@redhat.com>
> Signed-off-by: Nathan Chen <nathanc@nvidia.com>

Acked-by: Markus Armbruster <armbru@redhat.com>



^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v4 4/8] qdev: Add a SsidSizeMode property
  2026-03-18 18:49 ` [PATCH v4 4/8] qdev: Add a SsidSizeMode property Nathan Chen
@ 2026-03-19 12:02   ` Markus Armbruster
  2026-03-19 12:08   ` Markus Armbruster
  1 sibling, 0 replies; 35+ messages in thread
From: Markus Armbruster @ 2026-03-19 12:02 UTC (permalink / raw)
  To: Nathan Chen
  Cc: qemu-devel, qemu-arm, Eric Auger, Peter Maydell,
	Michael S . Tsirkin, Igor Mammedov, Ani Sinha, Shannon Zhao,
	Paolo Bonzini, Daniel P . Berrangé, Eric Blake,
	Shameer Kolothum, Matt Ochs, Nicolin Chen

Nathan Chen <nathanc@nvidia.com> writes:

> From: Nathan Chen <nathanc@nvidia.com>
>
> Introduce a new enum type property allowing to set a Substream ID size
> for HW-accelerated smmuv3. Values are auto and 0..20. The auto value
> allows SSID size property to be derived from host IOMMU capabilities.
> A value of 0 disables SubstreamID, while non-zero values specify the
> SSID size in bits.
>
> Reviewed-by: Eric Auger <eric.auger@redhat.com>
> Tested-by: Eric Auger <eric.auger@redhat.com>
> Signed-off-by: Nathan Chen <nathanc@nvidia.com>

[...]

> diff --git a/qapi/misc-arm.json b/qapi/misc-arm.json
> index f921d740f1..76ea0a09fa 100644
> --- a/qapi/misc-arm.json
> +++ b/qapi/misc-arm.json
> @@ -45,3 +45,19 @@
>  #                     { "version": 3, "emulated": false, "kernel": true } ] }
>  ##
>  { 'command': 'query-gic-capabilities', 'returns': ['GICCapability'] }
> +
> +##
> +# @SsidSizeMode:
> +#
> +# SMMUv3 SubstreamID size configuration mode.
> +#
> +# @auto: derive from host IOMMU capabilities
> +#
> +# Values 0-20: SSIDSIZE value in bits.  0 disables SubstreamID.
> +#
> +# Since: 11.0
> +##
> +{ 'enum': 'SsidSizeMode',
> +  'data': [ 'auto', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
> +            '10', '11', '12', '13', '14', '15', '16', '17', '18',
> +            '19', '20' ] } # order matters, see ssid_size_mode_auto()

As pointed out in review of the RFC, generated documentation will look
fairly bad, but we lack the means to do better right now.

> diff --git a/qapi/pragma.json b/qapi/pragma.json
> index 193bc39059..24aebbe8f5 100644
> --- a/qapi/pragma.json
> +++ b/qapi/pragma.json
> @@ -68,6 +68,7 @@
>          'S390CpuEntitlement',
>          'S390CpuPolarization',
>          'S390CpuState',
> +        'SsidSizeMode',
>          'String',
>          'StringWrapper',
>          'SysEmuTarget',

QAPI schema
Acked-by: Markus Armbruster <armbru@redhat.com>



^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v4 4/8] qdev: Add a SsidSizeMode property
  2026-03-18 18:49 ` [PATCH v4 4/8] qdev: Add a SsidSizeMode property Nathan Chen
  2026-03-19 12:02   ` Markus Armbruster
@ 2026-03-19 12:08   ` Markus Armbruster
  1 sibling, 0 replies; 35+ messages in thread
From: Markus Armbruster @ 2026-03-19 12:08 UTC (permalink / raw)
  To: Nathan Chen
  Cc: qemu-devel, qemu-arm, Eric Auger, Peter Maydell,
	Michael S . Tsirkin, Igor Mammedov, Ani Sinha, Shannon Zhao,
	Paolo Bonzini, Daniel P . Berrangé, Eric Blake,
	Shameer Kolothum, Matt Ochs, Nicolin Chen

Nathan Chen <nathanc@nvidia.com> writes:

> From: Nathan Chen <nathanc@nvidia.com>
>
> Introduce a new enum type property allowing to set a Substream ID size
> for HW-accelerated smmuv3. Values are auto and 0..20. The auto value
> allows SSID size property to be derived from host IOMMU capabilities.
> A value of 0 disables SubstreamID, while non-zero values specify the
> SSID size in bits.
>
> Reviewed-by: Eric Auger <eric.auger@redhat.com>
> Tested-by: Eric Auger <eric.auger@redhat.com>
> Signed-off-by: Nathan Chen <nathanc@nvidia.com>

[...]

> diff --git a/qapi/misc-arm.json b/qapi/misc-arm.json
> index f921d740f1..76ea0a09fa 100644
> --- a/qapi/misc-arm.json
> +++ b/qapi/misc-arm.json
> @@ -45,3 +45,19 @@
>  #                     { "version": 3, "emulated": false, "kernel": true } ] }
>  ##
>  { 'command': 'query-gic-capabilities', 'returns': ['GICCapability'] }
> +
> +##
> +# @SsidSizeMode:
> +#
> +# SMMUv3 SubstreamID size configuration mode.
> +#
> +# @auto: derive from host IOMMU capabilities
> +#
> +# Values 0-20: SSIDSIZE value in bits.  0 disables SubstreamID.
> +#
> +# Since: 11.0
> +##
> +{ 'enum': 'SsidSizeMode',
> +  'data': [ 'auto', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
> +            '10', '11', '12', '13', '14', '15', '16', '17', '18',
> +            '19', '20' ] } # order matters, see ssid_size_mode_auto()

Make that "see ssidsize_mode_to_value()".

[...]



^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v4 5/8] hw/arm/smmuv3-accel: Change SSIDSIZE property to SsidSizeMode
  2026-03-18 18:49 ` [PATCH v4 5/8] hw/arm/smmuv3-accel: Change SSIDSIZE property to SsidSizeMode Nathan Chen
  2026-03-19  8:35   ` Shameer Kolothum Thodi
  2026-03-19  9:48   ` Eric Auger
@ 2026-03-19 12:14   ` Markus Armbruster
  2026-03-23 17:28     ` Nathan Chen
  2 siblings, 1 reply; 35+ messages in thread
From: Markus Armbruster @ 2026-03-19 12:14 UTC (permalink / raw)
  To: Nathan Chen
  Cc: qemu-devel, qemu-arm, Eric Auger, Peter Maydell,
	Michael S . Tsirkin, Igor Mammedov, Ani Sinha, Shannon Zhao,
	Paolo Bonzini, Daniel P . Berrangé, Eric Blake,
	Markus Armbruster, Shameer Kolothum, Matt Ochs, Nicolin Chen

Subject line: please use the literal property name, for easier grepping.
I.e. something like

    hw/arm/smmuv3-accel: Change "ssidsize" property to SsidSizeMode

Same for several other patches.

Nathan Chen <nathanc@nvidia.com> writes:

> From: Nathan Chen <nathanc@nvidia.com>
>
> Change accel SMMUv3 SSIDSIZE property from uint8_t to SsidSizeMode.

Incompatible change; okay because property "ssidsize" is new in this
release.  Spelling out such things out in the commit message helps
reviewers.  Not worth a respin by itself.

Any particular reason this is called @ssidsize and not @ssid-size?

> The 'auto' value is not implemented, as this commit is meant to set the
> property to the correct type and avoid breaking JSON/QMP when the auto
> mode is introduced. A future patch will implement resolution of 'auto'
> value to match the host SMMUv3 SSIDSIZE value.
>
> Fixes: b8c6f8a69d27 ("hw/arm/smmuv3-accel: Make SubstreamID support configurable")
> Tested-by: Eric Auger <eric.auger@redhat.com>
> Signed-off-by: Nathan Chen <nathanc@nvidia.com>

Acked-by: Markus Armbruster <armbru@redhat.com>



^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v4 6/8] qdev: Add an OasMode property
  2026-03-18 18:49 ` [PATCH v4 6/8] qdev: Add an OasMode property Nathan Chen
@ 2026-03-19 12:16   ` Markus Armbruster
  0 siblings, 0 replies; 35+ messages in thread
From: Markus Armbruster @ 2026-03-19 12:16 UTC (permalink / raw)
  To: Nathan Chen
  Cc: qemu-devel, qemu-arm, Eric Auger, Peter Maydell,
	Michael S . Tsirkin, Igor Mammedov, Ani Sinha, Shannon Zhao,
	Paolo Bonzini, Daniel P . Berrangé, Eric Blake,
	Shameer Kolothum, Matt Ochs, Nicolin Chen

Subject line: this patch doesn't add a property, it adds a property
*type*.  Easy enough to fix.

Nathan Chen <nathanc@nvidia.com> writes:

> From: Nathan Chen <nathanc@nvidia.com>
>
> Introduce a new enum type property allowing to set an Output Address
> Size. Values are auto, 32, 36, 40, 42, 44, 48, 52, and 56, where a
> value of N specifies an N-bit OAS.
>
> Reviewed-by: Eric Auger <eric.auger@redhat.com>
> Tested-by: Eric Auger <eric.auger@redhat.com>
> Signed-off-by: Nathan Chen <nathanc@nvidia.com>

[...]

> diff --git a/qapi/misc-arm.json b/qapi/misc-arm.json
> index 76ea0a09fa..5dbb4add91 100644
> --- a/qapi/misc-arm.json
> +++ b/qapi/misc-arm.json
> @@ -61,3 +61,31 @@
>    'data': [ 'auto', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
>              '10', '11', '12', '13', '14', '15', '16', '17', '18',
>              '19', '20' ] } # order matters, see ssid_size_mode_auto()
> +
> +##
> +# @OasMode:
> +#
> +# SMMUv3 Output Address Size configuration mode.
> +#
> +# @auto: derive from host IOMMU capabilities
> +#
> +# @32: 32-bit output address size
> +#
> +# @36: 36-bit output address size
> +#
> +# @40: 40-bit output address size
> +#
> +# @42: 42-bit output address size
> +#
> +# @44: 44-bit output address size
> +#
> +# @48: 48-bit output address size
> +#
> +# @52: 52-bit output address size
> +#
> +# @56: 56-bit output address size
> +#
> +# Since: 11.0
> +##
> +{ 'enum': 'OasMode',
> +  'data': [ 'auto', '32', '36', '40', '42', '44', '48', '52', '56' ] }

QAPI schema
Acked-by: Markus Armbruster <armbru@redhat.com>



^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v4 7/8] hw/arm/smmuv3-accel: Change OAS property to OasMode
  2026-03-18 18:49 ` [PATCH v4 7/8] hw/arm/smmuv3-accel: Change OAS property to OasMode Nathan Chen
  2026-03-19  8:39   ` Shameer Kolothum Thodi
  2026-03-19  9:51   ` Eric Auger
@ 2026-03-19 12:20   ` Markus Armbruster
  2026-03-19 16:57     ` Nathan Chen
  2 siblings, 1 reply; 35+ messages in thread
From: Markus Armbruster @ 2026-03-19 12:20 UTC (permalink / raw)
  To: Nathan Chen
  Cc: qemu-devel, qemu-arm, Eric Auger, Peter Maydell,
	Michael S . Tsirkin, Igor Mammedov, Ani Sinha, Shannon Zhao,
	Paolo Bonzini, Daniel P . Berrangé, Eric Blake,
	Shameer Kolothum, Matt Ochs, Nicolin Chen

Nathan Chen <nathanc@nvidia.com> writes:

> From: Nathan Chen <nathanc@nvidia.com>
>
> Change accel SMMUv3 OAS property from uint8_t to OasMode. The

Incompatible change; okay because property "oas" is new in this
release.  Spelling out such things out in the commit message helps
reviewers.  Not worth a respin by itself.

> 'auto' value is not implemented, as this commit is meant to
> set the property to the correct type and avoid breaking JSON/QMP
> when the auto mode is introduced. A future patch will implement
> resolution of 'auto' value to match the host SMMUv3 OAS value.
>
> Fixes: a015ac990fd3 ("hw/arm/smmuv3-accel: Add property to specify OAS bits")
> Tested-by: Eric Auger <eric.auger@redhat.com>
> Signed-off-by: Nathan Chen <nathanc@nvidia.com>
> ---
>  hw/arm/smmuv3-accel.c          |  2 +-
>  hw/arm/smmuv3.c                | 16 ++++++++--------
>  include/hw/arm/smmuv3-common.h |  2 --
>  include/hw/arm/smmuv3.h        |  2 +-
>  4 files changed, 10 insertions(+), 12 deletions(-)
>
> diff --git a/hw/arm/smmuv3-accel.c b/hw/arm/smmuv3-accel.c
> index bc6cbfebc2..65c2f44880 100644
> --- a/hw/arm/smmuv3-accel.c
> +++ b/hw/arm/smmuv3-accel.c
> @@ -850,7 +850,7 @@ void smmuv3_accel_idr_override(SMMUv3State *s)
>      }
>  
>      /* Advertise 48-bit OAS in IDR5 when requested (default is 44 bits). */
> -    if (s->oas == SMMU_OAS_48BIT) {
> +    if (s->oas == OAS_MODE_48) {
>          s->idr[5] = FIELD_DP32(s->idr[5], IDR5, OAS, SMMU_IDR5_OAS_48);
>      }
>  
> diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c
> index 79018f8d66..c67819d6f2 100644
> --- a/hw/arm/smmuv3.c
> +++ b/hw/arm/smmuv3.c
> @@ -1984,6 +1984,10 @@ static bool smmu_validate_property(SMMUv3State *s, Error **errp)
>          error_setg(errp, "ssidsize auto mode is not supported");
>          return false;
>      }
> +    if (s->oas != OAS_MODE_44 && s->oas != OAS_MODE_48) {
> +        error_setg(errp, "OAS can only be set to 44 or 48 bits");
> +        return false;
> +    }

So, OasMode values other than 44 and 48 are currently useless.  Correct?

>  
>      if (!s->accel) {
>          if (s->ril == ON_OFF_AUTO_OFF) {
> @@ -1994,7 +1998,7 @@ static bool smmu_validate_property(SMMUv3State *s, Error **errp)
>              error_setg(errp, "ats can only be enabled if accel=on");
>              return false;
>          }
> -        if (s->oas != SMMU_OAS_44BIT) {
> +        if (s->oas > OAS_MODE_44) {
>              error_setg(errp, "OAS must be 44 bits when accel=off");
>              return false;
>          }
> @@ -2012,11 +2016,6 @@ static bool smmu_validate_property(SMMUv3State *s, Error **errp)
>          return false;
>      }
>  
> -    if (s->oas != SMMU_OAS_44BIT && s->oas != SMMU_OAS_48BIT) {
> -        error_setg(errp, "OAS can only be set to 44 or 48 bits");
> -        return false;
> -    }
> -
>      return true;
>  }
>  
> @@ -2143,7 +2142,7 @@ static const Property smmuv3_properties[] = {
>      /* RIL can be turned off for accel cases */
>      DEFINE_PROP_ON_OFF_AUTO("ril", SMMUv3State, ril, ON_OFF_AUTO_ON),
>      DEFINE_PROP_ON_OFF_AUTO("ats", SMMUv3State, ats, ON_OFF_AUTO_OFF),
> -    DEFINE_PROP_UINT8("oas", SMMUv3State, oas, 44),
> +    DEFINE_PROP_OAS_MODE("oas", SMMUv3State, oas, OAS_MODE_44),
>      DEFINE_PROP_SSIDSIZE_MODE("ssidsize", SMMUv3State, ssidsize,
>                                SSID_SIZE_MODE_0),
>  };
> @@ -2180,7 +2179,8 @@ static void smmuv3_class_init(ObjectClass *klass, const void *data)
>          "supported.");
>      object_class_property_set_description(klass, "oas",
>          "Specify Output Address Size (for accel=on). Supported values "
> -        "are 44 or 48 bits. Defaults to 44 bits");
> +        "are 44 or 48 bits. Defaults to 44 bits. oas=auto is not "
> +        "supported.");
>      object_class_property_set_description(klass, "ssidsize",
>          "Number of bits used to represent SubstreamIDs (SSIDs). "
>          "A value of N allows SSIDs in the range [0 .. 2^N - 1]. "
> diff --git a/include/hw/arm/smmuv3-common.h b/include/hw/arm/smmuv3-common.h
> index 7f0f992dfd..4609975edf 100644
> --- a/include/hw/arm/smmuv3-common.h
> +++ b/include/hw/arm/smmuv3-common.h
> @@ -342,8 +342,6 @@ REG32(IDR5,                0x14)
>       FIELD(IDR5, VAX,        10, 2);
>       FIELD(IDR5, STALL_MAX,  16, 16);
>  
> -#define SMMU_OAS_44BIT 44
> -#define SMMU_OAS_48BIT 48
>  #define SMMU_IDR5_OAS_44 4
>  #define SMMU_IDR5_OAS_48 5
>  
> diff --git a/include/hw/arm/smmuv3.h b/include/hw/arm/smmuv3.h
> index ddf472493d..82f18eb090 100644
> --- a/include/hw/arm/smmuv3.h
> +++ b/include/hw/arm/smmuv3.h
> @@ -72,7 +72,7 @@ struct SMMUv3State {
>      Error *migration_blocker;
>      OnOffAuto ril;
>      OnOffAuto ats;
> -    uint8_t oas;
> +    OasMode oas;
>      SsidSizeMode ssidsize;
>  };


Acked-by: Markus Armbruster <armbru@redhat.com>



^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v4 8/8] qemu-options.hx: Document arm-smmuv3 device's accel properties
  2026-03-18 18:49 ` [PATCH v4 8/8] qemu-options.hx: Document arm-smmuv3 device's accel properties Nathan Chen
@ 2026-03-19 12:21   ` Markus Armbruster
  2026-03-19 17:07     ` Nathan Chen
  0 siblings, 1 reply; 35+ messages in thread
From: Markus Armbruster @ 2026-03-19 12:21 UTC (permalink / raw)
  To: Nathan Chen
  Cc: qemu-devel, qemu-arm, Eric Auger, Peter Maydell,
	Michael S . Tsirkin, Igor Mammedov, Ani Sinha, Shannon Zhao,
	Paolo Bonzini, Daniel P . Berrangé, Eric Blake,
	Shameer Kolothum, Matt Ochs, Nicolin Chen

Nathan Chen <nathanc@nvidia.com> writes:

> From: Nathan Chen <nathanc@nvidia.com>
>
> Document arm-smmuv3 properties for setting HW-acceleration,
> Range Invalidation, and Address Translation Services support, as
> well as setting Output Address size and Substream ID size.
>
> Reviewed-by: Eric Auger <eric.auger@redhat.com>
> Tested-by: Eric Auger <eric.auger@redhat.com>
> Reviewed-by: Shameer Kolothum <skolothumtho@nvidia.com>
> Signed-off-by: Nathan Chen <nathanc@nvidia.com>
> ---
>  qemu-options.hx | 32 +++++++++++++++++++++++++++++++-
>  1 file changed, 31 insertions(+), 1 deletion(-)
>
> diff --git a/qemu-options.hx b/qemu-options.hx
> index 69e5a874c1..f8da35513a 100644
> --- a/qemu-options.hx
> +++ b/qemu-options.hx
> @@ -1279,13 +1279,43 @@ SRST
>      ``aw-bits=val`` (val between 32 and 64, default depends on machine)
>          This decides the address width of the IOVA address space.
>  
> -``-device arm-smmuv3,primary-bus=id``
> +``-device arm-smmuv3,primary-bus=id[,option=...]``
>      This is only supported by ``-machine virt`` (ARM).
>  
>      ``primary-bus=id``
>          Accepts either the default root complex (pcie.0) or a
>          pxb-pcie based root complex.
>  
> +    ``accel=on|off`` (default: off)
> +        Enables guest to leverage host SMMUv3 features for acceleration.
> +        Enabling accel configures the host SMMUv3 in nested mode to support
> +        vfio-pci passthrough.
> +
> +     The following options are available when accel=on.

What happens when you try to use them with accel=off?

> +     Note: 'auto' mode is not currently supported.
> +
> +    ``ril=on|off`` (default: on)
> +        Support for Range Invalidation, which allows the SMMUv3 driver to
> +        invalidate TLB entries for a range of IOVAs at once instead of issuing
> +        separate commands to invalidate each page. Must match with host SMMUv3
> +        Range Invalidation support.
> +
> +    ``ats=on|off`` (default: off)
> +        Support for Address Translation Services, which enables PCIe devices to
> +        cache address translations in their local TLB and reduce latency. Host
> +        SMMUv3 must support ATS in order to enable this feature for the vIOMMU.
> +
> +    ``oas=val`` (supported values are 44 and 48. default: 44)
> +        Sets the Output Address Size in bits. The value set here must be less
> +        than or equal to the host SMMUv3's supported OAS, so that the
> +        intermediate physical addresses (IPA) consumed by host SMMU for stage-2
> +        translation do not exceed the host's max supported IPA size.
> +
> +    ``ssidsize=val`` (val between 0 and 20. default: 0)
> +        Sets the Substream ID size in bits. When set to a non-zero value,
> +        PASID capability is advertised to the vIOMMU and accelerated use cases
> +        such as Shared Virtual Addressing (SVA) are supported.
> +
>  ``-device amd-iommu[,option=...]``
>      Enables emulation of an AMD-Vi I/O Memory Management Unit (IOMMU).
>      Only available with ``-machine q35``, it supports the following options:



^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v4 7/8] hw/arm/smmuv3-accel: Change OAS property to OasMode
  2026-03-19 12:20   ` Markus Armbruster
@ 2026-03-19 16:57     ` Nathan Chen
  2026-03-20  7:53       ` Markus Armbruster
  0 siblings, 1 reply; 35+ messages in thread
From: Nathan Chen @ 2026-03-19 16:57 UTC (permalink / raw)
  To: Markus Armbruster
  Cc: qemu-devel, qemu-arm, Eric Auger, Peter Maydell,
	Michael S . Tsirkin, Igor Mammedov, Ani Sinha, Shannon Zhao,
	Paolo Bonzini, Daniel P.Berrangé, Eric Blake,
	Shameer Kolothum, Matt Ochs, Nicolin Chen

[-- Attachment #1: Type: text/plain, Size: 2423 bytes --]


On 3/19/2026 5:20 AM, Markus Armbruster wrote:
>> From: Nathan Chen<nathanc@nvidia.com>
>>
>> Change accel SMMUv3 OAS property from uint8_t to OasMode. The
> Incompatible change; okay because property "oas" is new in this
> release.  Spelling out such things out in the commit message helps
> reviewers.  Not worth a respin by itself.
Ok, I will keep this in mind and mention this is an incompatible change 
for the next refresh.
>> 'auto' value is not implemented, as this commit is meant to
>> set the property to the correct type and avoid breaking JSON/QMP
>> when the auto mode is introduced. A future patch will implement
>> resolution of 'auto' value to match the host SMMUv3 OAS value.
>>
>> Fixes: a015ac990fd3 ("hw/arm/smmuv3-accel: Add property to specify OAS bits")
>> Tested-by: Eric Auger<eric.auger@redhat.com>
>> Signed-off-by: Nathan Chen<nathanc@nvidia.com>
>> ---
>>   hw/arm/smmuv3-accel.c          |  2 +-
>>   hw/arm/smmuv3.c                | 16 ++++++++--------
>>   include/hw/arm/smmuv3-common.h |  2 --
>>   include/hw/arm/smmuv3.h        |  2 +-
>>   4 files changed, 10 insertions(+), 12 deletions(-)
>>
>> diff --git a/hw/arm/smmuv3-accel.c b/hw/arm/smmuv3-accel.c
>> index bc6cbfebc2..65c2f44880 100644
>> --- a/hw/arm/smmuv3-accel.c
>> +++ b/hw/arm/smmuv3-accel.c
>> @@ -850,7 +850,7 @@ void smmuv3_accel_idr_override(SMMUv3State *s)
>>       }
>>   
>>       /* Advertise 48-bit OAS in IDR5 when requested (default is 44 bits). */
>> -    if (s->oas == SMMU_OAS_48BIT) {
>> +    if (s->oas == OAS_MODE_48) {
>>           s->idr[5] = FIELD_DP32(s->idr[5], IDR5, OAS, SMMU_IDR5_OAS_48);
>>       }
>>   
>> diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c
>> index 79018f8d66..c67819d6f2 100644
>> --- a/hw/arm/smmuv3.c
>> +++ b/hw/arm/smmuv3.c
>> @@ -1984,6 +1984,10 @@ static bool smmu_validate_property(SMMUv3State *s, Error **errp)
>>           error_setg(errp, "ssidsize auto mode is not supported");
>>           return false;
>>       }
>> +    if (s->oas != OAS_MODE_44 && s->oas != OAS_MODE_48) {
>> +        error_setg(errp, "OAS can only be set to 44 or 48 bits");
>> +        return false;
>> +    }
> So, OasMode values other than 44 and 48 are currently useless.  Correct?

Yes, in an earlier version we had only implemented auto, 44, and 48 for 
OasMode, but we included the other OasMode values according to the 
SMMUv3 spec after receiving feedback to do so.


Thanks,

Nathan

[-- Attachment #2: Type: text/html, Size: 3647 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v4 8/8] qemu-options.hx: Document arm-smmuv3 device's accel properties
  2026-03-19 12:21   ` Markus Armbruster
@ 2026-03-19 17:07     ` Nathan Chen
  0 siblings, 0 replies; 35+ messages in thread
From: Nathan Chen @ 2026-03-19 17:07 UTC (permalink / raw)
  To: Markus Armbruster
  Cc: qemu-devel, qemu-arm, Eric Auger, Peter Maydell,
	Michael S . Tsirkin, Igor Mammedov, Ani Sinha, Shannon Zhao,
	Paolo Bonzini, Daniel P.Berrangé, Eric Blake,
	Shameer Kolothum, Matt Ochs, Nicolin Chen



On 3/19/2026 5:21 AM, Markus Armbruster wrote:
> Nathan Chen<nathanc@nvidia.com> writes:
> 
>> From: Nathan Chen<nathanc@nvidia.com>
>>
>> Document arm-smmuv3 properties for setting HW-acceleration,
>> Range Invalidation, and Address Translation Services support, as
>> well as setting Output Address size and Substream ID size.
>>
>> Reviewed-by: Eric Auger<eric.auger@redhat.com>
>> Tested-by: Eric Auger<eric.auger@redhat.com>
>> Reviewed-by: Shameer Kolothum<skolothumtho@nvidia.com>
>> Signed-off-by: Nathan Chen<nathanc@nvidia.com>
>> ---
>>   qemu-options.hx | 32 +++++++++++++++++++++++++++++++-
>>   1 file changed, 31 insertions(+), 1 deletion(-)
>>
>> diff --git a/qemu-options.hx b/qemu-options.hx
>> index 69e5a874c1..f8da35513a 100644
>> --- a/qemu-options.hx
>> +++ b/qemu-options.hx
>> @@ -1279,13 +1279,43 @@ SRST
>>       ``aw-bits=val`` (val between 32 and 64, default depends on machine)
>>           This decides the address width of the IOVA address space.
>>   
>> -``-device arm-smmuv3,primary-bus=id``
>> +``-device arm-smmuv3,primary-bus=id[,option=...]``
>>       This is only supported by ``-machine virt`` (ARM).
>>   
>>       ``primary-bus=id``
>>           Accepts either the default root complex (pcie.0) or a
>>           pxb-pcie based root complex.
>>   
>> +    ``accel=on|off`` (default: off)
>> +        Enables guest to leverage host SMMUv3 features for acceleration.
>> +        Enabling accel configures the host SMMUv3 in nested mode to support
>> +        vfio-pci passthrough.
>> +
>> +     The following options are available when accel=on.
> What happens when you try to use them with accel=off?
QEMU will error out and prevent VM boot if accel=off while trying to set 
these properties to a value different from the default.

For instance:
qemu-system-aarch64: -device 
arm-smmuv3,primary-bus=pcie.1,id=smmuv3.1,accel=off,ril=on,ssidsize=20,oas=48,ats=on: 
ats can only be enabled if accel=on

Thanks,
Nathan


^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v4 7/8] hw/arm/smmuv3-accel: Change OAS property to OasMode
  2026-03-19 16:57     ` Nathan Chen
@ 2026-03-20  7:53       ` Markus Armbruster
  2026-03-23 17:47         ` Nathan Chen
  0 siblings, 1 reply; 35+ messages in thread
From: Markus Armbruster @ 2026-03-20  7:53 UTC (permalink / raw)
  To: Nathan Chen
  Cc: qemu-devel, qemu-arm, Eric Auger, Peter Maydell,
	Michael S . Tsirkin, Igor Mammedov, Ani Sinha, Shannon Zhao,
	Paolo Bonzini, Daniel P.Berrangé, Eric Blake,
	Shameer Kolothum, Matt Ochs, Nicolin Chen

Nathan Chen <nathanc@nvidia.com> writes:

> On 3/19/2026 5:20 AM, Markus Armbruster wrote:

[...]

>>> diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c
>>> index 79018f8d66..c67819d6f2 100644
>>> --- a/hw/arm/smmuv3.c
>>> +++ b/hw/arm/smmuv3.c
>>> @@ -1984,6 +1984,10 @@ static bool smmu_validate_property(SMMUv3State *s, Error **errp)
>>>           error_setg(errp, "ssidsize auto mode is not supported");
>>>           return false;
>>>       }
>>> +    if (s->oas != OAS_MODE_44 && s->oas != OAS_MODE_48) {
>>> +        error_setg(errp, "OAS can only be set to 44 or 48 bits");
>>> +        return false;
>>> +    }
>>
>> So, OasMode values other than 44 and 48 are currently useless.  Correct?
>
> Yes, in an earlier version we had only implemented auto, 44, and 48 for OasMode, but we included the other OasMode values according to the SMMUv3 spec after receiving feedback to do so.

I'm not sure that's a good idea.  Not an objection, mind.  I'm just
giving you something to consider.

If we define exactly the values that work, query-qmp-schema can tell
management applications which values work.  Whether that's useful I
can't say.

It falls apart as soon as different devices implement different values.
Do we expect that to happen?

If we stick to defining all values, maybe rephrase the error message to
express it's an implementation restriction?  Entirely up to you.



^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v4 5/8] hw/arm/smmuv3-accel: Change SSIDSIZE property to SsidSizeMode
  2026-03-19 12:14   ` Markus Armbruster
@ 2026-03-23 17:28     ` Nathan Chen
  2026-03-23 17:41       ` Shameer Kolothum Thodi
  2026-03-23 17:41       ` Eric Auger
  0 siblings, 2 replies; 35+ messages in thread
From: Nathan Chen @ 2026-03-23 17:28 UTC (permalink / raw)
  To: Markus Armbruster
  Cc: qemu-devel, qemu-arm, Eric Auger, Peter Maydell,
	Michael S . Tsirkin, Igor Mammedov, Ani Sinha, Shannon Zhao,
	Paolo Bonzini, Daniel P.Berrangé, Eric Blake,
	Shameer Kolothum, Matt Ochs, Nicolin Chen



On 3/19/2026 5:14 AM, Markus Armbruster wrote:
> Subject line: please use the literal property name, for easier grepping.
> I.e. something like
> 
>      hw/arm/smmuv3-accel: Change "ssidsize" property to SsidSizeMode
> 
> Same for several other patches.
> 
Yes that would be easier for grepping - I will change it to use the 
literal property name in a respin today.

> Nathan Chen<nathanc@nvidia.com> writes:
> 
>> From: Nathan Chen<nathanc@nvidia.com>
>>
>> Change accel SMMUv3 SSIDSIZE property from uint8_t to SsidSizeMode.
> Incompatible change; okay because property "ssidsize" is new in this
> release.  Spelling out such things out in the commit message helps
> reviewers.  Not worth a respin by itself.
> 
> Any particular reason this is called @ssidsize and not @ssid-size?

I'm not sure there's a particular reason - this property was newly 
introduced in the accel SMMUv3 series [0]. Should we include a patch to 
change it to @ssid-size to match the format of other properties?

[0] 
https://lore.kernel.org/all/20260126104342.253965-38-skolothumtho@nvidia.com/

Thanks,
Nathan


^ permalink raw reply	[flat|nested] 35+ messages in thread

* RE: [PATCH v4 5/8] hw/arm/smmuv3-accel: Change SSIDSIZE property to SsidSizeMode
  2026-03-23 17:28     ` Nathan Chen
@ 2026-03-23 17:41       ` Shameer Kolothum Thodi
  2026-03-24  5:39         ` Markus Armbruster
  2026-03-23 17:41       ` Eric Auger
  1 sibling, 1 reply; 35+ messages in thread
From: Shameer Kolothum Thodi @ 2026-03-23 17:41 UTC (permalink / raw)
  To: Nathan Chen, Markus Armbruster
  Cc: qemu-devel@nongnu.org, qemu-arm@nongnu.org, Eric Auger,
	Peter Maydell, Michael S . Tsirkin, Igor Mammedov, Ani Sinha,
	Shannon Zhao, Paolo Bonzini, Daniel P.Berrangé, Eric Blake,
	Matt Ochs, Nicolin Chen



> -----Original Message-----
> From: Nathan Chen <nathanc@nvidia.com>
> Sent: 23 March 2026 17:29
> To: Markus Armbruster <armbru@redhat.com>
> Cc: qemu-devel@nongnu.org; qemu-arm@nongnu.org; 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>; Shameer Kolothum Thodi
> <skolothumtho@nvidia.com>; Matt Ochs <mochs@nvidia.com>; Nicolin Chen
> <nicolinc@nvidia.com>
> Subject: Re: [PATCH v4 5/8] hw/arm/smmuv3-accel: Change SSIDSIZE property
> to SsidSizeMode
> 
> 
> 
> On 3/19/2026 5:14 AM, Markus Armbruster wrote:
> > Subject line: please use the literal property name, for easier grepping.
> > I.e. something like
> >
> >      hw/arm/smmuv3-accel: Change "ssidsize" property to SsidSizeMode
> >
> > Same for several other patches.
> >
> Yes that would be easier for grepping - I will change it to use the
> literal property name in a respin today.
> 
> > Nathan Chen<nathanc@nvidia.com> writes:
> >
> >> From: Nathan Chen<nathanc@nvidia.com>
> >>
> >> Change accel SMMUv3 SSIDSIZE property from uint8_t to SsidSizeMode.
> > Incompatible change; okay because property "ssidsize" is new in this
> > release.  Spelling out such things out in the commit message helps
> > reviewers.  Not worth a respin by itself.
> >
> > Any particular reason this is called @ssidsize and not @ssid-size?
> 
> I'm not sure there's a particular reason - this property was newly
> introduced in the accel SMMUv3 series [0]. Should we include a patch to
> change it to @ssid-size to match the format of other properties?

I don't think we should as that name was selected to match the SMMUv3
IDR1 register filed name in the SMMUv3 specification.

Thanks,
Shameer


^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v4 5/8] hw/arm/smmuv3-accel: Change SSIDSIZE property to SsidSizeMode
  2026-03-23 17:28     ` Nathan Chen
  2026-03-23 17:41       ` Shameer Kolothum Thodi
@ 2026-03-23 17:41       ` Eric Auger
  1 sibling, 0 replies; 35+ messages in thread
From: Eric Auger @ 2026-03-23 17:41 UTC (permalink / raw)
  To: Nathan Chen, Markus Armbruster
  Cc: qemu-devel, qemu-arm, Peter Maydell, Michael S . Tsirkin,
	Igor Mammedov, Ani Sinha, Shannon Zhao, Paolo Bonzini,
	Daniel P.Berrangé, Eric Blake, Shameer Kolothum, Matt Ochs,
	Nicolin Chen



On 3/23/26 6:28 PM, Nathan Chen wrote:
>
>
> On 3/19/2026 5:14 AM, Markus Armbruster wrote:
>> Subject line: please use the literal property name, for easier grepping.
>> I.e. something like
>>
>>      hw/arm/smmuv3-accel: Change "ssidsize" property to SsidSizeMode
>>
>> Same for several other patches.
>>
> Yes that would be easier for grepping - I will change it to use the
> literal property name in a respin today.
>
>> Nathan Chen<nathanc@nvidia.com> writes:
>>
>>> From: Nathan Chen<nathanc@nvidia.com>
>>>
>>> Change accel SMMUv3 SSIDSIZE property from uint8_t to SsidSizeMode.
>> Incompatible change; okay because property "ssidsize" is new in this
>> release.  Spelling out such things out in the commit message helps
>> reviewers.  Not worth a respin by itself.
>>
>> Any particular reason this is called @ssidsize and not @ssid-size?
>
> I'm not sure there's a particular reason - this property was newly
> introduced in the accel SMMUv3 series [0]. Should we include a patch
> to change it to @ssid-size to match the format of other properties?
>
> [0]
> https://lore.kernel.org/all/20260126104342.253965-38-skolothumtho@nvidia.com/ 

ssidsize is the terminology used in the SMMUv3 spec. So I would prefer
we stick to it

Thanks

Eric
>
> Thanks,
> Nathan
>



^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v4 7/8] hw/arm/smmuv3-accel: Change OAS property to OasMode
  2026-03-20  7:53       ` Markus Armbruster
@ 2026-03-23 17:47         ` Nathan Chen
  0 siblings, 0 replies; 35+ messages in thread
From: Nathan Chen @ 2026-03-23 17:47 UTC (permalink / raw)
  To: Markus Armbruster
  Cc: qemu-devel, qemu-arm, Eric Auger, Peter Maydell,
	Michael S . Tsirkin, Igor Mammedov, Ani Sinha, Shannon Zhao,
	Paolo Bonzini, Daniel P.Berrangé, Eric Blake,
	Shameer Kolothum, Matt Ochs, Nicolin Chen



On 3/20/2026 12:53 AM, Markus Armbruster wrote:
> Nathan Chen<nathanc@nvidia.com> writes:
> 
>> On 3/19/2026 5:20 AM, Markus Armbruster wrote:
> [...]
> 
>>>> diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c
>>>> index 79018f8d66..c67819d6f2 100644
>>>> --- a/hw/arm/smmuv3.c
>>>> +++ b/hw/arm/smmuv3.c
>>>> @@ -1984,6 +1984,10 @@ static bool smmu_validate_property(SMMUv3State *s, Error **errp)
>>>>            error_setg(errp, "ssidsize auto mode is not supported");
>>>>            return false;
>>>>        }
>>>> +    if (s->oas != OAS_MODE_44 && s->oas != OAS_MODE_48) {
>>>> +        error_setg(errp, "OAS can only be set to 44 or 48 bits");
>>>> +        return false;
>>>> +    }
>>> So, OasMode values other than 44 and 48 are currently useless.  Correct?
>> Yes, in an earlier version we had only implemented auto, 44, and 48 for OasMode, but we included the other OasMode values according to the SMMUv3 spec after receiving feedback to do so.
> I'm not sure that's a good idea.  Not an objection, mind.  I'm just
> giving you something to consider.
> 
> If we define exactly the values that work, query-qmp-schema can tell
> management applications which values work.  Whether that's useful I
> can't say.
> 
> It falls apart as soon as different devices implement different values.
> Do we expect that to happen?
> 
> If we stick to defining all values, maybe rephrase the error message to
> express it's an implementation restriction?  Entirely up to you.

Thanks for the feedback, I agree that we should update the validation 
error to state clearly that only 44- and 48-bit OAS modes are supported 
by this implementation. If other values are implemented we’ll document 
it in the device docs and adjust validation and the error message 
accordingly.

Thanks,
Nathan



^ permalink raw reply	[flat|nested] 35+ messages in thread

* Re: [PATCH v4 5/8] hw/arm/smmuv3-accel: Change SSIDSIZE property to SsidSizeMode
  2026-03-23 17:41       ` Shameer Kolothum Thodi
@ 2026-03-24  5:39         ` Markus Armbruster
  0 siblings, 0 replies; 35+ messages in thread
From: Markus Armbruster @ 2026-03-24  5:39 UTC (permalink / raw)
  To: Shameer Kolothum Thodi
  Cc: Nathan Chen, qemu-devel@nongnu.org, qemu-arm@nongnu.org,
	Eric Auger, Peter Maydell, Michael S . Tsirkin, Igor Mammedov,
	Ani Sinha, Shannon Zhao, Paolo Bonzini, Daniel P.Berrangé,
	Eric Blake, Matt Ochs, Nicolin Chen

Shameer Kolothum Thodi <skolothumtho@nvidia.com> writes:

>> On 3/19/2026 5:14 AM, Markus Armbruster wrote:

[...]

>> > Any particular reason this is called @ssidsize and not @ssid-size?
>> 
>> I'm not sure there's a particular reason - this property was newly
>> introduced in the accel SMMUv3 series [0]. Should we include a patch to
>> change it to @ssid-size to match the format of other properties?

Separating words improves legibility.  docs/devel/qapi-code-gen.rst
section "Naming rules and reserved names":

    Command names, member names within a type, and feature names should
    be all lower case with words separated by a hyphen.

However, we have a compelling reason for @ssidsize:

> I don't think we should as that name was selected to match the SMMUv3
> IDR1 register filed name in the SMMUv3 specification.

Thanks!



^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2026-03-24  5:40 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-18 18:48 [PATCH for-11.0 v4 0/8] hw/arm/smmuv3-accel: Support AUTO properties Nathan Chen
2026-03-18 18:49 ` [PATCH v4 1/8] hw/arm/smmuv3-accel: Check ATS compatibility between host and guest Nathan Chen
2026-03-18 18:49 ` [PATCH v4 2/8] hw/arm/smmuv3-accel: Change ATS property to OnOffAuto Nathan Chen
2026-03-19  8:10   ` Shameer Kolothum Thodi
2026-03-19  9:35   ` Eric Auger
2026-03-19 11:54   ` Markus Armbruster
2026-03-18 18:49 ` [PATCH v4 3/8] hw/arm/smmuv3-accel: Change RIL " Nathan Chen
2026-03-19  8:12   ` Shameer Kolothum Thodi
2026-03-19  9:37   ` Eric Auger
2026-03-19 11:55   ` Markus Armbruster
2026-03-18 18:49 ` [PATCH v4 4/8] qdev: Add a SsidSizeMode property Nathan Chen
2026-03-19 12:02   ` Markus Armbruster
2026-03-19 12:08   ` Markus Armbruster
2026-03-18 18:49 ` [PATCH v4 5/8] hw/arm/smmuv3-accel: Change SSIDSIZE property to SsidSizeMode Nathan Chen
2026-03-19  8:35   ` Shameer Kolothum Thodi
2026-03-19  9:48   ` Eric Auger
2026-03-19 12:14   ` Markus Armbruster
2026-03-23 17:28     ` Nathan Chen
2026-03-23 17:41       ` Shameer Kolothum Thodi
2026-03-24  5:39         ` Markus Armbruster
2026-03-23 17:41       ` Eric Auger
2026-03-18 18:49 ` [PATCH v4 6/8] qdev: Add an OasMode property Nathan Chen
2026-03-19 12:16   ` Markus Armbruster
2026-03-18 18:49 ` [PATCH v4 7/8] hw/arm/smmuv3-accel: Change OAS property to OasMode Nathan Chen
2026-03-19  8:39   ` Shameer Kolothum Thodi
2026-03-19  9:51   ` Eric Auger
2026-03-19 12:20   ` Markus Armbruster
2026-03-19 16:57     ` Nathan Chen
2026-03-20  7:53       ` Markus Armbruster
2026-03-23 17:47         ` Nathan Chen
2026-03-18 18:49 ` [PATCH v4 8/8] qemu-options.hx: Document arm-smmuv3 device's accel properties Nathan Chen
2026-03-19 12:21   ` Markus Armbruster
2026-03-19 17:07     ` Nathan Chen
2026-03-19 10:01 ` [PATCH for-11.0 v4 0/8] hw/arm/smmuv3-accel: Support AUTO properties Eric Auger
2026-03-19 10:15 ` Shameer Kolothum Thodi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox