diff mbox series

[RFC,40/52] qapi: Introduce hybrid options

Message ID 20230213095035.158240-41-zhao1.liu@linux.intel.com
State New
Headers show
Series Introduce hybrid CPU topology | expand

Commit Message

Zhao Liu Feb. 13, 2023, 9:50 a.m. UTC
From: Zhao Liu <zhao1.liu@intel.com>

For hybrid cpu topology configuration, the original "-smp" lack of
flexibility to expand, and unables to customize different cores.

So we introduce "-hybrid" command:
-hybrid socket,sockets=n
-hybrid die,dies=n
-hybrid cluster,clusters=n
-hybrid core,cores=n,type=core_type[,threads=threads]
        [,clusterid=cluster]

Here, we first define the corresponding qapi options for these 4
topology levels: core, cluster, die and socket.

We doesn't need a thread level since thread doesn't have different
type.

Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
---
 qapi/machine.json | 90 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 90 insertions(+)
diff mbox series

Patch

diff --git a/qapi/machine.json b/qapi/machine.json
index bd7303f34497..931c6dea9819 100644
--- a/qapi/machine.json
+++ b/qapi/machine.json
@@ -1694,3 +1694,93 @@ 
 { 'command': 'dumpdtb',
   'data': { 'filename': 'str' },
   'if': 'CONFIG_FDT' }
+
+##
+# @HybridOptionsType:
+#
+# @socket: socket level configuration
+#
+# @die: die level configuration
+#
+# @cluster: cluster level configuration
+#
+# @core: core level configuration
+#
+# Since: 8.0
+##
+{ 'enum': 'HybridOptionsType',
+     'data': [ 'socket', 'die', 'cluster', 'core' ] }
+
+##
+# @HybridOptions:
+#
+# A discriminated record of hybrid options. (for OptsVisitor)
+#
+# Since: 8.0
+##
+{ 'union': 'HybridOptions',
+     'base': { 'type': 'HybridOptionsType' },
+     'discriminator': 'type',
+     'data': {
+       'socket': 'HybridSocketOptions',
+       'die': 'HybridDieOptions',
+       'cluster': 'HybridClusterOptions',
+       'core': 'HybridCoreOptions' }}
+
+##
+# @HybridCoreOptions:
+#
+# Configure core level topology for hybrid cpu topology.
+#
+# @cores: number of current type cores in one die.
+#
+# @coretype: type of current core.
+#
+# @threads: number of threads that current core has.
+#
+# @clusterid: cluster index in one die that current core will be
+#             inserted to.
+#
+# Since: 8.0
+##
+{ 'struct': 'HybridCoreOptions', 'data': {
+     '*cores': 'uint32',
+     '*coretype': 'str',
+     '*threads': 'uint32',
+     '*clusterid': ['uint32']} }
+
+##
+# @HybridClusterOptions:
+#
+# Configure cluster level topology for hybrid cpu topology.
+#
+# @clusters: number of clusters in one socket.
+#
+# Since: 8.0
+##
+{ 'struct': 'HybridClusterOptions', 'data': {
+            '*clusters': 'uint32' } }
+
+##
+# @HybridDieOptions:
+#
+# Configure die level topology for hybrid cpu topology.
+#
+# @dies: number of dies in one socket.
+#
+# Since: 8.0
+##
+{ 'struct': 'HybridDieOptions', 'data': {
+            '*dies': 'uint32' } }
+
+##
+# @HybridSocketOptions:
+#
+# Configure socket level topology for hybrid cpu topology.
+#
+# @sockets: number of sockets in the whole system.
+#
+# Since: 8.0
+##
+{ 'struct': 'HybridSocketOptions', 'data': {
+            '*sockets': 'uint32' } }