xen/21894-intel-unmask-cpuid.patch
Charles Arnold 0c76f22ef1 - Update to Xen 4.0.2 rc2-pre, changeset 21443
- bnc#633573 - System fail to boot after running several warm
  reboot tests
  22749-vtd-workarounds.patch
- Upstream patches from Jan
  22744-ept-pod-locking.patch
  22777-vtd-ats-fixes.patch
  22781-pod-hap-logdirty.patch
  22782-x86-emul-smsw.patch
  22789-i386-no-x2apic.patch
  22790-svm-resume-migrate-pirqs.patch
  22816-x86-pirq-drop-priv-check.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=94
2011-02-04 21:19:54 +00:00

53 lines
1.9 KiB
Diff

# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1280486194 -3600
# Node ID c9e7850ec9a18d7085c7468407e175bb64513846
# Parent 754877be695ba3050f140002dbd185a27a437fcc
x86: unmask CPUID levels on Intel CPUs
References: bnc#640773
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@intel.com>
Index: xen-4.0.2-testing/xen/arch/x86/cpu/intel.c
===================================================================
--- xen-4.0.2-testing.orig/xen/arch/x86/cpu/intel.c
+++ xen-4.0.2-testing/xen/arch/x86/cpu/intel.c
@@ -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);
+ }
+ }
}
/*
Index: xen-4.0.2-testing/xen/include/asm-x86/msr-index.h
===================================================================
--- xen-4.0.2-testing.orig/xen/include/asm-x86/msr-index.h
+++ xen-4.0.2-testing/xen/include/asm-x86/msr-index.h
@@ -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 */