]> xenbits.xensource.com Git - people/liuw/xen.git/commitdiff
x86/vPMU: do not clobber IA32_MISC_ENABLE
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 7 Mar 2016 16:46:25 +0000 (17:46 +0100)
committerWei Liu <wei.liu2@citrix.com>
Tue, 15 Mar 2016 16:32:34 +0000 (16:32 +0000)
The VMX RDMSR intercept for MSR_IA32_MISC_ENABLE falls through into
vpmu_do_rdmsr(), so that core2_vpmu_do_rdmsr() may play with the PTS and PEBS
UNAVAIL bits.

Some 64bit Windows include IA32_MISC_ENABLE in the set of items checked by
PatchGuard, and will suffer a BSOD 0x109 CRITICAL_STRUCTURE_CORRUPTION if the
contents change on migrate.

The vPMU infrastructure should not clobber IA32_MISC_ENABLE at all.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
xen/arch/x86/cpu/vpmu.c

index 237b5ffd873621598a3935a73eff8b004596ac3e..2f9ddf656b74016c4d45bfc4fa684523d9c80c88 100644 (file)
@@ -169,7 +169,7 @@ int vpmu_do_msr(unsigned int msr, uint64_t *msr_content,
     return ret;
 
  nop:
-    if ( !is_write )
+    if ( !is_write && (msr != MSR_IA32_MISC_ENABLE) )
         *msr_content = 0;
 
     return 0;