[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 2/5] hw/acpi-build: Add a check for memory-less NUMA
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 2/5] hw/acpi-build: Add a check for memory-less NUMA nodes |
Date: |
Fri, 3 Aug 2018 12:27:59 +0300 |
From: Dou Liyang <address@hidden>
Currently, Qemu ACPI builder doesn't consider the memory-less NUMA nodes, eg:
-m 4G,slots=4,maxmem=8G \
-numa node,nodeid=0 \
-numa node,nodeid=1,mem=2G \
-numa node,nodeid=2,mem=2G \
-numa node,nodeid=3\
Guest Linux will report
[ 0.000000] ACPI: SRAT: Node 0 PXM 0 [mem 0x00000000-0xffffffffffffffff]
[ 0.000000] ACPI: SRAT: Node 1 PXM 1 [mem 0x00000000-0x0009ffff]
[ 0.000000] ACPI: SRAT: Node 1 PXM 1 [mem 0x00100000-0x7fffffff]
[ 0.000000] ACPI: SRAT: Node 2 PXM 2 [mem 0x80000000-0xbfffffff]
[ 0.000000] ACPI: SRAT: Node 2 PXM 2 [mem 0x100000000-0x13fffffff]
[ 0.000000] ACPI: SRAT: Node 3 PXM 3 [mem 0x140000000-0x13fffffff]
[ 0.000000] ACPI: SRAT: Node 3 PXM 3 [mem 0x140000000-0x33fffffff] hotplug
[mem 0x00000000-0xffffffffffffffff] and [mem 0x140000000-0x13fffffff] are bogus.
Add a check to avoid building srat memory for memory-less NUMA nodes, also
update
the test file. Now the info in guest linux will be
[ 0.000000] ACPI: SRAT: Node 1 PXM 1 [mem 0x00000000-0x0009ffff]
[ 0.000000] ACPI: SRAT: Node 1 PXM 1 [mem 0x00100000-0x7fffffff]
[ 0.000000] ACPI: SRAT: Node 2 PXM 2 [mem 0x80000000-0xbfffffff]
[ 0.000000] ACPI: SRAT: Node 2 PXM 2 [mem 0x100000000-0x13fffffff]
[ 0.000000] ACPI: SRAT: Node 3 PXM 3 [mem 0x140000000-0x33fffffff] hotplug
Signed-off-by: Dou Liyang <address@hidden>
Reviewed-by: Igor Mammedov <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
hw/i386/acpi-build.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 9e8350c55d..c584642e4e 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -2392,9 +2392,12 @@ build_srat(GArray *table_data, BIOSLinker *linker,
MachineState *machine)
mem_len = next_base - pcms->below_4g_mem_size;
next_base = mem_base + mem_len;
}
- numamem = acpi_data_push(table_data, sizeof *numamem);
- build_srat_memory(numamem, mem_base, mem_len, i - 1,
- MEM_AFFINITY_ENABLED);
+
+ if (mem_len > 0) {
+ numamem = acpi_data_push(table_data, sizeof *numamem);
+ build_srat_memory(numamem, mem_base, mem_len, i - 1,
+ MEM_AFFINITY_ENABLED);
+ }
}
slots = (table_data->len - numa_start) / sizeof *numamem;
for (; slots < pcms->numa_nodes + 2; slots++) {
--
MST
- [Qemu-devel] [PULL 0/5] pc, virtio: fixes, Michael S. Tsirkin, 2018/08/03
- [Qemu-devel] [PULL 1/5] vhost: check region type before casting, Michael S. Tsirkin, 2018/08/03
- [Qemu-devel] [PULL 2/5] hw/acpi-build: Add a check for memory-less NUMA nodes,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 3/5] tests/acpi-test: update ACPI tables test blobs, Michael S. Tsirkin, 2018/08/03
- [Qemu-devel] [PULL 4/5] pc: acpi: fix memory hotplug regression by reducing stub SRAT entry size, Michael S. Tsirkin, 2018/08/03
- [Qemu-devel] [PULL 5/5] tests/acpi: update tables after memory hotplug changes, Michael S. Tsirkin, 2018/08/03
- Re: [Qemu-devel] [PULL 0/5] pc, virtio: fixes, Peter Maydell, 2018/08/03
- Re: [Qemu-devel] [PULL 0/5] pc, virtio: fixes, Peter Maydell, 2018/08/06