diff options
author | Sean Christopherson | 2022-10-06 00:03:07 +0000 |
---|---|---|
committer | Greg Kroah-Hartman | 2023-05-17 11:53:27 +0200 |
commit | 0457b6d04fb7f80cb3c55057dfdf5b31848b0cc9 (patch) | |
tree | 1099803ef21c084837e16183df13f393d9030f0d /COPYING | |
parent | 9239f895a85485a8e4765d1a6fd1cff6a66e4893 (diff) |
perf/x86/core: Zero @lbr instead of returning -1 in x86_perf_get_lbr() stub
[ Upstream commit 0b9ca98b722969660ad98b39f766a561ccb39f5f ]
Drop the return value from x86_perf_get_lbr() and have the stub zero out
the @lbr structure instead of returning -1 to indicate "no LBR support".
KVM doesn't actually check the return value, and instead subtly relies on
zeroing the number of LBRs in intel_pmu_init().
Formalize "nr=0 means unsupported" so that KVM doesn't need to add a
pointless check on the return value to fix KVM's benign bug.
Note, the stub is necessary even though KVM x86 selects PERF_EVENTS and
the caller exists only when CONFIG_KVM_INTEL=y. Despite the name,
KVM_INTEL doesn't strictly require CPU_SUP_INTEL, it can be built with
any of INTEL || CENTAUR || ZHAOXIN CPUs.
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20221006000314.73240-2-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Stable-dep-of: 098f4c061ea1 ("KVM: x86/pmu: Disallow legacy LBRs if architectural LBRs are available")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'COPYING')
0 files changed, 0 insertions, 0 deletions