Commit 780eef94 authored by Tim Blechmann's avatar Tim Blechmann Committed by Ingo Molnar

x86: oprofile: don't set counter width from cpuid on Core2

Impact: fix stuck NMIs and non-working oprofile on certain CPUs

Resetting the counter width of the performance counters on Intel's
Core2 CPUs, breaks the delivery of NMIs, when running in x86_64 mode.

This should fix bug #12395:

  http://bugzilla.kernel.org/show_bug.cgi?id=12395Signed-off-by: default avatarTim Blechmann <tim@klingt.org>
Signed-off-by: default avatarRobert Richter <robert.richter@amd.com>
LKML-Reference: <20090303100412.GC10085@erda.amd.com>
Cc: <stable@kernel.org>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 0fc59d3a
...@@ -78,9 +78,19 @@ static void ppro_setup_ctrs(struct op_msrs const * const msrs) ...@@ -78,9 +78,19 @@ static void ppro_setup_ctrs(struct op_msrs const * const msrs)
if (cpu_has_arch_perfmon) { if (cpu_has_arch_perfmon) {
union cpuid10_eax eax; union cpuid10_eax eax;
eax.full = cpuid_eax(0xa); eax.full = cpuid_eax(0xa);
/*
* For Core2 (family 6, model 15), don't reset the
* counter width:
*/
if (!(eax.split.version_id == 0 &&
current_cpu_data.x86 == 6 &&
current_cpu_data.x86_model == 15)) {
if (counter_width < eax.split.bit_width) if (counter_width < eax.split.bit_width)
counter_width = eax.split.bit_width; counter_width = eax.split.bit_width;
} }
}
/* clear all counters */ /* clear all counters */
for (i = 0 ; i < num_counters; ++i) { for (i = 0 ; i < num_counters; ++i) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment