]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
x86/Intel: work around Xeon 7400 series erratum AAI65
authorJan Beulich <jbeulich@suse.com>
Mon, 17 Mar 2014 15:47:22 +0000 (16:47 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 17 Mar 2014 15:47:22 +0000 (16:47 +0100)
Linux commit 40e2d7f9b5dae048789c64672bf3027fbb663ffa ("x86 idle:
Repair large-server 50-watt idle-power regression") tells us that this
applies not just to the named Xeon 7400 series, but also NHM-EX and
WSM-EX; sadly Intel's documentation is so badly searchable that I
wasn't able to locate the respective errata (and hence can't quote
their numbers here).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
xen/arch/x86/acpi/cpu_idle.c
xen/arch/x86/cpu/intel.c
xen/include/asm-x86/cpufeature.h

index 597befa3878703a25c92c9b7d22893698131180c..ab86c75355534ec47a2c562183ecf1caa7f47aab 100644 (file)
@@ -296,6 +296,9 @@ void mwait_idle_with_hints(unsigned int eax, unsigned int ecx)
     unsigned int cpu = smp_processor_id();
     s_time_t expires = per_cpu(timer_deadline, cpu);
 
+    if ( boot_cpu_has(X86_FEATURE_CLFLUSH_MONITOR) )
+        clflush((void *)&mwait_wakeup(cpu));
+
     __monitor((void *)&mwait_wakeup(cpu), 0, 0);
     smp_mb();
 
index 9e02cf61b8c0e42686e6892f781972b45f14919f..e178b5c4181f732a3b67c58da68a6976c4d1bb26 100644 (file)
@@ -148,6 +148,9 @@ void __devinit early_intel_workaround(struct cpuinfo_x86 *c)
 /*
  * P4 Xeon errata 037 workaround.
  * Hardware prefetcher may cause stale data to be loaded into the cache.
+ *
+ * Xeon 7400 erratum AAI65 (and further newer Xeons)
+ * MONITOR/MWAIT may have excessive false wakeups
  */
 static void __devinit Intel_errata_workarounds(struct cpuinfo_x86 *c)
 {
@@ -162,6 +165,10 @@ static void __devinit Intel_errata_workarounds(struct cpuinfo_x86 *c)
                        wrmsr (MSR_IA32_MISC_ENABLE, lo, hi);
                }
        }
+
+       if (c->x86 == 6 && cpu_has_clflush &&
+           (c->x86_model == 29 || c->x86_model == 46 || c->x86_model == 47))
+               set_bit(X86_FEATURE_CLFLUSH_MONITOR, c->x86_capability);
 }
 
 
index f38fde43ce8732c539f7b74900792b597751d2ef..4bb5c69390a9459d1a45b0cc3e5ad805a2326248 100644 (file)
@@ -71,6 +71,7 @@
 #define X86_FEATURE_TSC_RELIABLE (3*32+12) /* TSC is known to be reliable */
 #define X86_FEATURE_XTOPOLOGY    (3*32+13) /* cpu topology enum extensions */
 #define X86_FEATURE_CPUID_FAULTING (3*32+14) /* cpuid faulting */
+#define X86_FEATURE_CLFLUSH_MONITOR (3*32+15) /* clflush reqd with monitor */
 
 /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */
 #define X86_FEATURE_XMM3       (4*32+ 0) /* Streaming SIMD Extensions-3 */