linux/arch
Vasily Gorbik ca687fdce5 s390/entry: Mark IRQ entries to fix stack depot warnings
commit 45c9f2b856 upstream.

The stack depot filters out everything outside of the top interrupt
context as an uninteresting or irrelevant part of the stack traces. This
helps with stack trace de-duplication, avoiding an explosion of saved
stack traces that share the same IRQ context code path but originate
from different randomly interrupted points, eventually exhausting the
stack depot.

Filtering uses in_irqentry_text() to identify functions within the
.irqentry.text and .softirqentry.text sections, which then become the
last stack trace entries being saved.

While __do_softirq() is placed into the .softirqentry.text section by
common code, populating .irqentry.text is architecture-specific.

Currently, the .irqentry.text section on s390 is empty, which prevents
stack depot filtering and de-duplication and could result in warnings
like:

Stack depot reached limit capacity
WARNING: CPU: 0 PID: 286113 at lib/stackdepot.c:252 depot_alloc_stack+0x39a/0x3c8

with PREEMPT and KASAN enabled.

Fix this by moving the IO/EXT interrupt handlers from .kprobes.text into
the .irqentry.text section and updating the kprobes blacklist to include
the .irqentry.text section.

This is done only for asynchronous interrupts and explicitly not for
program checks, which are synchronous and where the context beyond the
program check is important to preserve. Despite machine checks being
somewhat in between, they are extremely rare, and preserving context
when possible is also of value.

SVCs and Restart Interrupts are not relevant, one being always at the
boundary to user space and the other being a one-time thing.

IRQ entries filtering is also optionally used in ftrace function graph,
where the same logic applies.

Cc: stable@vger.kernel.org # 5.15+
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2024-12-14 19:51:23 +01:00
..
alpha alpha: remove __init annotation from exported page_is_ram() 2023-08-16 18:22:03 +02:00
arc ARC: [plat-hsdk]: Remove misplaced interrupt-cells property 2024-05-02 16:24:44 +02:00
arm ARM: dts: cubieboard4: Fix DCDC5 regulator constraints 2024-12-14 19:50:48 +01:00
arm64 arm64: tls: Fix context-switching of tpidrro_el0 when kpti is enabled 2024-12-14 19:51:17 +01:00
csky csky, hexagon: fix broken sys_sync_file_range 2024-07-05 09:14:48 +02:00
h8300 h8300: Fix build errors from do_exit() to make_task_dead() transition 2023-02-01 08:27:21 +01:00
hexagon hexagon: fix fadvise64_64 calling conventions 2024-07-05 09:14:48 +02:00
ia64 arch: Introduce CONFIG_FUNCTION_ALIGNMENT 2024-04-10 16:18:49 +02:00
m68k m68k: coldfire/device.c: only build FEC when HW macros are defined 2024-12-14 19:51:06 +01:00
microblaze microblaze: don't treat zero reserved memory regions as error 2024-10-17 15:10:38 +02:00
mips mips: asm: fix warning when disabling MIPS_FP_SUPPORT 2024-12-14 19:50:42 +01:00
nds32 exit: Add and use make_task_dead. 2023-02-01 08:27:20 +01:00
nios2 nios2: dts: Fix tse_mac "max-frame-size" property 2023-06-21 15:59:14 +02:00
openrisc openrisc: Call setup_memory() earlier in the init sequence 2024-09-04 13:23:27 +02:00
parisc parisc: fix a possible DMA corruption 2024-12-14 19:51:11 +01:00
powerpc powerpc/pseries: Fix KVM guest detection for disabling hardlockup detector 2024-12-14 19:51:13 +01:00
riscv riscv: Remove duplicated GET_RM 2024-11-08 16:25:55 +01:00
s390 s390/entry: Mark IRQ entries to fix stack depot warnings 2024-12-14 19:51:23 +01:00
sh sh: cpuinfo: Fix a warning for CONFIG_CPUMASK_OFFSTACK 2024-12-14 19:51:16 +01:00
sparc sparc64: Fix incorrect function signature and add prototype for prom_cif_init 2024-08-19 05:45:04 +02:00
um um: Always dump trace for specified task in show_stack 2024-12-14 19:51:19 +01:00
x86 crypto: x86/aegis128 - access 32-bit arguments as 32-bit 2024-12-14 19:51:13 +01:00
xtensa xtensa: boot/lib: fix function prototypes 2023-10-06 13:18:14 +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