From 32d35c4a96ec79446f0d7be308a6eb248b507a0b Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Tue, 20 Apr 2021 15:29:07 +0100 Subject: [PATCH] perf/x86: Allow for 8 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 Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20210420142907.382417-1-colin.king@canonical.com --- arch/x86/events/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c index 3fe66b7aa721..c7fcc8d79f01 100644 --- a/arch/x86/events/core.c +++ b/arch/x86/events/core.c @@ -278,7 +278,7 @@ bool check_hw_exists(struct pmu *pmu, int num_counters, int num_counters_fixed) for (i = 0; i < num_counters_fixed; i++) { if (fixed_counter_disabled(i, pmu)) continue; - if (val & (0x03 << i*4)) { + if (val & (0x03ULL << i*4)) { bios_fail = 1; val_fail = val; reg_fail = reg; -- 2.11.0