From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53785) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xnswy-0002rM-K7 for qemu-devel@nongnu.org; Mon, 10 Nov 2014 12:40:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xnsws-0007fA-Bx for qemu-devel@nongnu.org; Mon, 10 Nov 2014 12:40:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33785) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xnsws-0007f5-3X for qemu-devel@nongnu.org; Mon, 10 Nov 2014 12:40:18 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sAAHeHLN001128 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 10 Nov 2014 12:40:17 -0500 Message-ID: <5460F87C.6050209@redhat.com> Date: Mon, 10 Nov 2014 18:40:12 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1415636450-18674-1-git-send-email-imammedo@redhat.com> In-Reply-To: <1415636450-18674-1-git-send-email-imammedo@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH for-2.2] pc: acpi: mark all possible CPUs as enabled in SRAT List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov , qemu-devel@nongnu.org Cc: mst@redhat.com On 10/11/2014 17:20, Igor Mammedov wrote: > If QEMU is started with -numa ... Windows only notices that > CPU has been hot-added but it will not online such CPUs. > > It's caused by the fact that possible CPUs are flagged as > not enabled in SRAT and Windows honoring that information > doesn't use corresponding CPU. > > ACPI 5.0 Spec regarding to flag says: > " > Table 5-47 Local APIC Flags > ... > Enabled: if zero, this processor is unusable, and the operating system > support will not attempt to use it. > " > > Fix QEMU to adhere to spec and mark possible CPUs as enabled > in SRAT. > > With that Windows onlines hot-added CPUs as expected. > > Signed-off-by: Igor Mammedov Does this need to be specific to pc-2.2? Paolo > --- > hw/i386/acpi-build.c | 11 +++-------- > 1 file changed, 3 insertions(+), 8 deletions(-) > > diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c > index 4003b6b..06499da 100644 > --- a/hw/i386/acpi-build.c > +++ b/hw/i386/acpi-build.c > @@ -1269,8 +1269,7 @@ acpi_build_srat_memory(AcpiSratMemoryAffinity *numamem, uint64_t base, > } > > static void > -build_srat(GArray *table_data, GArray *linker, > - AcpiCpuInfo *cpu, PcGuestInfo *guest_info) > +build_srat(GArray *table_data, GArray *linker, PcGuestInfo *guest_info) > { > AcpiSystemResourceAffinityTable *srat; > AcpiSratProcessorAffinity *core; > @@ -1300,11 +1299,7 @@ build_srat(GArray *table_data, GArray *linker, > core->proximity_lo = curnode; > memset(core->proximity_hi, 0, 3); > core->local_sapic_eid = 0; > - if (test_bit(i, cpu->found_cpus)) { > - core->flags = cpu_to_le32(1); > - } else { > - core->flags = cpu_to_le32(0); > - } > + core->flags = cpu_to_le32(1); > } > > > @@ -1622,7 +1617,7 @@ void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables) > } > if (guest_info->numa_nodes) { > acpi_add_table(table_offsets, tables->table_data); > - build_srat(tables->table_data, tables->linker, &cpu, guest_info); > + build_srat(tables->table_data, tables->linker, guest_info); > } > if (acpi_get_mcfg(&mcfg)) { > acpi_add_table(table_offsets, tables->table_data); >