perf/x86/intel/lbr: Add the function pointers for LBR save and restore
authorKan Liang <kan.liang@linux.intel.com>
Fri, 3 Jul 2020 12:49:10 +0000 (05:49 -0700)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 8 Jul 2020 09:38:52 +0000 (11:38 +0200)
commit799571bf38fc2b4b744fa448184b5915739b10fd
tree9d9a11c263b6d232cc5f1f4d2b40be6718ae349b
parentc301b1d80ed5b806834fe0f739f028f65fb4fb16
perf/x86/intel/lbr: Add the function pointers for LBR save and restore

The MSRs of Architectural LBR are different from previous model-specific
LBR. Perf has to implement different functions to save and restore them.

The function pointers for LBR save and restore are introduced. Perf
should initialize the corresponding functions at boot time.

The generic optimizations, e.g. avoiding restore LBR if no one else
touched them, still apply for Architectural LBRs. The related codes are
not moved to model-specific functions.

Current model-specific LBR functions are set as default.

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/1593780569-62993-5-git-send-email-kan.liang@linux.intel.com
arch/x86/events/intel/core.c
arch/x86/events/intel/lbr.c
arch/x86/events/perf_event.h