@samitouri / QOSamiQemu / commits / 8e0a2aa777

hw/arm/smmuv3-accel: Implement "auto" value for "ril"

Allow accelerated SMMUv3 Range Invalidation support property to be derived from host IOMMU capabilities. Derive host values using IOMMU_GET_HW_INFO, retrieving RIL capability from IDR3. Reviewed-by: Eric Auger <eric.auger@redhat.com> Reviewed-by: Shameer Kolothum <skolothumtho@nvidia.com> Signed-off-by: Nathan Chen <nathanc@nvidia.com> Tested-by: Eric Auger <eric.auger@redhat.com> Message-id: 20260608174900.2227340-6-nathanc@nvidia.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Nathan Chen committed Jun 8, 2026 at 10:48 UTC 8e0a2aa777f69def65aa382fc66dabf9cf53b8f0
2 files changed +11 -7
hw/arm/smmuv3-accel.c
+7 -1
@@ -58,6 +58,11 @@ static void smmuv3_accel_auto_finalise(SMMUv3State *s,
58 FIELD_EX32(info->idr[0], IDR0, ATS));
59 }
60
61 + if (s->ril == ON_OFF_AUTO_AUTO) {
62 + s->idr[3] = FIELD_DP32(s->idr[3], IDR3, RIL,
63 + FIELD_EX32(info->idr[3], IDR3, RIL));
64 + }
65 +
66 accel->auto_finalised = true;
67 }
68
@@ -966,7 +971,8 @@ bool smmuv3_accel_init(SMMUv3State *s, Error **errp)
971 bs->iommu_ops = &smmuv3_accel_ops;
972 smmuv3_accel_as_init(s);
973
969 - if (s->ats == ON_OFF_AUTO_AUTO) {
974 + if (s->ats == ON_OFF_AUTO_AUTO ||
975 + s->ril == ON_OFF_AUTO_AUTO) {
976 s->s_accel->auto_mode = true;
977 }
978
hw/arm/smmuv3.c
+4 -6
@@ -1965,10 +1965,6 @@ static void smmu_reset_exit(Object *obj, ResetType type)
1965
1966 static bool smmu_validate_property(SMMUv3State *s, Error **errp)
1967 {
1968 - if (s->ril == ON_OFF_AUTO_AUTO) {
1969 - error_setg(errp, "ril auto mode is not supported");
1970 - return false;
1971 - }
1968 if (s->ssidsize == SSID_SIZE_MODE_AUTO) {
1969 error_setg(errp, "ssidsize auto mode is not supported");
1970 return false;
@@ -2165,8 +2161,10 @@ static void smmuv3_class_init(ObjectClass *klass, const void *data)
2161 "ensure the host SMMUv3 supports nested translation before "
2162 "enabling.");
2163 object_class_property_set_description(klass, "ril",
2168 - "Disable range invalidation support (for accel=on). ril=auto "
2169 - "is not supported.");
2164 + "Enable/disable range invalidation support (for accel=on). "
2165 + "Valid values are on, off, and auto. Defaults to on. "
2166 + "Any attempt to turn it 'on' while the host does not support "
2167 + "it would fail.");
2168 object_class_property_set_description(klass, "ats",
2169 "Enable/disable ATS support (for accel=on). "
2170 "Valid values are on, off, and auto. Defaults to off. "