perf/x86/intel: Support CPUID 10.ECX to disable fixed counters
authorKan Liang <kan.liang@linux.intel.com>
Thu, 28 Jan 2021 22:40:11 +0000 (14:40 -0800)
committerPeter Zijlstra <peterz@infradead.org>
Mon, 1 Feb 2021 14:31:37 +0000 (15:31 +0100)
commit32451614da2a9cf4296f90d3606ac77814fb519d
treeeb10379172cae2e6a898e863dd98dc87ad760ad1
parent61b985e3e775a3a75fda04ce7ef1b1aefc4758bc
perf/x86/intel: Support CPUID 10.ECX to disable fixed counters

With Architectural Performance Monitoring Version 5, CPUID 10.ECX cpu
leaf indicates the fixed counter enumeration. This extends the previous
count to a bitmap which allows disabling even lower fixed counters.
It could be used by a Hypervisor.

The existing intel_ctrl variable is used to remember the bitmask of the
counters. All code that reads all counters is fixed to check this extra
bitmask.

Suggested-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Originally-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/1611873611-156687-6-git-send-email-kan.liang@linux.intel.com
arch/x86/events/core.c
arch/x86/events/intel/core.c
arch/x86/events/perf_event.h