@@ -2030,7 +2030,7 @@ void build_pptt(GArray *table_data, BIOSLinker *linker, MachineState *ms,
0, socket_id, NULL, 0);
}
- if (mc->smp_props.clusters_supported) {
+ if (mc->smp_props.clusters_supported && mc->smp_props.has_clusters) {
if (cpus->cpus[n].props.cluster_id != cluster_id) {
assert(cpus->cpus[n].props.cluster_id > cluster_id);
cluster_id = cpus->cpus[n].props.cluster_id;
@@ -158,6 +158,8 @@ void machine_parse_smp_config(MachineState *ms,
ms->smp.threads = threads;
ms->smp.max_cpus = maxcpus;
+ mc->smp_props.has_clusters = config->has_clusters;
+
/* sanity-check of the computed topology */
if (sockets * dies * clusters * cores * threads != maxcpus) {
g_autofree char *topo_msg = cpu_hierarchy_to_string(ms);
@@ -130,11 +130,14 @@ typedef struct {
* @prefer_sockets - whether sockets are preferred over cores in smp parsing
* @dies_supported - whether dies are supported by the machine
* @clusters_supported - whether clusters are supported by the machine
+ * @has_clusters - whether clusters are explicitly specified in the user
+ * provided SMP configuration
*/
typedef struct {
bool prefer_sockets;
bool dies_supported;
bool clusters_supported;
+ bool has_clusters;
} SMPCompatProps;
/**
@@ -343,6 +343,9 @@ SRST
::
-smp 2
+
+ Note: The cluster topology will only be generated in ACPI and exposed
+ to guest if it's explicitly specified in -smp.
ERST
DEF("numa", HAS_ARG, QEMU_OPTION_numa,