@samitouri / QOSamiQemu / commits / 7b8e1c25af

whpx: i386: set apicbase value only on success

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr> Link: https://lore.kernel.org/r/20260422214225.2242-17-mohamed@unpredictable.fr Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Mohamed Mediouni committed Apr 22, 2026 at 23:42 UTC 7b8e1c25af25ce88e08ae076ad8da7cbcaec3d55
1 file changed +2 -1
target/i386/whpx/whpx-all.c
+2 -1
@@ -2086,8 +2086,9 @@ int whpx_vcpu_run(CPUState *cpu)
2086 int msr_ret = cpu_set_apic_base(X86_CPU(cpu)->apic_state, val);
2087 if (msr_ret < 0) {
2088 x86_emul_raise_exception(&X86_CPU(cpu)->env, EXCP0D_GPF, 0);
2089 + } else {
2090 + whpx_set_reg(cpu, WHvX64RegisterApicBase, reg);
2091 }
2090 - whpx_set_reg(cpu, WHvX64RegisterApicBase, reg);
2092 }
2093 }
2094