Skip to content
Commit 879e7f07 authored by Like Xu's avatar Like Xu Committed by Sean Christopherson
Browse files

x86/pmu: Snapshot PMU perf_capabilities during BSP initialization



Add a global "struct pmu_caps pmu" to snapshot PMU capabilities
during the final stages of BSP initialization.  Use the new hooks to
snapshot PERF_CAPABILITIES instead of re-reading the MSR every time a
test wants to query capabilities.  A software-defined struct will also
simplify extending support to AMD CPUs, as many of the differences
between AMD and Intel can be handled during pmu_init().

Init the PMU caps for all tests so that tests don't need to remember to
call pmu_init() before using any of the PMU helpers, e.g. the nVMX test
uses this_cpu_has_pmu(), which will be converted to rely on the global
struct in a future patch.

Suggested-by: default avatarSean Christopherson <seanjc@google.com>
Signed-off-by: default avatarLike Xu <likexu@tencent.com>
[sean: reword changelog]
Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
Link: https://lore.kernel.org/r/20221102225110.3023543-16-seanjc@google.com
parent d6d3a3bd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment