]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: vmx/pmu: Emulate legacy freezing LBRs on virtual PMI
authorLike Xu <like.xu@linux.intel.com>
Mon, 1 Feb 2021 05:10:36 +0000 (13:10 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 4 Feb 2021 10:27:25 +0000 (05:27 -0500)
commitedf2fa212b096b75ead598a074df7cf2b4876268
treeb885d145d233977d0b6e5105d5194d5a5a6ad3ab
parenta000c0651f844dee590f5d104211d0ef7131290e
KVM: vmx/pmu: Emulate legacy freezing LBRs on virtual PMI

The current vPMU only supports Architecture Version 2. According to
Intel SDM "17.4.7 Freezing LBR and Performance Counters on PMI", if
IA32_DEBUGCTL.Freeze_LBR_On_PMI = 1, the LBR is frozen on the virtual
PMI and the KVM would emulate to clear the LBR bit (bit 0) in
IA32_DEBUGCTL. Also, guest needs to re-enable IA32_DEBUGCTL.LBR
to resume recording branches.

Signed-off-by: Like Xu <like.xu@linux.intel.com>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Message-Id: <20210201051039.255478-9-like.xu@linux.intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/pmu.c
arch/x86/kvm/pmu.h
arch/x86/kvm/vmx/capabilities.h
arch/x86/kvm/vmx/pmu_intel.c
arch/x86/kvm/vmx/vmx.c