qdev: Add a SsidSizeMode property type
Introduce a new enum type property allowing to set a Substream ID size for HW-accelerated smmuv3. Values are auto and 0..20. The auto value allows SSID size property to be derived from host IOMMU capabilities. A value of 0 disables SubstreamID, while non-zero values specify the SSID size in bits. 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-5-nathanc@nvidia.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Nathan Chen committed
Mar 24, 2026 at 14:02 UTC
3a3dd64e63dc772f6067d8215b7add7474e6a3e5
4 files changed
+34
hw/core/qdev-properties-system.c
+14
@@ -18,6 +18,7 @@
18
#include "qapi/qapi-types-block.h"
19
#include "qapi/qapi-types-machine.h"
20
#include "qapi/qapi-types-migration.h"
21
+#include "qapi/qapi-types-misc-arm.h"
22
#include "qapi/qapi-visit-virtio.h"
23
#include "qapi/qmp/qerror.h"
24
#include "qemu/ctype.h"
@@ -723,6 +724,19 @@ const PropertyInfo qdev_prop_zero_page_detection = {
724
.set_default_value = qdev_propinfo_set_default_value_enum,
725
};
726
727
+/* --- SsidSizeMode --- */
728
+
729
+QEMU_BUILD_BUG_ON(sizeof(SsidSizeMode) != sizeof(int));
730
+
731
+const PropertyInfo qdev_prop_ssidsize_mode = {
732
+ .type = "SsidSizeMode",
733
+ .description = "ssidsize mode: auto, 0-20",
734
+ .enum_table = &SsidSizeMode_lookup,
735
+ .get = qdev_propinfo_get_enum,
736
+ .set = qdev_propinfo_set_enum,
737
+ .set_default_value = qdev_propinfo_set_default_value_enum,
738
+};
739
+
740
/* --- Reserved Region --- */
741
742
/*
include/hw/core/qdev-properties-system.h
+3
@@ -14,6 +14,7 @@ extern const PropertyInfo qdev_prop_multifd_compression;
14
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_losttickpolicy;
19
extern const PropertyInfo qdev_prop_blockdev_on_error;
20
extern const PropertyInfo qdev_prop_bios_chs_trans;
@@ -61,6 +62,8 @@ extern const PropertyInfo qdev_prop_virtio_gpu_output_list;
62
#define DEFINE_PROP_ZERO_PAGE_DETECTION(_n, _s, _f, _d) \
63
DEFINE_PROP_SIGNED(_n, _s, _f, _d, qdev_prop_zero_page_detection, \
64
ZeroPageDetection)
65
+#define DEFINE_PROP_SSIDSIZE_MODE(_n, _s, _f, _d) \
66
+ DEFINE_PROP_SIGNED(_n, _s, _f, _d, qdev_prop_ssidsize_mode, SsidSizeMode)
67
#define DEFINE_PROP_LOSTTICKPOLICY(_n, _s, _f, _d) \
68
DEFINE_PROP_SIGNED(_n, _s, _f, _d, qdev_prop_losttickpolicy, \
69
LostTickPolicy)
qapi/misc-arm.json
+16
@@ -45,3 +45,19 @@
45
# { "version": 3, "emulated": false, "kernel": true } ] }
46
##
47
{ 'command': 'query-gic-capabilities', 'returns': ['GICCapability'] }
48
+
49
+##
50
+# @SsidSizeMode:
51
+#
52
+# SMMUv3 SubstreamID size configuration mode.
53
+#
54
+# @auto: derive from host IOMMU capabilities
55
+#
56
+# Values 0-20: SSIDSIZE value in bits. 0 disables SubstreamID.
57
+#
58
+# Since: 11.0
59
+##
60
+{ 'enum': 'SsidSizeMode',
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()
qapi/pragma.json
+1
@@ -68,6 +68,7 @@
68
'S390CpuEntitlement',
69
'S390CpuPolarization',
70
'S390CpuState',
71
+ 'SsidSizeMode',
72
'String',
73
'StringWrapper',
74
'SysEmuTarget',