Skip to content

Commit

Permalink
x86: oprofile: don't set counter width from cpuid on Core2
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
timblechmann authored and Ingo Molnar committed Mar 3, 2009
1 parent 0fc59d3 commit 780eef9
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions arch/x86/oprofile/op_model_ppro.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,18 @@ static void ppro_setup_ctrs(struct op_msrs const * const msrs)
if (cpu_has_arch_perfmon) {
union cpuid10_eax eax;
eax.full = cpuid_eax(0xa);
if (counter_width < eax.split.bit_width)
counter_width = eax.split.bit_width;

/*
* 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)
counter_width = eax.split.bit_width;
}
}

/* clear all counters */
Expand Down

0 comments on commit 780eef9

Please sign in to comment.