Messages in this thread Patch in this message | | | From | Wanpeng Li <> | Subject | [PATCH] perf/x86/lbr: Reset LBR_SELECT during vlbr reset | Date | Fri, 5 Nov 2021 00:20:51 -0700 |
| |
From: Wanpeng Li <wanpengli@tencent.com>
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.
Cc: Like Xu <likexu@tencent.com> Signed-off-by: Wanpeng Li <wanpengli@tencent.com> --- arch/x86/events/intel/lbr.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/arch/x86/events/intel/lbr.c b/arch/x86/events/intel/lbr.c index 9e6d6eaeb4cb..1076de93a2f5 100644 --- a/arch/x86/events/intel/lbr.c +++ b/arch/x86/events/intel/lbr.c @@ -279,6 +279,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); } /* -- 2.25.1
| |