* [PATCH] x86/Intel: work around Xeon 7400 series erratum AAI65
@ 2014-03-05 16:52 Jan Beulich
2014-03-05 17:08 ` Pasi Kärkkäinen
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Jan Beulich @ 2014-03-05 16:52 UTC (permalink / raw)
To: xen-devel; +Cc: Keir Fraser, Jun Nakajima, Donald D Dugger
[-- Attachment #1: Type: text/plain, Size: 2128 bytes --]
Linux commit 40e2d7f9b5dae048789c64672bf3027fbb663ffa ("x86 idle:
Repair large-server 50-watt idle-power regression") tells us that this
applie snot just to the named Xen 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>
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -335,6 +335,9 @@ void mwait_idle_with_hints(unsigned int
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();
--- a/xen/arch/x86/cpu/intel.c
+++ b/xen/arch/x86/cpu/intel.c
@@ -147,6 +147,9 @@ void __devinit early_intel_workaround(st
/*
* 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)
{
@@ -161,6 +164,10 @@ static void __devinit Intel_errata_worka
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);
}
--- a/xen/include/asm-x86/cpufeature.h
+++ b/xen/include/asm-x86/cpufeature.h
@@ -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 */
[-- Attachment #2: x86-monitor-clflush-workaround.patch --]
[-- Type: text/plain, Size: 2179 bytes --]
x86/Intel: work around Xeon 7400 series erratum AAI65
Linux commit 40e2d7f9b5dae048789c64672bf3027fbb663ffa ("x86 idle:
Repair large-server 50-watt idle-power regression") tells us that this
applie snot just to the named Xen 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>
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -335,6 +335,9 @@ void mwait_idle_with_hints(unsigned int
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();
--- a/xen/arch/x86/cpu/intel.c
+++ b/xen/arch/x86/cpu/intel.c
@@ -147,6 +147,9 @@ void __devinit early_intel_workaround(st
/*
* 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)
{
@@ -161,6 +164,10 @@ static void __devinit Intel_errata_worka
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);
}
--- a/xen/include/asm-x86/cpufeature.h
+++ b/xen/include/asm-x86/cpufeature.h
@@ -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 */
[-- Attachment #3: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] x86/Intel: work around Xeon 7400 series erratum AAI65
2014-03-05 16:52 [PATCH] x86/Intel: work around Xeon 7400 series erratum AAI65 Jan Beulich
@ 2014-03-05 17:08 ` Pasi Kärkkäinen
2014-03-06 9:38 ` Jan Beulich
2014-03-05 17:19 ` Andrew Cooper
2014-03-12 9:40 ` Ping: " Jan Beulich
2 siblings, 1 reply; 6+ messages in thread
From: Pasi Kärkkäinen @ 2014-03-05 17:08 UTC (permalink / raw)
To: Jan Beulich; +Cc: xen-devel, Keir Fraser, Donald D Dugger, Jun Nakajima
On Wed, Mar 05, 2014 at 04:52:52PM +0000, Jan Beulich wrote:
> Linux commit 40e2d7f9b5dae048789c64672bf3027fbb663ffa ("x86 idle:
> Repair large-server 50-watt idle-power regression") tells us that this
> applie snot just to the named Xen 7400 series, but also NHM-EX and
^^^
I guess that should say Xeon, not Xen..
-- Pasi
> 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>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] x86/Intel: work around Xeon 7400 series erratum AAI65
2014-03-05 16:52 [PATCH] x86/Intel: work around Xeon 7400 series erratum AAI65 Jan Beulich
2014-03-05 17:08 ` Pasi Kärkkäinen
@ 2014-03-05 17:19 ` Andrew Cooper
2014-03-12 9:40 ` Ping: " Jan Beulich
2 siblings, 0 replies; 6+ messages in thread
From: Andrew Cooper @ 2014-03-05 17:19 UTC (permalink / raw)
To: Jan Beulich; +Cc: xen-devel, Keir Fraser, Donald D Dugger, Jun Nakajima
[-- Attachment #1.1: Type: text/plain, Size: 2463 bytes --]
On 05/03/14 16:52, Jan Beulich wrote:
> Linux commit 40e2d7f9b5dae048789c64672bf3027fbb663ffa ("x86 idle:
> Repair large-server 50-watt idle-power regression") tells us that this
> applie snot just to the named Xen 7400 series, but also NHM-EX and
"applies not" "named Xeon 7400 series"
> 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>
content Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
>
> --- a/xen/arch/x86/acpi/cpu_idle.c
> +++ b/xen/arch/x86/acpi/cpu_idle.c
> @@ -335,6 +335,9 @@ void mwait_idle_with_hints(unsigned int
> 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();
>
> --- a/xen/arch/x86/cpu/intel.c
> +++ b/xen/arch/x86/cpu/intel.c
> @@ -147,6 +147,9 @@ void __devinit early_intel_workaround(st
> /*
> * 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)
> {
> @@ -161,6 +164,10 @@ static void __devinit Intel_errata_worka
> 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);
> }
>
>
> --- a/xen/include/asm-x86/cpufeature.h
> +++ b/xen/include/asm-x86/cpufeature.h
> @@ -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 */
>
>
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
[-- Attachment #1.2: Type: text/html, Size: 3478 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] x86/Intel: work around Xeon 7400 series erratum AAI65
2014-03-05 17:08 ` Pasi Kärkkäinen
@ 2014-03-06 9:38 ` Jan Beulich
0 siblings, 0 replies; 6+ messages in thread
From: Jan Beulich @ 2014-03-06 9:38 UTC (permalink / raw)
To: Pasi Kärkkäinen
Cc: xen-devel, Keir Fraser, Jun Nakajima, Donald D Dugger
>>> On 05.03.14 at 18:08, Pasi Kärkkäinen<pasik@iki.fi> wrote:
> On Wed, Mar 05, 2014 at 04:52:52PM +0000, Jan Beulich wrote:
>> Linux commit 40e2d7f9b5dae048789c64672bf3027fbb663ffa ("x86 idle:
>> Repair large-server 50-watt idle-power regression") tells us that this
>> applie snot just to the named Xen 7400 series, but also NHM-EX and
> ^^^
>
> I guess that should say Xeon, not Xen..
Oops, of course. Fixed (also the other typo on that same line).
Thanks, Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Ping: [PATCH] x86/Intel: work around Xeon 7400 series erratum AAI65
2014-03-05 16:52 [PATCH] x86/Intel: work around Xeon 7400 series erratum AAI65 Jan Beulich
2014-03-05 17:08 ` Pasi Kärkkäinen
2014-03-05 17:19 ` Andrew Cooper
@ 2014-03-12 9:40 ` Jan Beulich
2014-03-17 12:57 ` Tian, Kevin
2 siblings, 1 reply; 6+ messages in thread
From: Jan Beulich @ 2014-03-12 9:40 UTC (permalink / raw)
To: Donald D Dugger, Jun Nakajima; +Cc: xen-devel, Keir Fraser
>>> On 05.03.14 at 17:52, "Jan Beulich" <JBeulich@suse.com> wrote:
> Linux commit 40e2d7f9b5dae048789c64672bf3027fbb663ffa ("x86 idle:
> Repair large-server 50-watt idle-power regression") tells us that this
> applie snot just to the named Xen 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>
>
> --- a/xen/arch/x86/acpi/cpu_idle.c
> +++ b/xen/arch/x86/acpi/cpu_idle.c
> @@ -335,6 +335,9 @@ void mwait_idle_with_hints(unsigned int
> 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();
>
> --- a/xen/arch/x86/cpu/intel.c
> +++ b/xen/arch/x86/cpu/intel.c
> @@ -147,6 +147,9 @@ void __devinit early_intel_workaround(st
> /*
> * 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)
> {
> @@ -161,6 +164,10 @@ static void __devinit Intel_errata_worka
> 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);
> }
>
>
> --- a/xen/include/asm-x86/cpufeature.h
> +++ b/xen/include/asm-x86/cpufeature.h
> @@ -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 */
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Ping: [PATCH] x86/Intel: work around Xeon 7400 series erratum AAI65
2014-03-12 9:40 ` Ping: " Jan Beulich
@ 2014-03-17 12:57 ` Tian, Kevin
0 siblings, 0 replies; 6+ messages in thread
From: Tian, Kevin @ 2014-03-17 12:57 UTC (permalink / raw)
To: Jan Beulich, Dugger, Donald D, Nakajima, Jun; +Cc: xen-devel, Keir Fraser
> From: Jan Beulich
> Sent: Wednesday, March 12, 2014 5:40 PM
>
> >>> On 05.03.14 at 17:52, "Jan Beulich" <JBeulich@suse.com> wrote:
> > Linux commit 40e2d7f9b5dae048789c64672bf3027fbb663ffa ("x86 idle:
> > Repair large-server 50-watt idle-power regression") tells us that this
> > applie snot just to the named Xen 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>
Acked-by: Kevin Tian <kevin.tian@intel.com>
> >
> > --- a/xen/arch/x86/acpi/cpu_idle.c
> > +++ b/xen/arch/x86/acpi/cpu_idle.c
> > @@ -335,6 +335,9 @@ void mwait_idle_with_hints(unsigned int
> > 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();
> >
> > --- a/xen/arch/x86/cpu/intel.c
> > +++ b/xen/arch/x86/cpu/intel.c
> > @@ -147,6 +147,9 @@ void __devinit early_intel_workaround(st
> > /*
> > * 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)
> > {
> > @@ -161,6 +164,10 @@ static void __devinit Intel_errata_worka
> > 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);
> > }
> >
> >
> > --- a/xen/include/asm-x86/cpufeature.h
> > +++ b/xen/include/asm-x86/cpufeature.h
> > @@ -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
> */
>
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-03-17 12:57 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-05 16:52 [PATCH] x86/Intel: work around Xeon 7400 series erratum AAI65 Jan Beulich
2014-03-05 17:08 ` Pasi Kärkkäinen
2014-03-06 9:38 ` Jan Beulich
2014-03-05 17:19 ` Andrew Cooper
2014-03-12 9:40 ` Ping: " Jan Beulich
2014-03-17 12:57 ` Tian, Kevin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.