perf/x86/intel: Increase max number of the fixed counters
authorKan Liang <kan.liang@linux.intel.com>
Tue, 1 Feb 2022 21:23:23 +0000 (13:23 -0800)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 2 Feb 2022 12:11:44 +0000 (13:11 +0100)
commitee28855a54493ce83bc2a3fbe30210be61b57bc7
treee823959a943e147bfeb4518af0a567f6dfca6cab
parent0144ba0c5bd3176647bb4d49a697d231610c78b7
perf/x86/intel: Increase max number of the fixed counters

The new PEBS format 5 implies that the number of the fixed counters can
be up to 16. The current INTEL_PMC_MAX_FIXED is still 4. If the current
kernel runs on a future platform which has more than 4 fixed counters,
a warning will be triggered. The number of the fixed counters will be
clipped to 4. Users have to upgrade the kernel to access the new fixed
counters.

Add a new default constraint for PerfMon v5 and up, which can support
up to 16 fixed counters. The pseudo-encoding is applied for the fixed
counters 4 and later. The user can have generic support for the new
fixed counters on the future platfroms without updating the kernel.

Increase the INTEL_PMC_MAX_FIXED to 16.

Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Link: https://lkml.kernel.org/r/1643750603-100733-3-git-send-email-kan.liang@linux.intel.com
arch/x86/events/intel/core.c
arch/x86/include/asm/perf_event.h