]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86/pmu: Disallow legacy LBRs if architectural LBRs are available
authorSean Christopherson <seanjc@google.com>
Sat, 28 Jan 2023 00:14:27 +0000 (00:14 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 May 2023 09:53:27 +0000 (11:53 +0200)
commitf22f35eeaa606ed99cf274b2cd32e6a5f2f46f59
tree7ae2e38ff8005213f68b6a0fce55d46e65928a68
parent156ef0a5d1ccbe83c6c48d8571986720374d2722
KVM: x86/pmu: Disallow legacy LBRs if architectural LBRs are available

[ Upstream commit 098f4c061ea10b777033b71c10bd9fd706820ee9 ]

Disallow enabling LBR support if the CPU supports architectural LBRs.
Traditional LBR support is absent on CPU models that have architectural
LBRs, and KVM doesn't yet support arch LBRs, i.e. KVM will pass through
non-existent MSRs if userspace enables LBRs for the guest.

Cc: stable@vger.kernel.org
Cc: Yang Weijiang <weijiang.yang@intel.com>
Cc: Like Xu <like.xu.linux@gmail.com>
Reported-by: Paolo Bonzini <pbonzini@redhat.com>
Fixes: 380eacfeb74e ("KVM: vmx/pmu: Expose LBR_FMT in the MSR_IA32_PERF_CAPABILITIES")
Tested-by: Like Xu <likexu@tencent.com>
Link: https://lore.kernel.org/r/20230128001427.2548858-1-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/x86/kvm/vmx/vmx.c