[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC 13/13] pc: cpu: make sure that cpu.node-id matches -nu
From: |
Igor Mammedov |
Subject: |
[Qemu-devel] [RFC 13/13] pc: cpu: make sure that cpu.node-id matches -numa mapping |
Date: |
Wed, 18 Jan 2017 18:13:29 +0100 |
for PC CPU's node mapping defined statically at startup
and not possible to changle at hotplug time.
So check that user set cpu.node-id matches whatever values
were configured with -numa options (ex|im)plicitly.
Signed-off-by: Igor Mammedov <address@hidden>
---
hw/i386/pc.c | 11 ++++++++++-
target/i386/cpu.c | 2 +-
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index e2833e0..d828a1a 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1967,7 +1967,16 @@ static void pc_cpu_pre_plug(HotplugHandler *hotplug_dev,
cs = CPU(cpu);
cs->cpu_index = idx;
- cpu->numa_nid = cpu_slot->props.node_id;
+
+ if (cpu->numa_nid == -1) {
+ cpu->numa_nid = cpu_slot->props.node_id;
+ } else if (cpu->numa_nid != cpu_slot->props.node_id) {
+ error_setg(errp, "property node-id: %u doesn't match with -numa"
+ " explictly specified value(s) or implicitly set defaults."
+ " Expected value: %" PRIi64,
+ cpu->numa_nid, cpu_slot->props.node_id);
+ return;
+ }
}
static void pc_machine_device_pre_plug_cb(HotplugHandler *hotplug_dev,
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 85c52f1..6375a37 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -3649,7 +3649,7 @@ static Property x86_cpu_properties[] = {
DEFINE_PROP_INT32("core-id", X86CPU, core_id, -1),
DEFINE_PROP_INT32("socket-id", X86CPU, socket_id, -1),
#endif
- DEFINE_PROP_INT32("node-id", X86CPU, numa_nid, 0),
+ DEFINE_PROP_INT32("node-id", X86CPU, numa_nid, -1),
DEFINE_PROP_BOOL("pmu", X86CPU, enable_pmu, false),
{ .name = "hv-spinlocks", .info = &qdev_prop_spinlocks },
DEFINE_PROP_BOOL("hv-relaxed", X86CPU, hyperv_relaxed_timing, false),
--
2.7.4
- [Qemu-devel] [RFC 07/13] pc: pass apic_id to pc_find_cpu_slot() directly so lookup could be done without CPU object, (continued)
- [Qemu-devel] [RFC 07/13] pc: pass apic_id to pc_find_cpu_slot() directly so lookup could be done without CPU object, Igor Mammedov, 2017/01/18
- [Qemu-devel] [RFC 09/13] numa: introduce '-numa cpu' cpu option, Igor Mammedov, 2017/01/18
- [Qemu-devel] [RFC 10/13] numa: replace cpu_index_to_socket_id() with cpu_index_to_instance_props(), Igor Mammedov, 2017/01/18
- [Qemu-devel] [RFC 11/13] numa: use new machine.cpu property with -numa cpus=... CLI, Igor Mammedov, 2017/01/18
- [Qemu-devel] [RFC 13/13] pc: cpu: make sure that cpu.node-id matches -numa mapping,
Igor Mammedov <=
- [Qemu-devel] [RFC 12/13] pc: drop usage of legacy numa_get_node_for_cpu(), Igor Mammedov, 2017/01/18
- Re: [Qemu-devel] [RFC 00/13] numa: add '-numa cpu' option, Daniel P. Berrange, 2017/01/19
- Re: [Qemu-devel] [RFC 00/13] numa: add '-numa cpu' option, Igor Mammedov, 2017/01/20