Skip to content

Commit f3fd84a

Browse files
liu-song-6Peter Zijlstra
authored andcommitted
x86/perf: Fix snapshot_branch_stack warning in VM
When running in VM intel_pmu_snapshot_branch_stack triggers WRMSR warning like: [ ] unchecked MSR access error: WRMSR to 0x3f1 (tried to write 0x0000000000000000) at rIP: 0xffffffff81011a5b (intel_pmu_snapshot_branch_stack+0x3b/0xd0) This can be triggered with BPF selftests: tools/testing/selftests/bpf/test_progs -t get_branch_snapshot This warning is caused by __intel_pmu_pebs_disable_all() in the VM. Since it is not necessary to disable PEBS for LBR, remove it from intel_pmu_snapshot_branch_stack and intel_pmu_snapshot_arch_branch_stack. Fixes: c22ac2a ("perf: Enable branch record for software events") Signed-off-by: Song Liu <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Tested-by: Like Xu <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent bdc0fee commit f3fd84a

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

arch/x86/events/intel/core.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2211,7 +2211,6 @@ intel_pmu_snapshot_branch_stack(struct perf_branch_entry *entries, unsigned int
22112211
/* must not have branches... */
22122212
local_irq_save(flags);
22132213
__intel_pmu_disable_all(false); /* we don't care about BTS */
2214-
__intel_pmu_pebs_disable_all();
22152214
__intel_pmu_lbr_disable();
22162215
/* ... until here */
22172216
return __intel_pmu_snapshot_branch_stack(entries, cnt, flags);
@@ -2225,7 +2224,6 @@ intel_pmu_snapshot_arch_branch_stack(struct perf_branch_entry *entries, unsigned
22252224
/* must not have branches... */
22262225
local_irq_save(flags);
22272226
__intel_pmu_disable_all(false); /* we don't care about BTS */
2228-
__intel_pmu_pebs_disable_all();
22292227
__intel_pmu_arch_lbr_disable();
22302228
/* ... until here */
22312229
return __intel_pmu_snapshot_branch_stack(entries, cnt, flags);

0 commit comments

Comments
 (0)