From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55309) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wmlqu-0002eP-H1 for qemu-devel@nongnu.org; Tue, 20 May 2014 11:21:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wmlqo-000237-02 for qemu-devel@nongnu.org; Tue, 20 May 2014 11:21:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53749) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wmlqn-00022y-O9 for qemu-devel@nongnu.org; Tue, 20 May 2014 11:21:09 -0400 From: Igor Mammedov Date: Tue, 20 May 2014 17:15:33 +0200 Message-Id: <1400598934-31921-31-git-send-email-imammedo@redhat.com> In-Reply-To: <1400598934-31921-1-git-send-email-imammedo@redhat.com> References: <1400598934-31921-1-git-send-email-imammedo@redhat.com> Subject: [Qemu-devel] [PATCH v2 30/31] pc: ACPI BIOS: reserve SRAT entry for hotplug mem hole List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, alex@alex.org.uk, mst@redhat.com, aik@ozlabs.ru, hutao@cn.fujitsu.com, mjt@tls.msk.ru, tangchen@cn.fujitsu.com, kraxel@redhat.com, pasteka@kabsi.at, s.priebe@profihost.ag, agarcia@igalia.com, armbru@redhat.com, aliguori@amazon.com, david@gibson.dropbear.id.au, lersek@redhat.com, ehabkost@redhat.com, marcel.a@redhat.com, stefanha@redhat.com, cornelia.huck@de.ibm.com, rth@twiddle.net, agraf@suse.de, andrey@xdel.ru, vasilis.liaskovitis@profitbricks.com, pbonzini@redhat.com, afaerber@suse.de, aurelien@aurel32.net 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 --- hw/i386/acpi-build.c | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 58e7306..97e3a82 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -1199,6 +1199,8 @@ 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 hotplug_as_size = memory_region_size(&pcms->hotplug_memory); srat_start = table_data->len; @@ -1263,6 +1265,18 @@ build_srat(GArray *table_data, GArray *linker, acpi_build_srat_memory(numamem, 0, 0, 0, MEM_AFFINITY_NOFLAGS); } + /* + * Fake entry required by Windows to enable memory hotplug in OS. + * Individual DIMM devices override proximity set here via _PXM method, + * which returns associated with it NUMA node id. + */ + if (hotplug_as_size) { + numamem = acpi_data_push(table_data, sizeof *numamem); + acpi_build_srat_memory(numamem, pcms->hotplug_memory_base, + hotplug_as_size, 0, MEM_AFFINITY_HOTPLUGGABLE | + MEM_AFFINITY_ENABLED); + } + build_header(linker, table_data, (void *)(table_data->data + srat_start), "SRAT", -- 1.7.1