diff options
author | Wanpeng Li <wanpengli@tencent.com> | 2021-11-05 08:20:51 +0100 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2021-11-11 13:09:34 +0100 |
commit | 0fe39a3929ac7af980347814d552a734b51adacf (patch) | |
tree | 38f2d76d8e3220622b11e4956480885c4fd04fe1 | |
parent | Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/t... (diff) | |
download | linux-0fe39a3929ac7af980347814d552a734b51adacf.tar.xz linux-0fe39a3929ac7af980347814d552a734b51adacf.zip |
perf/x86/lbr: Reset LBR_SELECT during vlbr reset
lbr_select in kvm guest has residual data even if kvm guest is poweroff.
We can get residual data in the next boot. Because lbr_select is not
reset during kvm vlbr release. Let's reset LBR_SELECT during vlbr reset.
Signed-off-by: Wanpeng Li <wanpengli@tencent.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/1636096851-36623-1-git-send-email-wanpengli@tencent.com
-rw-r--r-- | arch/x86/events/intel/lbr.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/events/intel/lbr.c b/arch/x86/events/intel/lbr.c index 6b72e9b55c69..8043213b75a5 100644 --- a/arch/x86/events/intel/lbr.c +++ b/arch/x86/events/intel/lbr.c @@ -265,6 +265,8 @@ void intel_pmu_lbr_reset(void) cpuc->last_task_ctx = NULL; cpuc->last_log_id = 0; + if (!static_cpu_has(X86_FEATURE_ARCH_LBR) && cpuc->lbr_select) + wrmsrl(MSR_LBR_SELECT, 0); } /* |