linux/arch/x86/events
Fernand Sieber cdb3f95a94 perf/x86/intel: Do not enable BTS for guests
commit 91dcfae0ff upstream.

By default when users program perf to sample branch instructions
(PERF_COUNT_HW_BRANCH_INSTRUCTIONS) with a sample period of 1, perf
interprets this as a special case and enables BTS (Branch Trace Store)
as an optimization to avoid taking an interrupt on every branch.

Since BTS doesn't virtualize, this optimization doesn't make sense when
the request originates from a guest. Add an additional check that
prevents this optimization for virtualized events (exclude_host).

Reported-by: Jan H. Schönherr <jschoenh@amazon.de>
Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Fernand Sieber <sieberf@amazon.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: <stable@vger.kernel.org>
Link: https://patch.msgid.link/20251211183604.868641-1-sieberf@amazon.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2026-01-30 10:32:26 +01:00
..
amd perf/x86/amd/uncore: Fix the return value of amd_uncore_df_event_init() on error 2026-01-08 10:17:01 +01:00
intel perf/x86/intel: Fix NULL event dereference crash in handle_pmi_common() 2025-12-18 14:03:41 +01:00
zhaoxin Core x86 updates for v6.16: 2025-05-26 16:04:17 -07:00
core.c perf/x86: Fix NULL event access and potential PEBS record loss 2025-12-18 14:02:52 +01:00
Kconfig perf/x86/Kconfig: Fix indentation in the Kconfig file 2022-05-25 15:54:26 +02:00
Makefile perf/x86: Move branch classifier 2022-08-27 00:05:44 +02:00
msr.c x86/msr: Add explicit includes of <asm/msr.h> 2025-05-02 10:23:47 +02:00
perf_event.h perf/x86/intel: Do not enable BTS for guests 2026-01-30 10:32:26 +01:00
perf_event_flags.h perf: Extend the bit width of the arch-specific flag 2025-04-08 20:55:49 +02:00
probe.c x86/msr: Add explicit includes of <asm/msr.h> 2025-05-02 10:23:47 +02:00
probe.h perf/x86/rapl: Add msr mask support 2021-02-10 14:44:54 +01:00
rapl.c x86/msr: Add explicit includes of <asm/msr.h> 2025-05-02 10:23:47 +02:00
utils.c x86/msr: Add explicit includes of <asm/msr.h> 2025-05-02 10:23:47 +02:00