[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 32/33] pc: ACPI BIOS: reserve SRAT entry for hotp
From: |
Igor Mammedov |
Subject: |
[Qemu-devel] [PATCH v4 32/33] pc: ACPI BIOS: reserve SRAT entry for hotplug mem hole |
Date: |
Mon, 2 Jun 2014 15:25:28 +0200 |
Needed for Windows to use hotplugged memory device, otherwise
it complains that server is not configured for memory hotplug.
Tests shows that aftewards it uses dynamically provided
proximity value from _PXM() method if available.
Signed-off-by: Igor Mammedov <address@hidden>
Acked-by: Peter Crosthwaite <address@hidden>
---
v2:
- reword comment in build_srat() to make it more clear
- s/hotplug_as_size/hotplugabble_address_space_size/, requested by mst
- use property for getting hotplugabble_address_space_size, requested by mst
---
hw/i386/acpi-build.c | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 58e7306..c53f0c7 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -1199,6 +1199,10 @@ build_srat(GArray *table_data, GArray *linker,
uint64_t curnode;
int srat_start, numa_start, slots;
uint64_t mem_len, mem_base, next_base;
+ PCMachineState *pcms = PC_MACHINE(qdev_get_machine());
+ ram_addr_t hotplugabble_address_space_size =
+ object_property_get_int(OBJECT(pcms), PC_MACHINE_MEMHP_REGION_SIZE,
+ NULL);
srat_start = table_data->len;
@@ -1263,6 +1267,19 @@ build_srat(GArray *table_data, GArray *linker,
acpi_build_srat_memory(numamem, 0, 0, 0, MEM_AFFINITY_NOFLAGS);
}
+ /*
+ * Entry is required for Windows to enable memory hotplug in OS.
+ * Memory devices may override proximity set by this entry,
+ * providing _PXM method if necessary.
+ */
+ if (hotplugabble_address_space_size) {
+ numamem = acpi_data_push(table_data, sizeof *numamem);
+ acpi_build_srat_memory(numamem, pcms->hotplug_memory_base,
+ hotplugabble_address_space_size, 0,
+ MEM_AFFINITY_HOTPLUGGABLE |
+ MEM_AFFINITY_ENABLED);
+ }
+
build_header(linker, table_data,
(void *)(table_data->data + srat_start),
"SRAT",
--
1.7.1
- [Qemu-devel] [PATCH v4 23/33] acpi:piix4: allow plug/unlug callbacks handle not only PCI devices, (continued)
- [Qemu-devel] [PATCH v4 23/33] acpi:piix4: allow plug/unlug callbacks handle not only PCI devices, Igor Mammedov, 2014/06/02
- [Qemu-devel] [PATCH v4 22/33] trace: pc: add PC_DIMM slot & address allocation, Igor Mammedov, 2014/06/02
- [Qemu-devel] [PATCH v4 25/33] pc: ich9 lpc: make it work with global/compat properties, Igor Mammedov, 2014/06/02
- [Qemu-devel] [PATCH v4 24/33] acpi:piix4: add memory hotplug handling, Igor Mammedov, 2014/06/02
- [Qemu-devel] [PATCH v4 26/33] acpi:ich9: add memory hotplug handling, Igor Mammedov, 2014/06/02
- [Qemu-devel] [PATCH v4 27/33] pc: migrate piix4 & ich9 MemHotplugState, Igor Mammedov, 2014/06/02
- [Qemu-devel] [PATCH v4 30/33] pc: ACPI BIOS: implement memory hotplug interface, Igor Mammedov, 2014/06/02
- [Qemu-devel] [PATCH v4 28/33] pc: add acpi-device link to PCMachineState, Igor Mammedov, 2014/06/02
- [Qemu-devel] [PATCH v4 31/33] pc: add "hotplug-memory-region-size" property to PC_MACHINE, Igor Mammedov, 2014/06/02
- [Qemu-devel] [PATCH v4 32/33] pc: ACPI BIOS: reserve SRAT entry for hotplug mem hole,
Igor Mammedov <=
- [Qemu-devel] [PATCH v4 29/33] pc: propagate memory hotplug event to ACPI device, Igor Mammedov, 2014/06/02
- [Qemu-devel] [PATCH v4 33/33] pc: ACPI BIOS: make GPE.3 handle memory hotplug event on PIIX and Q35 machines, Igor Mammedov, 2014/06/02
- Re: [Qemu-devel] [PATCH v4 00/33] pc: ACPI memory hotplug, Eric Blake, 2014/06/02
- Re: [Qemu-devel] [PATCH v4 00/33] pc: ACPI memory hotplug, Michael S. Tsirkin, 2014/06/08