diff options
author | Like Xu <like.xu@linux.intel.com> | 2022-04-11 12:19:36 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2022-06-08 10:47:55 +0200 |
commit | c59a1f106f5cd4843c097069ff1bb2ad72103a67 (patch) | |
tree | 6f7a1e7397e411c2137748d5ce699067aad4b6d7 /lib | |
parent | x86/perf/core: Add pebs_capable to store valid PEBS_COUNTER_MASK value (diff) | |
download | linux-c59a1f106f5cd4843c097069ff1bb2ad72103a67.tar.xz linux-c59a1f106f5cd4843c097069ff1bb2ad72103a67.zip |
KVM: x86/pmu: Add IA32_PEBS_ENABLE MSR emulation for extended PEBS
If IA32_PERF_CAPABILITIES.PEBS_BASELINE [bit 14] is set, the
IA32_PEBS_ENABLE MSR exists and all architecturally enumerated fixed
and general-purpose counters have corresponding bits in IA32_PEBS_ENABLE
that enable generation of PEBS records. The general-purpose counter bits
start at bit IA32_PEBS_ENABLE[0], and the fixed counter bits start at
bit IA32_PEBS_ENABLE[32].
When guest PEBS is enabled, the IA32_PEBS_ENABLE MSR will be
added to the perf_guest_switch_msr() and atomically switched during
the VMX transitions just like CORE_PERF_GLOBAL_CTRL MSR.
Based on whether the platform supports x86_pmu.pebs_ept, it has also
refactored the way to add more msrs to arr[] in intel_guest_get_msrs()
for extensibility.
Originally-by: Andi Kleen <ak@linux.intel.com>
Co-developed-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Co-developed-by: Luwei Kang <luwei.kang@intel.com>
Signed-off-by: Luwei Kang <luwei.kang@intel.com>
Signed-off-by: Like Xu <like.xu@linux.intel.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Message-Id: <20220411101946.20262-8-likexu@tencent.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions