Skip to content
Commit 5c6a67f4 authored by Like Xu's avatar Like Xu Committed by Sean Christopherson
Browse files

KVM: x86/svm/pmu: Direct access pmu->gp_counter[] to implement amd_*_to_pmc()



Access PMU counters on AMD by directly indexing the array of general
purpose counters instead of translating the PMC index to an MSR index.
AMD only supports gp counters, there's no need to translate a PMC index
to an MSR index and back to a PMC index.

Opportunistically apply array_index_nospec() to reduce the attack
surface for speculative execution and remove the dead code.

Signed-off-by: default avatarLike Xu <likexu@tencent.com>
Link: https://lore.kernel.org/r/20220831085328.45489-7-likexu@tencent.com


Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
parent cf52de61
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment