]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
objtool: Remove newlines and tabs from annotation macros
authorJosh Poimboeuf <jpoimboe@kernel.org>
Tue, 2 Dec 2025 17:59:39 +0000 (09:59 -0800)
committerIngo Molnar <mingo@kernel.org>
Wed, 3 Dec 2025 18:42:37 +0000 (19:42 +0100)
Remove newlines and tabs from the annotation macros so the invoking code
can insert them as needed to match the style of the surrounding code.

Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://patch.msgid.link/66305834c2eb78f082217611b756231ae9c0b555.1764694625.git.jpoimboe@kernel.org
15 files changed:
arch/x86/include/asm/alternative.h
arch/x86/include/asm/bug.h
arch/x86/include/asm/cpufeature.h
arch/x86/include/asm/irq_stack.h
arch/x86/include/asm/jump_label.h
arch/x86/include/asm/nospec-branch.h
arch/x86/include/asm/paravirt_types.h
arch/x86/include/asm/smap.h
arch/x86/include/asm/static_call.h
arch/x86/kernel/alternative.c
arch/x86/kernel/rethook.c
arch/x86/kernel/static_call.c
arch/x86/lib/error-inject.c
include/linux/annotate.h
include/linux/objtool.h

index df2c8705e17b5a01be837e136cf27f5bfcadbe11..03364510d5fe2e3695a8aa85cb1204605f40b211 100644 (file)
@@ -208,7 +208,7 @@ static inline int alternatives_text_reserved(void *start, void *end)
 
 #define ALTINSTR_REPLACEMENT(newinstr)         /* replacement */       \
        ".pushsection .altinstr_replacement, \"ax\"\n"                  \
-       ANNOTATE_DATA_SPECIAL                                           \
+       ANNOTATE_DATA_SPECIAL "\n"                                      \
        "# ALT: replacement\n"                                          \
        "774:\n\t" newinstr "\n775:\n"                                  \
        ".popsection\n"
index ab5bba6cf7f52bf817222d81bb16621580ab0af9..ee23b98353d735fd09a161ee217719d357b2c4af 100644 (file)
@@ -70,7 +70,7 @@ extern void __WARN_trap(struct bug_entry *bug, ...);
 
 #define _BUG_FLAGS_ASM(format, file, line, flags, size, extra)         \
        ".pushsection __bug_table,\"aw\"\n\t"                           \
-       ANNOTATE_DATA_SPECIAL                                           \
+       ANNOTATE_DATA_SPECIAL "\n\t"                                    \
        "2:\n\t"                                                        \
        __BUG_ENTRY(format, file, line, flags)                          \
        "\t.org 2b + " size "\n"                                        \
index fc5f32d4da6e1164c4aff92fae7e056e9d0dd97c..d8bc614f92fabcc0bf5aaedcfb587f93664fbd21 100644 (file)
@@ -101,7 +101,7 @@ static __always_inline bool _static_cpu_has(u16 bit)
        asm goto(ALTERNATIVE_TERNARY("jmp 6f", %c[feature], "", "jmp %l[t_no]")
                ".pushsection .altinstr_aux,\"ax\"\n"
                "6:\n"
-               ANNOTATE_DATA_SPECIAL
+               ANNOTATE_DATA_SPECIAL "\n"
                " testb %[bitnum], %a[cap_byte]\n"
                " jnz %l[t_yes]\n"
                " jmp %l[t_no]\n"
index 735c3a491f6047cae05f50e88359aeed8e93dc9d..8325b79f2ac6a4fd00502080d5a0e2cf186b268d 100644 (file)
 
 #define ASM_CALL_ARG0                                                  \
        "1: call %c[__func]                             \n"             \
-       ANNOTATE_REACHABLE(1b)
+       ANNOTATE_REACHABLE(1b) "                        \n"
 
 #define ASM_CALL_ARG1                                                  \
        "movq   %[arg1], %%rdi                          \n"             \
index e0a6930a4029aa0bb894c5edc32f2dae1c268e53..05b16299588d588bd96a952fee8498a0899544e9 100644 (file)
@@ -15,7 +15,7 @@
 #define JUMP_TABLE_ENTRY(key, label)                   \
        ".pushsection __jump_table,  \"aw\" \n\t"       \
        _ASM_ALIGN "\n\t"                               \
-       ANNOTATE_DATA_SPECIAL                           \
+       ANNOTATE_DATA_SPECIAL "\n"                      \
        ".long 1b - . \n\t"                             \
        ".long " label " - . \n\t"                      \
        _ASM_PTR " " key " - . \n\t"                    \
index 08ed5a2e46a5fd790bcb1b73feb6469518809c06..a5d41d8cd70a025f5b72e3770ffb3a85d18ddb64 100644 (file)
@@ -464,7 +464,7 @@ static inline void call_depth_return_thunk(void) {}
  */
 # define CALL_NOSPEC                                           \
        ALTERNATIVE_2(                                          \
-       ANNOTATE_RETPOLINE_SAFE                                 \
+       ANNOTATE_RETPOLINE_SAFE "\n"                            \
        "call *%[thunk_target]\n",                              \
        "       jmp    904f;\n"                                 \
        "       .align 16\n"                                    \
@@ -480,7 +480,7 @@ static inline void call_depth_return_thunk(void) {}
        "904:   call   901b;\n",                                \
        X86_FEATURE_RETPOLINE,                                  \
        "lfence;\n"                                             \
-       ANNOTATE_RETPOLINE_SAFE                                 \
+       ANNOTATE_RETPOLINE_SAFE "\n"                            \
        "call *%[thunk_target]\n",                              \
        X86_FEATURE_RETPOLINE_LFENCE)
 
index 37a8627d8277fbf2c1f9f1a4f4e3f2180596de1c..3502939415ad0458fb912ff3fbde1b531d8b31f5 100644 (file)
@@ -249,7 +249,7 @@ extern struct paravirt_patch_template pv_ops;
  * don't need to bother with CFI prefixes.
  */
 #define PARAVIRT_CALL                                  \
-       ANNOTATE_RETPOLINE_SAFE                         \
+       ANNOTATE_RETPOLINE_SAFE "\n\t"                  \
        "call *%[paravirt_opptr];"
 
 /*
index 4f84d421d1cf294d4fab7ede318db95c3fc55b71..cd173facecd2849fa596f5efb458cf781ffa9c87 100644 (file)
@@ -40,7 +40,7 @@ static __always_inline unsigned long smap_save(void)
        unsigned long flags;
 
        asm volatile ("# smap_save\n\t"
-                     ALTERNATIVE(ANNOTATE_IGNORE_ALTERNATIVE
+                     ALTERNATIVE(ANNOTATE_IGNORE_ALTERNATIVE "\n\t"
                                  "", "pushf; pop %0; clac",
                                  X86_FEATURE_SMAP)
                      : "=rm" (flags) : : "memory", "cc");
@@ -51,7 +51,7 @@ static __always_inline unsigned long smap_save(void)
 static __always_inline void smap_restore(unsigned long flags)
 {
        asm volatile ("# smap_restore\n\t"
-                     ALTERNATIVE(ANNOTATE_IGNORE_ALTERNATIVE
+                     ALTERNATIVE(ANNOTATE_IGNORE_ALTERNATIVE "\n\t"
                                  "", "push %0; popf",
                                  X86_FEATURE_SMAP)
                      : : "g" (flags) : "memory", "cc");
@@ -64,9 +64,9 @@ static __always_inline void smap_restore(unsigned long flags)
        ALTERNATIVE("", "stac", X86_FEATURE_SMAP)
 
 #define ASM_CLAC_UNSAFE \
-       ALTERNATIVE("", ANNOTATE_IGNORE_ALTERNATIVE "clac", X86_FEATURE_SMAP)
+       ALTERNATIVE("", ANNOTATE_IGNORE_ALTERNATIVE "\n\t" "clac", X86_FEATURE_SMAP)
 #define ASM_STAC_UNSAFE \
-       ALTERNATIVE("", ANNOTATE_IGNORE_ALTERNATIVE "stac", X86_FEATURE_SMAP)
+       ALTERNATIVE("", ANNOTATE_IGNORE_ALTERNATIVE "\n\t" "stac", X86_FEATURE_SMAP)
 
 #endif /* __ASSEMBLER__ */
 
index 41502bd2afd646cb6989901d173a8d6890e768d9..4cd725a8fe91f9e016e32dd46af0f19b8f69821e 100644 (file)
@@ -36,7 +36,7 @@
            ".align 4                                           \n"     \
            ".globl " STATIC_CALL_TRAMP_STR(name) "             \n"     \
            STATIC_CALL_TRAMP_STR(name) ":                      \n"     \
-           ANNOTATE_NOENDBR                                            \
+           ANNOTATE_NOENDBR "                                  \n"     \
            insns "                                             \n"     \
            ".byte 0x0f, 0xb9, 0xcc                             \n"     \
            ".type " STATIC_CALL_TRAMP_STR(name) ", @function   \n"     \
index e377b06e70e36d02bea1e7e9bcbac8fbbec536ba..3bda5118969fd85261b2d858ebc9b1859d58b26e 100644 (file)
@@ -2229,7 +2229,7 @@ asm (
 "      .pushsection    .init.text, \"ax\", @progbits\n"
 "      .type           int3_selftest_asm, @function\n"
 "int3_selftest_asm:\n"
-       ANNOTATE_NOENDBR
+       ANNOTATE_NOENDBR "\n"
        /*
         * INT3 padded with NOP to CALL_INSN_SIZE. The INT3 triggers an
         * exception, then the int3_exception_nb notifier emulates a call to
@@ -2247,7 +2247,7 @@ asm (
 "      .pushsection    .init.text, \"ax\", @progbits\n"
 "      .type           int3_selftest_callee, @function\n"
 "int3_selftest_callee:\n"
-       ANNOTATE_NOENDBR
+       ANNOTATE_NOENDBR "\n"
 "      movl    $0x1234, (%" _ASM_ARG1 ")\n"
        ASM_RET
 "      .size           int3_selftest_callee, . - int3_selftest_callee\n"
index 8a1c0111ae79216a72f9135189d4973440e467f6..85e2f2d16a904afefc30bade0c1e8c8ed7852372 100644 (file)
@@ -25,7 +25,7 @@ asm(
        ".type arch_rethook_trampoline, @function\n"
        "arch_rethook_trampoline:\n"
 #ifdef CONFIG_X86_64
-       ANNOTATE_NOENDBR        /* This is only jumped from ret instruction */
+       ANNOTATE_NOENDBR "\n"   /* This is only jumped from ret instruction */
        /* Push a fake return address to tell the unwinder it's a rethook. */
        "       pushq $arch_rethook_trampoline\n"
        UNWIND_HINT_FUNC
index 2892cdb145638ae75dc96bcc824b62959c7c1ec5..61592e41a6b154a108dae1c98419be9ee0f3adb0 100644 (file)
@@ -50,8 +50,8 @@ asm (".global __static_call_return\n\t"
      ".type __static_call_return, @function\n\t"
      ASM_FUNC_ALIGN "\n\t"
      "__static_call_return:\n\t"
-     ANNOTATE_NOENDBR
-     ANNOTATE_RETPOLINE_SAFE
+     ANNOTATE_NOENDBR "\n\t"
+     ANNOTATE_RETPOLINE_SAFE "\n\t"
      "ret; int3\n\t"
      ".size __static_call_return, . - __static_call_return \n\t");
 
index b5a6d83106bc2d1789d55910add79cd1a8c90236..512a2538596f08910687c1c748d55610f81c0fa8 100644 (file)
@@ -13,7 +13,7 @@ asm(
        ".globl just_return_func\n"
        ASM_FUNC_ALIGN
        "just_return_func:\n"
-               ANNOTATE_NOENDBR
+               ANNOTATE_NOENDBR "\n"
                ASM_RET
        ".size just_return_func, .-just_return_func\n"
 );
index 996126f5f9ecba47cf027d8b2e2a74b6c5d79daf..5efac5d4f9cf89156adb9df11fde4ce61c4b7b2a 100644 (file)
 #ifndef __ASSEMBLY__
 
 #define ASM_ANNOTATE_LABEL(label, type)                                        \
-       __stringify(__ASM_ANNOTATE(".discard.annotate_insn", label, type)) "\n\t"
+       __stringify(__ASM_ANNOTATE(".discard.annotate_insn", label, type))
 
 #define ASM_ANNOTATE(type)                                             \
        "911: "                                                         \
-       __stringify(__ASM_ANNOTATE(".discard.annotate_insn", 911b, type)) "\n\t"
+       __stringify(__ASM_ANNOTATE(".discard.annotate_insn", 911b, type))
 
 #define ASM_ANNOTATE_DATA(type)                                                \
        "912: "                                                         \
-       __stringify(__ASM_ANNOTATE(".discard.annotate_data", 912b, type)) "\n\t"
+       __stringify(__ASM_ANNOTATE(".discard.annotate_data", 912b, type))
 
 #else /* __ASSEMBLY__ */
 
index b18ab53561c9951fe6d481d05fe3f0794bd67e08..9a00e701454c582665a4ed79a19472fa26008dd4 100644 (file)
@@ -12,7 +12,7 @@
 #define UNWIND_HINT(type, sp_reg, sp_offset, signal)           \
        "987: \n\t"                                             \
        ".pushsection .discard.unwind_hints\n\t"                \
-       ANNOTATE_DATA_SPECIAL                                   \
+       ANNOTATE_DATA_SPECIAL "\n\t"                            \
        /* struct unwind_hint */                                \
        ".long 987b - .\n\t"                                    \
        ".short " __stringify(sp_offset) "\n\t"                 \