Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

x86: Rework __bug_table helpers

Rework the __bug_table helpers such that extension becomes easier.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20251110115757.111187573@infradead.org

+20 -17
+20 -17
arch/x86/include/asm/bug.h
··· 37 37 #ifdef CONFIG_GENERIC_BUG 38 38 39 39 #ifdef CONFIG_X86_32 40 - # define __BUG_REL(val) ".long " val 40 + #define __BUG_REL(val) ".long " val 41 41 #else 42 - # define __BUG_REL(val) ".long " val " - ." 42 + #define __BUG_REL(val) ".long " val " - ." 43 43 #endif 44 44 45 45 #ifdef CONFIG_DEBUG_BUGVERBOSE 46 - #define __BUG_ENTRY(file, line, flags) \ 47 - "2:\t" __BUG_REL("1b") "\t# bug_entry::bug_addr\n" \ 46 + #define __BUG_ENTRY_VERBOSE(file, line) \ 48 47 "\t" __BUG_REL(file) "\t# bug_entry::file\n" \ 49 - "\t.word " line "\t# bug_entry::line\n" \ 50 - "\t.word " flags "\t# bug_entry::flags\n" 48 + "\t.word " line "\t# bug_entry::line\n" 51 49 #else 52 - #define __BUG_ENTRY(file, line, flags) \ 53 - "2:\t" __BUG_REL("1b") "\t# bug_entry::bug_addr\n" \ 54 - "\t.word " flags "\t# bug_entry::flags\n" 50 + #define __BUG_ENTRY_VERBOSE(file, line) 55 51 #endif 52 + 53 + #define __BUG_ENTRY(file, line, flags) \ 54 + __BUG_REL("1b") "\t# bug_entry::bug_addr\n" \ 55 + __BUG_ENTRY_VERBOSE(file, line) \ 56 + "\t.word " flags "\t# bug_entry::flags\n" 56 57 57 58 #define _BUG_FLAGS_ASM(ins, file, line, flags, size, extra) \ 58 59 "1:\t" ins "\n" \ 59 - ".pushsection __bug_table,\"aw\"\n" \ 60 + ".pushsection __bug_table,\"aw\"\n\t" \ 60 61 ANNOTATE_DATA_SPECIAL \ 62 + "2:\n\t" \ 61 63 __BUG_ENTRY(file, line, flags) \ 62 64 "\t.org 2b + " size "\n" \ 63 65 ".popsection\n" \ 64 66 extra 65 67 66 - #define _BUG_FLAGS(cond_str, ins, flags, extra) \ 67 - do { \ 68 - asm_inline volatile(_BUG_FLAGS_ASM(ins, "%c0", \ 69 - "%c1", "%c2", "%c3", extra) \ 70 - : : "i" (WARN_CONDITION_STR(cond_str) __FILE__), "i" (__LINE__), \ 71 - "i" (flags), \ 72 - "i" (sizeof(struct bug_entry))); \ 68 + #define _BUG_FLAGS(cond_str, ins, flags, extra) \ 69 + do { \ 70 + asm_inline volatile(_BUG_FLAGS_ASM(ins, "%c0", \ 71 + "%c1", "%c2", "%c3", extra) \ 72 + : : "i" (WARN_CONDITION_STR(cond_str) __FILE__), \ 73 + "i" (__LINE__), \ 74 + "i" (flags), \ 75 + "i" (sizeof(struct bug_entry))); \ 73 76 } while (0) 74 77 75 78 #define ARCH_WARN_ASM(file, line, flags, size) \