Commit 95b8738e31 for qemu.org
commit 95b8738e311f1cd28cad4d1f1bdb882898cf02eb
Author: Mohamed Mediouni <mohamed@unpredictable.fr>
Date: Wed Apr 22 23:42:08 2026 +0200
whpx: i386: ignore vpassist when kernel-irqchip=off
Linux tries to set vpassist even when none of the enlightenments
using it are available.
So ignore the page it sets.
Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260422214225.2242-21-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c
index 8fbce41590..11c9d8729f 100644
--- a/target/i386/whpx/whpx-all.c
+++ b/target/i386/whpx/whpx-all.c
@@ -51,6 +51,7 @@
#define HYPERV_APIC_BUS_FREQUENCY (200000000ULL)
/* for kernel-irqchip=off */
#define HV_X64_MSR_APIC_FREQUENCY 0x40000023
+#define HV_X64_MSR_VP_ASSIST_PAGE 0x40000073
static bool is_modern_os = true;
@@ -2123,6 +2124,18 @@ int whpx_vcpu_run(CPUState *cpu)
}
}
}
+
+ /*
+ * Linux tries to use it anyway even when not exposed.
+ * Ignore the write as the VP assist page is not used.
+ */
+ if (vcpu->exit_ctx.MsrAccess.MsrNumber == HV_X64_MSR_VP_ASSIST_PAGE
+ && vcpu->exit_ctx.MsrAccess.AccessInfo.IsWrite
+ && !whpx_irqchip_in_kernel()
+ && whpx->hyperv_enlightenments_enabled) {
+ is_known_msr = 1;
+ }
+
/*
* For all unsupported MSR access we:
* ignore writes