linux/arch/x86/events
Colin Ian King 32d35c4a96 perf/x86: Allow for 8<num_fixed_counters<16
The 64 bit value read from MSR_ARCH_PERFMON_FIXED_CTR_CTRL is being
bit-wise masked with the value (0x03 << i*4). However, the shifted value
is evaluated using 32 bit arithmetic, so will UB when i > 8. Fix this
by making 0x03 a ULL so that the shift is performed using 64 bit
arithmetic.

This makes the arithmetic internally consistent and preparers for the
day when hardware provides 8<num_fixed_counters<16.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20210420142907.382417-1-colin.king@canonical.com
2021-04-23 09:03:15 +02:00
..
amd perf/amd/uncore: Fix sysfs type mismatch 2021-04-16 18:58:52 +02:00
intel perf/x86/cstate: Add Alder Lake CPU support 2021-04-19 20:03:29 +02:00
zhaoxin x86/perf: Fix a typo 2020-07-22 10:22:08 +02:00
core.c perf/x86: Allow for 8<num_fixed_counters<16 2021-04-23 09:03:15 +02:00
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile perf/x86/rapl: Fix RAPL config variable bug 2020-06-02 11:52:56 +02:00
msr.c perf/x86/msr: Add Alder Lake CPU support 2021-04-19 20:03:29 +02:00
perf_event.h perf/x86/intel: Add Alder Lake Hybrid support 2021-04-19 20:03:28 +02:00
probe.c perf/x86/rapl: Add msr mask support 2021-02-10 14:44:54 +01:00
probe.h perf/x86/rapl: Add msr mask support 2021-02-10 14:44:54 +01:00
rapl.c perf/x86/rapl: Add support for Intel Alder Lake 2021-04-19 20:03:30 +02:00