]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: Add support for AMD Core Perf Extension in guest
authorJanakarajan Natarajan <Janakarajan.Natarajan@amd.com>
Mon, 5 Feb 2018 19:24:52 +0000 (13:24 -0600)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 16 Mar 2018 21:01:28 +0000 (22:01 +0100)
commit29cf2df650b3120d5c5b3b30b8ae7e4012e7d50c
treefc5861192c5d2fe6058228f976bc4b5d2e934916
parent5ec4d0454f2a36f24ff8b3a669369fd8531f0fa7
KVM: x86: Add support for AMD Core Perf Extension in guest

Add support for AMD Core Performance counters in the guest. The base
event select and counter MSRs are changed. In addition, with the core
extension, there are 2 extra counters available for performance
measurements for a total of 6.

With the new MSRs, the logic to map them to the gp_counters[] is changed.
New functions are added to check the validity of the get/set MSRs.

If the guest has the X86_FEATURE_PERFCTR_CORE cpuid flag set, the number
of counters available to the vcpu is set to 6. It the flag is not set
then it is 4.

Signed-off-by: Janakarajan Natarajan <Janakarajan.Natarajan@amd.com>
[Squashed "Expose AMD Core Perf Extension flag to guests" - Radim.]
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
arch/x86/kvm/cpuid.c
arch/x86/kvm/pmu_amd.c
arch/x86/kvm/x86.c