@samitouri / QOSamiQemu / commits / 1a76cc3933

hw/arm/smmuv3-accel: Change "ril" property type to OnOffAuto

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. The conversion of the RIL property type to OnOffAuto is an incompatible change for JSON/QMP when a bool value is expected for "ril", but the "ril" property is new in 11.0 and this patch is submitted as a fix to the property type. Fixes: bd715ff5bda9 ("hw/arm/smmuv3-accel: Add a property to specify RIL support") Tested-by: Eric Auger <eric.auger@redhat.com> Reviewed-by: Shameer Kolothum <skolothumtho@nvidia.com> Tested-by: Shameer Kolothum <skolothumtho@nvidia.com> Reviewed-by: Eric Auger <eric.auger@redhat.com> Acked-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Nathan Chen <nathanc@nvidia.com> Message-id: 20260323182454.1416110-4-nathanc@nvidia.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Nathan Chen committed Mar 24, 2026 at 14:02 UTC 1a76cc39333c7870ee34075c2295a28e53d1b1ba
3 files changed +13 -6
hw/arm/smmuv3-accel.c
+4 -2
@@ -823,8 +823,10 @@ void smmuv3_accel_idr_override(SMMUv3State *s)
823 return;
824 }
825
826 - /* By default QEMU SMMUv3 has RIL. Update IDR3 if user has disabled it */
827 - s->idr[3] = FIELD_DP32(s->idr[3], IDR3, RIL, s->ril);
826 + /* Only override RIL if user explicitly set OFF */
827 + if (s->ril == ON_OFF_AUTO_OFF) {
828 + s->idr[3] = FIELD_DP32(s->idr[3], IDR3, RIL, 0);
829 + }
830
831 /* QEMU SMMUv3 has no ATS. Advertise ATS if opt-in by property */
832 if (s->ats == ON_OFF_AUTO_ON) {
hw/arm/smmuv3.c
+8 -3
@@ -1975,9 +1975,13 @@ static bool smmu_validate_property(SMMUv3State *s, Error **errp)
1975 error_setg(errp, "ats auto mode is not supported");
1976 return false;
1977 }
1978 + if (s->ril == ON_OFF_AUTO_AUTO) {
1979 + error_setg(errp, "ril auto mode is not supported");
1980 + return false;
1981 + }
1982
1983 if (!s->accel) {
1980 - if (!s->ril) {
1984 + if (s->ril == ON_OFF_AUTO_OFF) {
1985 error_setg(errp, "ril can only be disabled if accel=on");
1986 return false;
1987 }
@@ -2137,7 +2141,7 @@ static const Property smmuv3_properties[] = {
2141 /* GPA of MSI doorbell, for SMMUv3 accel use. */
2142 DEFINE_PROP_UINT64("msi-gpa", SMMUv3State, msi_gpa, 0),
2143 /* RIL can be turned off for accel cases */
2140 - DEFINE_PROP_BOOL("ril", SMMUv3State, ril, true),
2144 + DEFINE_PROP_ON_OFF_AUTO("ril", SMMUv3State, ril, ON_OFF_AUTO_ON),
2145 DEFINE_PROP_ON_OFF_AUTO("ats", SMMUv3State, ats, ON_OFF_AUTO_OFF),
2146 DEFINE_PROP_UINT8("oas", SMMUv3State, oas, 44),
2147 DEFINE_PROP_UINT8("ssidsize", SMMUv3State, ssidsize, 0),
@@ -2167,7 +2171,8 @@ static void smmuv3_class_init(ObjectClass *klass, const void *data)
2171 "Enable SMMUv3 accelerator support. Allows host SMMUv3 to be "
2172 "configured in nested mode for vfio-pci dev assignment");
2173 object_class_property_set_description(klass, "ril",
2170 - "Disable range invalidation support (for accel=on)");
2174 + "Disable range invalidation support (for accel=on). ril=auto "
2175 + "is not supported.");
2176 object_class_property_set_description(klass, "ats",
2177 "Enable/disable ATS support (for accel=on). Please ensure host "
2178 "platform has ATS support before enabling this. ats=auto is not "
include/hw/arm/smmuv3.h
+1 -1
@@ -69,7 +69,7 @@ struct SMMUv3State {
69 struct SMMUv3AccelState *s_accel;
70 uint64_t msi_gpa;
71 Error *migration_blocker;
72 - bool ril;
72 + OnOffAuto ril;
73 OnOffAuto ats;
74 uint8_t oas;
75 uint8_t ssidsize;