s390/bug: Provide ARCH_WARN_ASM for Rust WARN/BUG support

Rust WARN and BUG support relies on ARCH_WARN_ASM to emit __bug_table
entries. On s390 the macro is missing, so Rust code cannot generate
proper WARN/BUG metadata for the kernel's bug reporting infrastructure.

Define ARCH_WARN_ASM to produce the same assembly sequence and
__bug_table entry format as the existing s390 BUG handling, including
the monitor call. Define ARCH_WARN_REACHABLE as empty since s390 does
not provide reachability analysis for warning paths.

Acked-by: Gary Guo <gary@garyguo.net>
Acked-by: Miguel Ojeda <ojeda@kernel.org>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Jan Polensky <japo@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
This commit is contained in:
Jan Polensky 2026-06-01 19:46:20 +02:00 committed by Alexander Gordeev
parent ba6b328588
commit 184b8dc879

View File

@ -4,6 +4,7 @@
#include <linux/compiler.h>
#include <linux/const.h>
#include <linux/stringify.h>
#define MONCODE_BUG _AC(0, U)
#define MONCODE_BUG_ARG _AC(1, U)
@ -121,6 +122,17 @@ do { \
#define HAVE_ARCH_BUG_FORMAT
#define HAVE_ARCH_BUG_FORMAT_ARGS
#define ARCH_WARN_ASM(file, line, flags, size) \
".section .rodata.str,\"aMS\",@progbits,1\n" \
"9:\n" \
".asciz \"\"\n" /* Empty string for compatibility */ \
".previous\n" \
"0:\n" \
__stringify(mc 0(%r0),0) "\n" \
__BUG_ENTRY("9b", file, line, flags, size)
#define ARCH_WARN_REACHABLE
#endif /* CONFIG_BUG && CONFIG_CC_HAS_ASM_IMMEDIATE_STRINGS */
#endif /* __ASSEMBLER__ */