Skip to contentSkip to conversation

x86/msr: handle IA32_THERM_STATUS

PATCH In review Roger Pau Monne 2 participants 4 messages Oct 7, 2020 – Oct 15, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/msr: handle IA32_THERM_STATUS

Windows 8 will attempt to read MSR_IA32_THERM_STATUS and panic if a #GP fault is injected as a result:

vmx.c:3035:d8v0 RDMSR 0x0000019c unimplemented
d8v0 VIRIDIAN CRASH: 3b c0000096 fffff8061de31651 fffff4088a613720 0

So handle the MSR and return 0 instead.

Note that this is done on the generic MSR handler, and PV guest will also get 0 back when trying to read the MSR. There doesn't seem to be much value in handling the MSR for HVM guests only.

Fixes 84e848fd7a1 ('x86/hvm: disallow access to unknown MSRs')
---
 xen/arch/x86/msr.c | 6 ++++++
 1 file changed, 6 insertions(+)
xen/arch/x86/msr.c +6 -0
index e4c4fa6127..190d6ac6c5 100644
@@ -253,6 +253,12 @@ int guest_rdmsr(struct vcpu *v, uint32_t msr, uint64_t *val)
             break;
         goto gp_fault;
 
+    case MSR_IA32_THERM_STATUS:
+        if ( cp->x86_vendor != X86_VENDOR_INTEL )
+            goto gp_fault;
+        *val = 0;
+        break;
+
     case MSR_X2APIC_FIRST ... MSR_X2APIC_LAST:
         if ( !is_hvm_domain(d) || v != curr )
             goto gp_fault;
Signature · 1 line
2.28.0
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Roger Pau Monne

Windows 8 will attempt to read MSR_IA32_THERM_STATUS and panic if a #GP fault is injected as a result:

vmx.c:3035:d8v0 RDMSR 0x0000019c unimplemented
d8v0 VIRIDIAN CRASH: 3b c0000096 fffff8061de31651 fffff4088a613720 0

Quoted 8 lines

So handle the MSR and return 0 instead.

Note that this is done on the generic MSR handler, and PV guest will also get 0 back when trying to read the MSR. There doesn't seem to be much value in handling the MSR for HVM guests only.

Fixes 84e848fd7a1 ('x86/hvm: disallow access to unknown MSRs')
#2 lore raw
In reply to Roger Pau Monne

xen/arch/x86/msr.c int guest_rdmsr(struct vcpu *v, uint32_t msr, uint64_t *val) · line 260

Quoted 11 lines · Roger Pau Monne
xen/arch/x86/msr.c +5 -0
@@ -253,6 +253,12 @@ int guest_rdmsr(struct vcpu *v, uint32_t msr, uint64_t *val)
             break;
         goto gp_fault;
 
+    case MSR_IA32_THERM_STATUS:
+        if ( cp->x86_vendor != X86_VENDOR_INTEL )
+            goto gp_fault;
+        *val = 0;
+        break;

I've been puzzled while applying this: The upper patch context doesn't match what's been in master for about the last month, and hence I wonder what version of the tree you created this patch against. In any event please double check that I didn't screw it up.

Jan

#3 lore raw
Quoted 7 lines · Jan Beulich
Quoted 6 lines · Roger Pau Monne
xen/arch/x86/msr.c +0 -0
@@ -253,6 +253,12 @@ int guest_rdmsr(struct vcpu *v, uint32_t msr, uint64_t *val)
             break;
         goto gp_fault;
 
Quoted 10 lines

xen/arch/x86/msr.c int guest_rdmsr(struct vcpu *v, uint32_t msr, uint64_t *val) · line 260

Quoted 5 lines
xen/arch/x86/msr.c +5 -0
+    case MSR_IA32_THERM_STATUS:
+        if ( cp->x86_vendor != X86_VENDOR_INTEL )
+            goto gp_fault;
+        *val = 0;
+        break;

I've been puzzled while applying this: The upper patch context doesn't match what's been in master for about the last month, and hence I wonder what version of the tree you created this patch against. In any event please double check that I didn't screw it up.

I had this applied on top of:

https://lore.kernel.org/xen-devel/[email protected]/

Which I will reply to now because I'm not sure how to proceed there.

Thanks for fixing the context and applied.

Roger.