[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 05/11] numa: we don't implement NUMA for s390x
From: |
Cornelia Huck |
Subject: |
[Qemu-devel] [PULL 05/11] numa: we don't implement NUMA for s390x |
Date: |
Thu, 8 Mar 2018 19:04:17 +0100 |
From: David Hildenbrand <address@hidden>
Right now it is possible to crash QEMU for s390x by providing e.g.
-numa node,nodeid=0,cpus=0-1
Problem is, that numa.c uses mc->cpu_index_to_instance_props as an
indicator whether NUMA is supported by a machine type. We don't
implement NUMA for s390x ("topology") yet. However we need
mc->cpu_index_to_instance_props for query-cpus.
So let's fix this case by also checking for mc->get_default_cpu_node_id,
which will be needed by machine_set_cpu_numa_node().
qemu-system-s390x: -numa node,nodeid=0,cpus=0-1: NUMA is not supported by
this machine-type
While at it, make s390_cpu_index_to_props() look like on other
architectures.
Signed-off-by: David Hildenbrand <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Christian Borntraeger <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>
---
hw/s390x/s390-virtio-ccw.c | 8 +++++---
numa.c | 2 +-
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index 8726b4c281..f82270401b 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -390,12 +390,14 @@ static void
s390_machine_device_unplug_request(HotplugHandler *hotplug_dev,
}
}
-static CpuInstanceProperties s390_cpu_index_to_props(MachineState *machine,
+static CpuInstanceProperties s390_cpu_index_to_props(MachineState *ms,
unsigned cpu_index)
{
- g_assert(machine->possible_cpus && cpu_index <
machine->possible_cpus->len);
+ MachineClass *mc = MACHINE_GET_CLASS(ms);
+ const CPUArchIdList *possible_cpus = mc->possible_cpu_arch_ids(ms);
- return machine->possible_cpus->cpus[cpu_index].props;
+ assert(cpu_index < possible_cpus->len);
+ return possible_cpus->cpus[cpu_index].props;
}
static const CPUArchIdList *s390_possible_cpu_arch_ids(MachineState *ms)
diff --git a/numa.c b/numa.c
index 5d7529c1d9..398e2c9a85 100644
--- a/numa.c
+++ b/numa.c
@@ -80,7 +80,7 @@ static void parse_numa_node(MachineState *ms, NumaNodeOptions
*node,
return;
}
- if (!mc->cpu_index_to_instance_props) {
+ if (!mc->cpu_index_to_instance_props || !mc->get_default_cpu_node_id) {
error_report("NUMA is not supported by this machine-type");
exit(1);
}
--
2.13.6
- [Qemu-devel] [PULL 00/11] s390x patches for the 2.12 softfreeze, Cornelia Huck, 2018/03/08
- [Qemu-devel] [PULL 02/11] s390/ipl: only print boot menu error if -boot menu=on was specified, Cornelia Huck, 2018/03/08
- [Qemu-devel] [PULL 04/11] hw/s390x: Add the possibility to specify the netboot image on the command line, Cornelia Huck, 2018/03/08
- [Qemu-devel] [PULL 03/11] target/s390x: Remove leading underscores from #defines, Cornelia Huck, 2018/03/08
- [Qemu-devel] [PULL 05/11] numa: we don't implement NUMA for s390x,
Cornelia Huck <=
- [Qemu-devel] [PULL 01/11] hw/s390x/ipl: Bail out if the network bootloader can not be found, Cornelia Huck, 2018/03/08
- [Qemu-devel] [PULL 06/11] s390x/sclpconsole: Remove dead code - remove exit handlers, Cornelia Huck, 2018/03/08
- [Qemu-devel] [PULL 07/11] vfio-ccw: license text should indicate GPL v2 or later, Cornelia Huck, 2018/03/08
- [Qemu-devel] [PULL 09/11] s390x/sclp: clean up sclp masks, Cornelia Huck, 2018/03/08
- [Qemu-devel] [PULL 08/11] s390x/sclp: proper support of larger send and receive masks, Cornelia Huck, 2018/03/08
- [Qemu-devel] [PULL 10/11] pc-bios/s390-ccw: Move string arrays from bootmap header to .c file, Cornelia Huck, 2018/03/08
- [Qemu-devel] [PULL 11/11] s390x/virtio: Convert virtio-ccw from *_exit to *_unrealize, Cornelia Huck, 2018/03/08
- Re: [Qemu-devel] [PULL 00/11] s390x patches for the 2.12 softfreeze, Peter Maydell, 2018/03/09