aboutsummaryrefslogtreecommitdiff
path: root/hw/core/machine.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/core/machine.c')
-rw-r--r--hw/core/machine.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/hw/core/machine.c b/hw/core/machine.c
index 582c2df..0dec48e 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -800,6 +800,11 @@ void machine_set_cpu_numa_node(MachineState *machine,
return;
}
+ if (props->has_module_id && !slot->props.has_module_id) {
+ error_setg(errp, "module-id is not supported");
+ return;
+ }
+
if (props->has_cluster_id && !slot->props.has_cluster_id) {
error_setg(errp, "cluster-id is not supported");
return;
@@ -824,6 +829,11 @@ void machine_set_cpu_numa_node(MachineState *machine,
continue;
}
+ if (props->has_module_id &&
+ props->module_id != slot->props.module_id) {
+ continue;
+ }
+
if (props->has_cluster_id &&
props->cluster_id != slot->props.cluster_id) {
continue;
@@ -881,6 +891,7 @@ static void machine_get_smp(Object *obj, Visitor *v, const char *name,
.has_sockets = true, .sockets = ms->smp.sockets,
.has_dies = true, .dies = ms->smp.dies,
.has_clusters = true, .clusters = ms->smp.clusters,
+ .has_modules = true, .modules = ms->smp.modules,
.has_cores = true, .cores = ms->smp.cores,
.has_threads = true, .threads = ms->smp.threads,
.has_maxcpus = true, .maxcpus = ms->smp.max_cpus,
@@ -1157,6 +1168,7 @@ static void machine_initfn(Object *obj)
ms->smp.sockets = 1;
ms->smp.dies = 1;
ms->smp.clusters = 1;
+ ms->smp.modules = 1;
ms->smp.cores = 1;
ms->smp.threads = 1;
@@ -1224,6 +1236,12 @@ static char *cpu_slot_to_string(const CPUArchId *cpu)
}
g_string_append_printf(s, "cluster-id: %"PRId64, cpu->props.cluster_id);
}
+ if (cpu->props.has_module_id) {
+ if (s->len) {
+ g_string_append_printf(s, ", ");
+ }
+ g_string_append_printf(s, "module-id: %"PRId64, cpu->props.module_id);
+ }
if (cpu->props.has_core_id) {
if (s->len) {
g_string_append_printf(s, ", ");