whpx: i386: tighten APIC base validity check
Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr> Link: https://lore.kernel.org/r/20260422214225.2242-20-mohamed@unpredictable.fr Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Mohamed Mediouni committed
Apr 22, 2026 at 23:42 UTC
b2406978634c45377c4ca1bc36741b7c0bb4d76a
1 file changed
+4
target/i386/whpx/whpx-all.c
+4
@@ -2079,6 +2079,10 @@ int whpx_vcpu_run(CPUState *cpu)
2079
2080
if (vcpu->exit_ctx.MsrAccess.MsrNumber == MSR_IA32_APICBASE) {
2081
is_known_msr = 1;
2082
+ if (val & MSR_IA32_APICBASE_RESERVED) {
2083
+ x86_emul_raise_exception(&X86_CPU(cpu)->env, EXCP0D_GPF, 0);
2084
+ raises_gpf = true;
2085
+ }
2086
if (!vcpu->exit_ctx.MsrAccess.AccessInfo.IsWrite) {
2087
/* Read path unreachable on Hyper-V */
2088
abort();