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

[Xen-changelog] [xen-unstable] x86: unmask CPUID levels on Intel CPUs



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1280486194 -3600
# Node ID c9e7850ec9a18d7085c7468407e175bb64513846
# Parent  754877be695ba3050f140002dbd185a27a437fcc
x86: unmask CPUID levels on Intel CPUs

If the CPUID limit bit in MSR_IA32_MISC_ENABLE is set, clear it to
make all CPUID information available. This is required for some
features to work, such as MWAIT in cpuidle, get cpu topology, XSAVE,
etc.

Signed-off-by: Wei Gang <gang.wei@xxxxxxxxx>
---
 xen/arch/x86/cpu/intel.c        |   14 ++++++++++++++
 xen/include/asm-x86/msr-index.h |    1 +
 2 files changed, 15 insertions(+)

diff -r 754877be695b -r c9e7850ec9a1 xen/arch/x86/cpu/intel.c
--- a/xen/arch/x86/cpu/intel.c  Thu Jul 29 18:58:19 2010 +0100
+++ b/xen/arch/x86/cpu/intel.c  Fri Jul 30 11:36:34 2010 +0100
@@ -90,6 +90,20 @@ void __devinit early_intel_workaround(st
        /* Netburst reports 64 bytes clflush size, but does IO in 128 bytes */
        if (c->x86 == 15 && c->x86_cache_alignment == 64)
                c->x86_cache_alignment = 128;
+
+       /* Unmask CPUID levels if masked: */
+       if (c->x86 > 6 || (c->x86 == 6 && c->x86_model >= 0xd)) {
+               u64 misc_enable;
+
+               rdmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
+
+               if (misc_enable & MSR_IA32_MISC_ENABLE_LIMIT_CPUID) {
+                       misc_enable &= ~MSR_IA32_MISC_ENABLE_LIMIT_CPUID;
+                       wrmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
+                       c->cpuid_level = cpuid_eax(0);
+                       printk("revised cpuid_level = %d\n", c->cpuid_level);
+               }
+       }
 }
 
 /*
diff -r 754877be695b -r c9e7850ec9a1 xen/include/asm-x86/msr-index.h
--- a/xen/include/asm-x86/msr-index.h   Thu Jul 29 18:58:19 2010 +0100
+++ b/xen/include/asm-x86/msr-index.h   Fri Jul 30 11:36:34 2010 +0100
@@ -324,6 +324,7 @@
 #define MSR_IA32_MISC_ENABLE_BTS_UNAVAIL  (1<<11)
 #define MSR_IA32_MISC_ENABLE_PEBS_UNAVAIL (1<<12)
 #define MSR_IA32_MISC_ENABLE_MONITOR_ENABLE (1<<18)
+#define MSR_IA32_MISC_ENABLE_LIMIT_CPUID  (1<<22)
 #define MSR_IA32_MISC_ENABLE_XTPR_DISABLE (1<<23)
 
 /* Intel Model 6 */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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