Skip to content
Commit 7a310c64 authored by Li RongQing's avatar Li RongQing Committed by Ingo Molnar
Browse files

perf/x86/intel/bts: Check if bts_ctx is allocated when calling BTS functions



bts_ctx might not be allocated, for example if the CPU has X86_FEATURE_PTI,
but intel_bts_disable/enable_local() and intel_bts_interrupt() are called
unconditionally from intel_pmu_handle_irq() and crash on bts_ctx.

So check if bts_ctx is allocated when calling BTS functions.

Fixes: 3acfcefa ("perf/x86/intel/bts: Allocate bts_ctx only if necessary")
Reported-by: default avatarJiri Olsa <olsajiri@gmail.com>
Tested-by: default avatarJiri Olsa <jolsa@kernel.org>
Suggested-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Suggested-by: default avatarDave Hansen <dave.hansen@intel.com>
Signed-off-by: default avatarLi RongQing <lirongqing@baidu.com>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20250306051102.2642-1-lirongqing@baidu.com
parent fa6192ad
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment