[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC 40/52] qapi: Introduce hybrid options
From: |
Zhao Liu |
Subject: |
[RFC 40/52] qapi: Introduce hybrid options |
Date: |
Mon, 13 Feb 2023 17:50:23 +0800 |
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 --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' } }
--
2.34.1
- Re: [RFC 41/52] machine: Introduce core_type() hook, (continued)
[RFC 40/52] qapi: Introduce hybrid options,
Zhao Liu <=
[RFC 39/52] i386/cpu: Add Intel hybrid related CPUID support, Zhao Liu, 2023/02/13
[RFC 43/52] hw/machine: Rename MachineClass.smp_props to MachineClass.topo_props, Zhao Liu, 2023/02/13
[RFC 44/52] machine: Add "-hybrid" parsing rule, Zhao Liu, 2023/02/13
[RFC 45/52] hw/machine: Add hybrid cpu topology validation, Zhao Liu, 2023/02/13
[RFC 47/52] hw/machine: Use opts_visitor to parse hybrid topo, Zhao Liu, 2023/02/13
[RFC 46/52] hw/machine: build core level hybrid topology form HybridCorePack, Zhao Liu, 2023/02/13
[RFC 48/52] machine: Support "-hybrid" command, Zhao Liu, 2023/02/13
[RFC 49/52] i386/pc: Support hybrid cpu topology, Zhao Liu, 2023/02/13
[RFC 50/52] qemu-options: Add the document of hybrid command, Zhao Liu, 2023/02/13
[RFC 51/52] qapi: Expose CPU topology info in query_cpus_fast, Zhao Liu, 2023/02/13