Skip to content

Commit

Permalink
perfcounters: IRQ and NMI support on AMD CPUs, fix
Browse files Browse the repository at this point in the history
The BKGD suggests that counter width on AMD CPUs is 48 for all
existing models (it certainly is for mine).

Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Mar 5, 2009
1 parent b0f3f28 commit b5e8acf
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions arch/x86/kernel/cpu/perf_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -959,20 +959,8 @@ static struct pmc_x86_ops *pmc_amd_init(void)

nr_counters_generic = 4;
nr_counters_fixed = 0;
counter_value_mask = ~0ULL;

rdmsrl(MSR_K7_PERFCTR0, old);
wrmsrl(MSR_K7_PERFCTR0, counter_value_mask);
/*
* read the truncated mask
*/
rdmsrl(MSR_K7_PERFCTR0, counter_value_mask);
wrmsrl(MSR_K7_PERFCTR0, old);

bits = 32 + fls(counter_value_mask >> 32);
if (bits == 32)
bits = fls((u32)counter_value_mask);
counter_value_bits = bits;
counter_value_mask = 0x0000FFFFFFFFFFFFULL;
counter_value_bits = 48;

pr_info("AMD Performance Monitoring support detected.\n");

Expand Down

0 comments on commit b5e8acf

Please sign in to comment.