summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2025-11-26 11:57:06 +0100
committerPeter Zijlstra <peterz@infradead.org>2025-11-27 09:32:48 +0100
commitb0a848f4a47a91a6b4d9a9fd739d047254df5a91 (patch)
treef76b50fcbc243eed4696bc73ec1ca11f4143120e /arch
parentd62e4f2b9542d25d183f068033558e87e81a00a8 (diff)
x86/bugs: Make i386 use GENERIC_BUG_RELATIVE_POINTERS
Linus figured less #ifdef is more better and making x86-32 use GENERIC_BUG_RELATIVE_POINTERS removes one layer of macro magic from the bug.h bits. Suggested-by: Linus Torvalds <torvalds@linuxfoundation.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/Kconfig2
-rw-r--r--arch/x86/include/asm/bug.h14
2 files changed, 5 insertions, 11 deletions
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index ac9692093215..31c54d6480e0 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -380,7 +380,7 @@ config GENERIC_CSUM
config GENERIC_BUG
def_bool y
depends on BUG
- select GENERIC_BUG_RELATIVE_POINTERS if X86_64
+ select GENERIC_BUG_RELATIVE_POINTERS
config GENERIC_BUG_RELATIVE_POINTERS
bool
diff --git a/arch/x86/include/asm/bug.h b/arch/x86/include/asm/bug.h
index 4b5ab56903bb..ab5bba6cf7f5 100644
--- a/arch/x86/include/asm/bug.h
+++ b/arch/x86/include/asm/bug.h
@@ -42,16 +42,10 @@ extern void __WARN_trap(struct bug_entry *bug, ...);
#ifdef CONFIG_GENERIC_BUG
-#ifdef CONFIG_X86_32
-#define __BUG_REL(val) ".long " val
-#else
-#define __BUG_REL(val) ".long " val " - ."
-#endif
-
#ifdef CONFIG_DEBUG_BUGVERBOSE
#define __BUG_ENTRY_VERBOSE(file, line) \
- "\t" __BUG_REL(file) "\t# bug_entry::file\n" \
- "\t.word " line "\t# bug_entry::line\n"
+ "\t.long " file " - .\t# bug_entry::file\n" \
+ "\t.word " line "\t# bug_entry::line\n"
#else
#define __BUG_ENTRY_VERBOSE(file, line)
#endif
@@ -59,7 +53,7 @@ extern void __WARN_trap(struct bug_entry *bug, ...);
#if defined(CONFIG_X86_64) || defined(CONFIG_DEBUG_BUGVERBOSE_DETAILED)
#define HAVE_ARCH_BUG_FORMAT
#define __BUG_ENTRY_FORMAT(format) \
- "\t" __BUG_REL(format) "\t# bug_entry::format\n"
+ "\t.long " format " - .\t# bug_entry::format\n"
#else
#define __BUG_ENTRY_FORMAT(format)
#endif
@@ -69,7 +63,7 @@ extern void __WARN_trap(struct bug_entry *bug, ...);
#endif
#define __BUG_ENTRY(format, file, line, flags) \
- __BUG_REL("1b") "\t# bug_entry::bug_addr\n" \
+ "\t.long 1b - ." "\t# bug_entry::bug_addr\n" \
__BUG_ENTRY_FORMAT(format) \
__BUG_ENTRY_VERBOSE(file, line) \
"\t.word " flags "\t# bug_entry::flags\n"