Skip to contentSkip to conversation

Mask AMD CPUID masks in software before writing them to the MSRs.

PATCH New Tim Deegan 1 participant 1 message Feb 16, 2010

lore
Share & tools
lore

Tim Deegan

author
#0 lore raw

PATCH 1/1 Mask AMD CPUID masks in software before writing them to the MSRs.

Mask AMD CPUID masks in software before writing them to the MSRs. Setting bits in the CPUID mask MSR that are not set in the unmasked CPUID response can cause those bits to be set in the masked response. Avoid that by explicitly masking in software.

Mask AMD CPUID masks in software before writing them to the MSRs. Setting bits in the CPUID mask MSR that are not set in the unmasked CPUID response can cause those bits to be set in the masked response. Avoid that by explicitly masking in software.

xen/arch/x86/cpu/amd.c +8 -0
diff -r fea0fc811dd3 xen/arch/x86/cpu/amd.c
@@ -128,6 +128,14 @@
 		printk("CPUID will not be masked\n");
 		return;
 	}
+
+        /* Setting bits in the CPUID mask MSR that are not set in the
+         * unmasked CPUID response can cause those bits to be set in the
+         * masked response.  Avoid that by explicitly masking in software. */
+        feat_ecx &= cpuid_ecx(0x00000001);
+        feat_edx &= cpuid_edx(0x00000001);
+        extfeat_ecx &= cpuid_ecx(0x80000001);
+        extfeat_edx &= cpuid_edx(0x80000001);
 
 	status = set_mask;
 	printk("Writing CPUID feature mask ECX:EDX -> %08Xh:%08Xh\n", 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel