]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
whpx: i386: ignore vpassist when kernel-irqchip=off
authorMohamed Mediouni <mohamed@unpredictable.fr>
Wed, 22 Apr 2026 21:42:08 +0000 (23:42 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 30 Apr 2026 15:55:03 +0000 (17:55 +0200)
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>
target/i386/whpx/whpx-all.c

index 8fbce415903ca49ed36096960c12c8a6950f2196..11c9d8729faea04fee6ca84907f2d3e16807d3ad 100644 (file)
@@ -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