[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] x86/viridian: Workaround Hyper-V GP fault writing to MSR



commit 33829ead9aedfb21b4103c7ebf1fcc497227a77a
Author:     Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
AuthorDate: Mon Sep 21 10:10:22 2026 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Sep 21 10:10:22 2026 +0200

    x86/viridian: Workaround Hyper-V GP fault writing to MSR
    
    The Viridian spec requires the vector to be >= 0x10 when writing to the
    SINTx MSR, otherwise it should #GP fault.
    The spec-defined initial value is 0x10000, i.e. the vector is 0. On
    startup, for some reason Windows 11 Hyper-V tries to set the MSR to
    the spec-defined initial value and since the vector is 0, it GP faults.
    Fix this by doing as Hyper-V does and only fault if the SINT is
    unmasked.
    
    Signed-off-by: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/arch/x86/hvm/viridian/synic.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/viridian/synic.c 
b/xen/arch/x86/hvm/viridian/synic.c
index e6cba7548f..3125ccca0d 100644
--- a/xen/arch/x86/hvm/viridian/synic.c
+++ b/xen/arch/x86/hvm/viridian/synic.c
@@ -157,9 +157,14 @@ int viridian_synic_wrmsr(struct vcpu *v, uint32_t idx, 
uint64_t val)
         if ( !(viridian_feature_mask(d) & HVMPV_synic) )
             return X86EMUL_EXCEPTION;
 
-        /* Vectors must be in the range 0x10-0xff inclusive */
+        /*
+         * Vectors must be in the range 0x10-0xff inclusive unless the vector
+         * is masked since Windows 11 Hyper-V (26H1) has been seen to write
+         * this MSR to its default value, despite not being a spec compliant
+         * value.
+         */
         new.as_uint64 = val;
-        if ( new.vector < 0x10 )
+        if ( new.vector < 0x10 && !new.masked )
             return X86EMUL_EXCEPTION;
 
         /*
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.