summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorPeter Zijlstra2009-03-05 20:34:21 +0100
committerIngo Molnar2009-03-05 20:37:21 +0100
commitb5e8acf66ff5db707c7e08df49fdf6b415878442 (patch)
tree79ee6e9ad1f772ebadb65307e719f980bb0bde43 /arch
parentperfcounters: IRQ and NMI support on AMD CPUs (diff)
downloadkernel-qcow2-linux-b5e8acf66ff5db707c7e08df49fdf6b415878442.tar.gz
kernel-qcow2-linux-b5e8acf66ff5db707c7e08df49fdf6b415878442.tar.xz
kernel-qcow2-linux-b5e8acf66ff5db707c7e08df49fdf6b415878442.zip
perfcounters: IRQ and NMI support on AMD CPUs, fix
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>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/cpu/perf_counter.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/arch/x86/kernel/cpu/perf_counter.c b/arch/x86/kernel/cpu/perf_counter.c
index 6ebe9abf6aef..f5853718d4d3 100644
--- a/arch/x86/kernel/cpu/perf_counter.c
+++ b/arch/x86/kernel/cpu/perf_counter.c
@@ -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");