whpx: i386: set WHvX64RegisterInitialApicId
Keep Hyper-V aware of the initial APIC ID chosen. Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr> Link: https://lore.kernel.org/r/20260422214225.2242-25-mohamed@unpredictable.fr Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Mohamed Mediouni committed
Apr 22, 2026 at 23:42 UTC
775899b9a8668276730681de9b4a3fb2e01fbde9
1 file changed
+5
target/i386/whpx/whpx-all.c
+5
@@ -2475,6 +2475,11 @@ int whpx_init_vcpu(CPUState *cpu)
2475
goto error;
2476
}
2477
2478
+ if (!whpx_irqchip_in_kernel()) {
2479
+ WHV_REGISTER_VALUE apic_id = {.Reg64 = x86_cpu->apic_state->initial_apic_id};
2480
+ whpx_set_reg(cpu, WHvX64RegisterInitialApicId, apic_id);
2481
+ }
2482
+
2483
/*
2484
* vcpu's TSC frequency is either specified by user, or use the value
2485
* provided by Hyper-V if the former is not present. In the latter case, we