From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34231) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wmm9i-00038y-Qn for qemu-devel@nongnu.org; Tue, 20 May 2014 11:40:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wmm9c-0001KV-AZ for qemu-devel@nongnu.org; Tue, 20 May 2014 11:40:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:18157) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wmm9b-0001KH-Uq for qemu-devel@nongnu.org; Tue, 20 May 2014 11:40:36 -0400 Date: Tue, 20 May 2014 18:38:15 +0300 From: "Michael S. Tsirkin" Message-ID: <20140520153815.GB13420@redhat.com> References: <1400598934-31921-1-git-send-email-imammedo@redhat.com> <1400598934-31921-31-git-send-email-imammedo@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1400598934-31921-31-git-send-email-imammedo@redhat.com> Subject: Re: [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: Igor Mammedov Cc: peter.maydell@linaro.org, alex@alex.org.uk, aik@ozlabs.ru, hutao@cn.fujitsu.com, mjt@tls.msk.ru, qemu-devel@nongnu.org, agraf@suse.de, 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, tangchen@cn.fujitsu.com, rth@twiddle.net, andrey@xdel.ru, vasilis.liaskovitis@profitbricks.com, pbonzini@redhat.com, afaerber@suse.de, aurelien@aurel32.net On Tue, May 20, 2014 at 05:15:33PM +0200, Igor Mammedov wrote: > 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. Failed to parse this last sentence. what returns what associated with what? Maybe split to 3-4 short sentences. > + */ > + 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