Skip to content

Commit 0fe39a3

Browse files
Wanpeng LiPeter Zijlstra
authored andcommitted
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 <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent debe436 commit 0fe39a3

File tree

1 file changed

+2
-0
lines changed
  • arch/x86/events/intel

1 file changed

+2
-0
lines changed

arch/x86/events/intel/lbr.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,8 @@ void intel_pmu_lbr_reset(void)
265265

266266
cpuc->last_task_ctx = NULL;
267267
cpuc->last_log_id = 0;
268+
if (!static_cpu_has(X86_FEATURE_ARCH_LBR) && cpuc->lbr_select)
269+
wrmsrl(MSR_LBR_SELECT, 0);
268270
}
269271

270272
/*

0 commit comments

Comments
 (0)