diff options
| author | Sean Christopherson <[email protected]> | 2021-03-09 17:10:19 +0000 |
|---|---|---|
| committer | Peter Zijlstra <[email protected]> | 2021-03-10 15:45:09 +0000 |
| commit | c8e2fe13d1d1f3a02842b7b909d4e4846a4b6a2c (patch) | |
| tree | 61e5e05f3c0fabb39dd8db94478c402632f9cd8a /drivers/perf/arm-ccn.c | |
| parent | perf/x86/intel: Set PERF_ATTACH_SCHED_CB for large PEBS and LBR (diff) | |
| download | kernel-c8e2fe13d1d1f3a02842b7b909d4e4846a4b6a2c.tar.gz kernel-c8e2fe13d1d1f3a02842b7b909d4e4846a4b6a2c.zip | |
x86/perf: Use RET0 as default for guest_get_msrs to handle "no PMU" case
Initialize x86_pmu.guest_get_msrs to return 0/NULL to handle the "nop"
case. Patching in perf_guest_get_msrs_nop() during setup does not work
if there is no PMU, as setup bails before updating the static calls,
leaving x86_pmu.guest_get_msrs NULL and thus a complete nop. Ultimately,
this causes VMX abort on VM-Exit due to KVM putting random garbage from
the stack into the MSR load list.
Add a comment in KVM to note that nr_msrs is valid if and only if the
return value is non-NULL.
Fixes: abd562df94d1 ("x86/perf: Use static_call for x86_pmu.guest_get_msrs")
Reported-by: Dmitry Vyukov <[email protected]>
Reported-by: [email protected]
Suggested-by: Peter Zijlstra <[email protected]>
Signed-off-by: Sean Christopherson <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
Diffstat (limited to 'drivers/perf/arm-ccn.c')
0 files changed, 0 insertions, 0 deletions
