diff options
author | Igor Mammedov | 2014-06-02 15:25:28 +0200 |
---|---|---|
committer | Michael S. Tsirkin | 2014-06-19 15:41:52 +0200 |
commit | cec65193d41099519f14fb744440eeabbfa6e4e3 (patch) | |
tree | 41c97fb33cda4f12fb7f7c6fe5704169907daf40 /hw/i386/acpi-build.c | |
parent | pc: add "hotplug-memory-region-size" property to PC_MACHINE (diff) | |
download | qemu-cec65193d41099519f14fb744440eeabbfa6e4e3.tar.gz qemu-cec65193d41099519f14fb744440eeabbfa6e4e3.tar.xz qemu-cec65193d41099519f14fb744440eeabbfa6e4e3.zip |
pc: ACPI BIOS: reserve SRAT entry for hotplug mem hole
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 <imammedo@redhat.com>
Acked-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/i386/acpi-build.c')
-rw-r--r-- | 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 6ff7fa3980..ebc5f034e3 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", |