All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nathan Chen <nathanc@nvidia.com>
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>,
	"Eduardo Habkost" <eduardo@habkost.net>,
	"Eric Blake" <eblake@redhat.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Shameer Kolothum" <skolothumtho@nvidia.com>,
	"Nicolin Chen" <nicolinc@nvidia.com>,
	"Matt Ochs" <mochs@nvidia.com>,
	"Nathan Chen" <nathanc@nvidia.com>
Subject: [PATCH v2 7/8] hw/arm/smmuv3-accel: Change OAS property to OasMode
Date: Thu, 12 Mar 2026 14:03:26 -0700	[thread overview]
Message-ID: <20260312210328.2016191-8-nathanc@nvidia.com> (raw)
In-Reply-To: <20260312210328.2016191-1-nathanc@nvidia.com>

From: Nathan Chen <nathanc@nvidia.com>

Change accel SMMUv3 OAS property from uint8_t to OasMode. Setting
'auto' will use the default value of 44 set in smmuv3_init_id_regs().
A future patch will implement resolution of 'auto' value to match
the host SMMUv3 OAS value.

Signed-off-by: Nathan Chen <nathanc@nvidia.com>
---
 hw/arm/smmuv3-accel.c   | 2 +-
 hw/arm/smmuv3.c         | 9 +++++----
 include/hw/arm/smmuv3.h | 2 +-
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/hw/arm/smmuv3-accel.c b/hw/arm/smmuv3-accel.c
index ab037df7ac..5073f74b8b 100644
--- a/hw/arm/smmuv3-accel.c
+++ b/hw/arm/smmuv3-accel.c
@@ -849,7 +849,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 8b0121c0ed..9faa9c8dfb 100644
--- a/hw/arm/smmuv3.c
+++ b/hw/arm/smmuv3.c
@@ -1981,7 +1981,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;
         }
@@ -1999,8 +1999,9 @@ 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");
+    if (s->oas != OAS_MODE_AUTO && s->oas != OAS_MODE_44 &&
+        s->oas != OAS_MODE_48) {
+        error_setg(errp, "OAS can only be set to auto, 44 bits, or 48 bits");
         return false;
     }
 
@@ -2130,7 +2131,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),
 };
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



  parent reply	other threads:[~2026-03-12 21:05 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-12 21:03 [PATCH v2 0/8] hw/arm/smmuv3-accel: Support AUTO properties Nathan Chen
2026-03-12 21:03 ` [PATCH v2 1/8] hw/arm/smmuv3-accel: Check ATS compatibility between host and guest Nathan Chen
2026-03-16  7:32   ` Eric Auger
2026-03-17 16:11     ` Nathan Chen
2026-03-12 21:03 ` [PATCH v2 2/8] hw/arm/smmuv3-accel: Change ATS property to OnOffAuto Nathan Chen
2026-03-16  7:38   ` Eric Auger
2026-03-17 16:12     ` Nathan Chen
2026-03-16  7:40   ` Eric Auger
2026-03-16  8:48   ` Shameer Kolothum Thodi
2026-03-17 16:18     ` Nathan Chen
2026-03-12 21:03 ` [PATCH v2 3/8] hw/arm/smmuv3-accel: Change RIL " Nathan Chen
2026-03-16  7:41   ` Eric Auger
2026-03-16  8:50   ` Shameer Kolothum Thodi
2026-03-17 16:18     ` Nathan Chen
2026-03-12 21:03 ` [PATCH v2 4/8] qdev: Add a SsidSizeMode property Nathan Chen
2026-03-16  7:46   ` Eric Auger
2026-03-12 21:03 ` [PATCH v2 5/8] hw/arm/smmuv3-accel: Change SSIDSIZE property to SsidSizeMode Nathan Chen
2026-03-16  7:50   ` Eric Auger
2026-03-17 16:15     ` Nathan Chen
2026-03-16  8:56   ` Shameer Kolothum Thodi
2026-03-17 16:20     ` Nathan Chen
2026-03-12 21:03 ` [PATCH v2 6/8] qdev: Add an OasMode property Nathan Chen
2026-03-16  7:52   ` Eric Auger
2026-03-12 21:03 ` Nathan Chen [this message]
2026-03-16  7:55   ` [PATCH v2 7/8] hw/arm/smmuv3-accel: Change OAS property to OasMode Eric Auger
2026-03-12 21:03 ` [PATCH v2 8/8] qemu-options.hx: Document arm-smmuv3 device's accel properties Nathan Chen
2026-03-16  8:00   ` Eric Auger
2026-03-16  8:27   ` Shameer Kolothum Thodi
2026-03-17 16:17     ` Nathan Chen
2026-03-16  8:08 ` [PATCH v2 0/8] hw/arm/smmuv3-accel: Support AUTO properties Eric Auger
2026-03-16 10:05   ` Peter Maydell
2026-03-17 16:21     ` Nathan Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260312210328.2016191-8-nathanc@nvidia.com \
    --to=nathanc@nvidia.com \
    --cc=anisinha@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=eblake@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=eric.auger@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=mochs@nvidia.com \
    --cc=mst@redhat.com \
    --cc=nicolinc@nvidia.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=shannon.zhaosl@gmail.com \
    --cc=skolothumtho@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.