From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Subject: [PULL 10/11] hw/arm/smmuv3-accel: Change "oas" property type to OasMode
Date: Tue, 24 Mar 2026 15:11:10 +0000 [thread overview]
Message-ID: <20260324151111.237411-11-peter.maydell@linaro.org> (raw)
In-Reply-To: <20260324151111.237411-1-peter.maydell@linaro.org>
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.
The conversion of the "oas" property type to OnOffAuto is an
incompatible change for JSON/QMP when a uint8_t value is expected for
"oas", but this property is new in 11.0 and this patch is
submitted as a fix to the property type.
Fixes: a015ac990fd3 ("hw/arm/smmuv3-accel: Add property to specify OAS bits")
Tested-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Shameer Kolothum <skolothumtho@nvidia.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Tested-by: Shameer Kolothum <skolothumtho@nvidia.com>
Acked-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Nathan Chen <nathanc@nvidia.com>
Message-id: 20260323182454.1416110-8-nathanc@nvidia.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
hw/arm/smmuv3-accel.c | 2 +-
hw/arm/smmuv3.c | 17 +++++++++--------
include/hw/arm/smmuv3-common.h | 2 --
include/hw/arm/smmuv3.h | 2 +-
4 files changed, 11 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..7fead1c3cf 100644
--- a/hw/arm/smmuv3.c
+++ b/hw/arm/smmuv3.c
@@ -1984,6 +1984,11 @@ 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, "QEMU SMMUv3 model only implements 44 and 48 bit"
+ "OAS; other OasMode values are not supported");
+ return false;
+ }
if (!s->accel) {
if (s->ril == ON_OFF_AUTO_OFF) {
@@ -1994,7 +1999,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 +2017,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 +2143,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 +2180,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
next prev parent reply other threads:[~2026-03-24 15:12 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-24 15:11 [PULL 00/11] target-arm queue Peter Maydell
2026-03-24 15:11 ` [PULL 01/11] target/arm: fix s2prot not set for two-stage PMSA translations Peter Maydell
2026-03-24 15:11 ` [PULL 02/11] linux-user/i386/signal.c: Correct definition of target_fpstate_32 Peter Maydell
2026-03-24 15:11 ` [PULL 03/11] hw/dma/pl080: Fix transfer logic in PL080 Peter Maydell
2026-03-24 15:11 ` [PULL 04/11] hw/arm/smmuv3-accel: Check ATS compatibility between host and guest Peter Maydell
2026-03-24 15:11 ` [PULL 05/11] hw/arm/smmuv3-accel: Change "ats" property type to OnOffAuto Peter Maydell
2026-03-24 15:11 ` [PULL 06/11] hw/arm/smmuv3-accel: Change "ril" " Peter Maydell
2026-03-24 15:11 ` [PULL 07/11] qdev: Add a SsidSizeMode property type Peter Maydell
2026-03-24 15:11 ` [PULL 08/11] hw/arm/smmuv3-accel: Change "ssidsize" property type to SsidSizeMode Peter Maydell
2026-03-24 15:11 ` [PULL 09/11] qdev: Add an OasMode property type Peter Maydell
2026-03-24 15:11 ` Peter Maydell [this message]
2026-03-24 15:11 ` [PULL 11/11] qemu-options.hx: Document arm-smmuv3 device's accel properties Peter Maydell
2026-03-24 18:35 ` [PULL 00/11] target-arm queue Peter Maydell
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=20260324151111.237411-11-peter.maydell@linaro.org \
--to=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox