Skip to content

Commit 83a6674

Browse files
Igor Mammedovmdroth
authored andcommitted
pc: acpi: mark all possible CPUs as enabled in SRAT
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 <[email protected]> Reviewed-by: Michael S. Tsirkin <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]> (cherry picked from commit dd0247e) Signed-off-by: Michael Roth <[email protected]>
1 parent 39639d8 commit 83a6674

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

hw/i386/acpi-build.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,8 +1228,7 @@ acpi_build_srat_memory(AcpiSratMemoryAffinity *numamem, uint64_t base,
12281228
}
12291229

12301230
static void
1231-
build_srat(GArray *table_data, GArray *linker,
1232-
AcpiCpuInfo *cpu, PcGuestInfo *guest_info)
1231+
build_srat(GArray *table_data, GArray *linker, PcGuestInfo *guest_info)
12331232
{
12341233
AcpiSystemResourceAffinityTable *srat;
12351234
AcpiSratProcessorAffinity *core;
@@ -1259,11 +1258,7 @@ build_srat(GArray *table_data, GArray *linker,
12591258
core->proximity_lo = curnode;
12601259
memset(core->proximity_hi, 0, 3);
12611260
core->local_sapic_eid = 0;
1262-
if (test_bit(i, cpu->found_cpus)) {
1263-
core->flags = cpu_to_le32(1);
1264-
} else {
1265-
core->flags = cpu_to_le32(0);
1266-
}
1261+
core->flags = cpu_to_le32(1);
12671262
}
12681263

12691264

@@ -1539,7 +1534,7 @@ void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables)
15391534
}
15401535
if (guest_info->numa_nodes) {
15411536
acpi_add_table(table_offsets, tables->table_data);
1542-
build_srat(tables->table_data, tables->linker, &cpu, guest_info);
1537+
build_srat(tables->table_data, tables->linker, guest_info);
15431538
}
15441539
if (acpi_get_mcfg(&mcfg)) {
15451540
acpi_add_table(table_offsets, tables->table_data);

0 commit comments

Comments
 (0)