@samitouri / QOSamiQemu / commits / 95b8738e31

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>

Mohamed Mediouni committed Apr 22, 2026 at 23:42 UTC 95b8738e311f1cd28cad4d1f1bdb882898cf02eb
1 file changed +13
target/i386/whpx/whpx-all.c
+13
@@ -51,6 +51,7 @@
51 #define HYPERV_APIC_BUS_FREQUENCY (200000000ULL)
52 /* for kernel-irqchip=off */
53 #define HV_X64_MSR_APIC_FREQUENCY 0x40000023
54 +#define HV_X64_MSR_VP_ASSIST_PAGE 0x40000073
55
56 static bool is_modern_os = true;
57
@@ -2123,6 +2124,18 @@ int whpx_vcpu_run(CPUState *cpu)
2124 }
2125 }
2126 }
2127 +
2128 + /*
2129 + * Linux tries to use it anyway even when not exposed.
2130 + * Ignore the write as the VP assist page is not used.
2131 + */
2132 + if (vcpu->exit_ctx.MsrAccess.MsrNumber == HV_X64_MSR_VP_ASSIST_PAGE
2133 + && vcpu->exit_ctx.MsrAccess.AccessInfo.IsWrite
2134 + && !whpx_irqchip_in_kernel()
2135 + && whpx->hyperv_enlightenments_enabled) {
2136 + is_known_msr = 1;
2137 + }
2138 +
2139 /*
2140 * For all unsupported MSR access we:
2141 * ignore writes