@samitouri / QOSamiQemu / commits / d3d2de3d22

qdev: Add an OasMode property type

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> 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-7-nathanc@nvidia.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Nathan Chen committed Mar 24, 2026 at 14:02 UTC d3d2de3d227b63db5715fcaa89df388c929c7aba
3 files changed +44
hw/core/qdev-properties-system.c
+13
@@ -737,6 +737,19 @@ const PropertyInfo qdev_prop_ssidsize_mode = {
737 .set_default_value = qdev_propinfo_set_default_value_enum,
738 };
739
740 +/* --- OasMode --- */
741 +
742 +QEMU_BUILD_BUG_ON(sizeof(OasMode) != sizeof(int));
743 +
744 +const PropertyInfo qdev_prop_oas_mode = {
745 + .type = "OasMode",
746 + .description = "oas mode: auto, 32, 36, 40, 42, 44, 48, 52, 56",
747 + .enum_table = &OasMode_lookup,
748 + .get = qdev_propinfo_get_enum,
749 + .set = qdev_propinfo_set_enum,
750 + .set_default_value = qdev_propinfo_set_default_value_enum,
751 +};
752 +
753 /* --- Reserved Region --- */
754
755 /*
include/hw/core/qdev-properties-system.h
+3
@@ -15,6 +15,7 @@ extern const PropertyInfo qdev_prop_mig_mode;
15 extern const PropertyInfo qdev_prop_granule_mode;
16 extern const PropertyInfo qdev_prop_zero_page_detection;
17 extern const PropertyInfo qdev_prop_ssidsize_mode;
18 +extern const PropertyInfo qdev_prop_oas_mode;
19 extern const PropertyInfo qdev_prop_losttickpolicy;
20 extern const PropertyInfo qdev_prop_blockdev_on_error;
21 extern const PropertyInfo qdev_prop_bios_chs_trans;
@@ -64,6 +65,8 @@ extern const PropertyInfo qdev_prop_virtio_gpu_output_list;
65 ZeroPageDetection)
66 #define DEFINE_PROP_SSIDSIZE_MODE(_n, _s, _f, _d) \
67 DEFINE_PROP_SIGNED(_n, _s, _f, _d, qdev_prop_ssidsize_mode, SsidSizeMode)
68 +#define DEFINE_PROP_OAS_MODE(_n, _s, _f, _d) \
69 + DEFINE_PROP_SIGNED(_n, _s, _f, _d, qdev_prop_oas_mode, OasMode)
70 #define DEFINE_PROP_LOSTTICKPOLICY(_n, _s, _f, _d) \
71 DEFINE_PROP_SIGNED(_n, _s, _f, _d, qdev_prop_losttickpolicy, \
72 LostTickPolicy)
qapi/misc-arm.json
+28
@@ -61,3 +61,31 @@
61 'data': [ 'auto', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
62 '10', '11', '12', '13', '14', '15', '16', '17', '18',
63 '19', '20' ] } # order matters, see ssidsize_mode_to_value()
64 +
65 +##
66 +# @OasMode:
67 +#
68 +# SMMUv3 Output Address Size configuration mode.
69 +#
70 +# @auto: derive from host IOMMU capabilities
71 +#
72 +# @32: 32-bit output address size
73 +#
74 +# @36: 36-bit output address size
75 +#
76 +# @40: 40-bit output address size
77 +#
78 +# @42: 42-bit output address size
79 +#
80 +# @44: 44-bit output address size
81 +#
82 +# @48: 48-bit output address size
83 +#
84 +# @52: 52-bit output address size
85 +#
86 +# @56: 56-bit output address size
87 +#
88 +# Since: 11.0
89 +##
90 +{ 'enum': 'OasMode',
91 + 'data': [ 'auto', '32', '36', '40', '42', '44', '48', '52', '56' ] }