linux/arch
Fernand Sieber ede8ce83c2 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-02-06 16:41:58 +01:00
..
alpha alpha: don't reference obsolete termio struct for TC* constants 2026-01-19 13:10:15 +01:00
arc arc: Fix __fls() const-foldability via __builtin_clzl() 2025-12-07 06:09:16 +09:00
arm ARM: dts: imx6q-ba16: fix RTC interrupt level 2026-01-19 13:10:15 +01:00
arm64 arm64: Set __nocfi on swsusp_arch_resume() 2026-02-06 16:41:57 +01:00
csky csky: fix csky_cmpxchg_fixup not working 2026-01-19 13:10:15 +01:00
h8300 sched: Add wrapper for get_wchan() to keep task blocked 2025-08-28 16:24:03 +02:00
hexagon sched: Add wrapper for get_wchan() to keep task blocked 2025-08-28 16:24:03 +02:00
ia64 sched: Add wrapper for get_wchan() to keep task blocked 2025-08-28 16:24:03 +02:00
m68k m68k: bitops: Fix find_*_bit() signatures 2025-10-29 14:03:10 +01:00
microblaze sched: Add wrapper for get_wchan() to keep task blocked 2025-08-28 16:24:03 +02:00
mips MIPS: mm: Prevent a TLB shutdown on initial uniquification 2025-12-07 06:09:34 +09:00
nds32 sched: Add wrapper for get_wchan() to keep task blocked 2025-08-28 16:24:03 +02:00
nios2 nios2: ensure that memblock.current_limit is set when setting pfn limits 2025-10-29 14:03:10 +01:00
openrisc sched: Add wrapper for get_wchan() to keep task blocked 2025-08-28 16:24:03 +02:00
parisc parisc: entry: set W bit for !compat tasks in syscall_restore_rfi() 2026-01-19 13:10:01 +01:00
powerpc powerpc/pseries/cmm: adjust BALLOON_MIGRATE when migrating pages 2026-01-19 13:10:10 +01:00
riscv RISC-V: clear hot-unplugged cores from all task mm_cpumasks to avoid rfence errors 2025-12-07 06:09:27 +09:00
s390 s390/smp: Fix fallback CPU detection 2026-01-19 13:09:24 +01:00
sh sh: Do not use hyphen in exported variable name 2025-08-28 16:24:11 +02:00
sparc sparc/module: Add R_SPARC_UA64 relocation handling 2025-12-07 06:09:23 +09:00
um um: Fix help message for ssl-non-raw 2025-12-07 06:09:24 +09:00
x86 perf/x86/intel: Do not enable BTS for guests 2026-02-06 16:41:58 +01:00
xtensa sched: Add wrapper for get_wchan() to keep task blocked 2025-08-28 16:24:03 +02:00
.gitignore .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
Kconfig cpu: Re-enable CPU mitigations by default for !X86 architectures 2024-05-02 16:24:48 +02:00