Skip to content

Commit 780eef9

Browse files
timblechmannIngo Molnar
authored andcommitted
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=12395 Signed-off-by: Tim Blechmann <[email protected]> Signed-off-by: Robert Richter <[email protected]> LKML-Reference: <[email protected]> Cc: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
1 parent 0fc59d3 commit 780eef9

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

arch/x86/oprofile/op_model_ppro.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,18 @@ static void ppro_setup_ctrs(struct op_msrs const * const msrs)
7878
if (cpu_has_arch_perfmon) {
7979
union cpuid10_eax eax;
8080
eax.full = cpuid_eax(0xa);
81-
if (counter_width < eax.split.bit_width)
82-
counter_width = eax.split.bit_width;
81+
82+
/*
83+
* For Core2 (family 6, model 15), don't reset the
84+
* counter width:
85+
*/
86+
if (!(eax.split.version_id == 0 &&
87+
current_cpu_data.x86 == 6 &&
88+
current_cpu_data.x86_model == 15)) {
89+
90+
if (counter_width < eax.split.bit_width)
91+
counter_width = eax.split.bit_width;
92+
}
8393
}
8494

8595
/* clear all counters */

0 commit comments

Comments
 (0)