* [PATCH v2 0/4] objtool: Improve code generation for annotation macros
@ 2025-12-02 17:59 Josh Poimboeuf
2025-12-02 17:59 ` [PATCH v2 1/4] x86/alternative: Remove ANNOTATE_DATA_SPECIAL usage Josh Poimboeuf
` (3 more replies)
0 siblings, 4 replies; 24+ messages in thread
From: Josh Poimboeuf @ 2025-12-02 17:59 UTC (permalink / raw)
To: x86; +Cc: linux-kernel, Peter Zijlstra, Ingo Molnar
For tip/objtool/urgent (fixing a "regression" in code generation).
Changes since v1 (https://lore.kernel.org/cover.1764137163.git.jpoimboe@kernel.org):
- rebase on Linus's tree (bug.h conflicts)
As much as possible, undo the code generation damage introduced by
ANNOTATE_DATA_SPECIAL:
- Remove its usage in favor of SHF_MERGE + sh_entsize, where possible
- Print the annotation on a single line:
912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection
- Remove the trailing newline/tab; let the invoking code decide on the
appropriate separator for the given context
Josh Poimboeuf (4):
x86/alternative: Remove ANNOTATE_DATA_SPECIAL usage
x86/asm: Remove ANNOTATE_DATA_SPECIAL usage
objtool: Consolidate annotation macros
objtool: Remove newlines and tabs from annotation macros
arch/um/include/asm/Kbuild | 1 -
arch/um/include/shared/common-offsets.h | 3 ++
arch/x86/include/asm/alternative.h | 9 +++---
arch/x86/include/asm/asm.h | 25 ++++++++-------
arch/x86/include/asm/bug.h | 2 +-
arch/x86/include/asm/cpufeature.h | 2 +-
arch/x86/include/asm/irq_stack.h | 2 +-
arch/x86/include/asm/jump_label.h | 2 +-
arch/x86/include/asm/nospec-branch.h | 4 +--
arch/x86/include/asm/paravirt_types.h | 2 +-
arch/x86/include/asm/smap.h | 8 ++---
arch/x86/include/asm/static_call.h | 2 +-
arch/x86/kernel/alternative.c | 4 +--
arch/x86/kernel/asm-offsets.c | 3 ++
arch/x86/kernel/rethook.c | 2 +-
arch/x86/kernel/static_call.c | 4 +--
arch/x86/lib/error-inject.c | 2 +-
arch/x86/um/shared/sysdep/kernel-offsets.h | 2 ++
include/linux/annotate.h | 36 +++++++++-------------
include/linux/objtool.h | 2 +-
kernel/bounds.c | 1 +
scripts/mod/devicetable-offsets.c | 1 +
22 files changed, 62 insertions(+), 57 deletions(-)
--
2.51.1
^ permalink raw reply [flat|nested] 24+ messages in thread* [PATCH v2 1/4] x86/alternative: Remove ANNOTATE_DATA_SPECIAL usage 2025-12-02 17:59 [PATCH v2 0/4] objtool: Improve code generation for annotation macros Josh Poimboeuf @ 2025-12-02 17:59 ` Josh Poimboeuf 2025-12-03 16:40 ` [tip: objtool/urgent] " tip-bot2 for Josh Poimboeuf 2025-12-02 17:59 ` [PATCH v2 2/4] x86/asm: " Josh Poimboeuf ` (2 subsequent siblings) 3 siblings, 1 reply; 24+ messages in thread From: Josh Poimboeuf @ 2025-12-02 17:59 UTC (permalink / raw) To: x86; +Cc: linux-kernel, Peter Zijlstra, Ingo Molnar Instead of manually annotating each .altinstructions entry, just make the section mergeable and store the entry size in the ELF section header. Either way works for objtool create_fake_symbols(), this way produces cleaner code generation. Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org> --- arch/um/include/shared/common-offsets.h | 2 ++ arch/x86/include/asm/alternative.h | 7 +++---- arch/x86/kernel/asm-offsets.c | 2 ++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/arch/um/include/shared/common-offsets.h b/arch/um/include/shared/common-offsets.h index 8ca66a1918c3..4e19103afd71 100644 --- a/arch/um/include/shared/common-offsets.h +++ b/arch/um/include/shared/common-offsets.h @@ -18,3 +18,5 @@ DEFINE(UM_NSEC_PER_USEC, NSEC_PER_USEC); DEFINE(UM_KERN_GDT_ENTRY_TLS_ENTRIES, GDT_ENTRY_TLS_ENTRIES); DEFINE(UM_SECCOMP_ARCH_NATIVE, SECCOMP_ARCH_NATIVE); + +DEFINE(ALT_INSTR_SIZE, sizeof(struct alt_instr)); diff --git a/arch/x86/include/asm/alternative.h b/arch/x86/include/asm/alternative.h index b14c045679e1..df2c8705e17b 100644 --- a/arch/x86/include/asm/alternative.h +++ b/arch/x86/include/asm/alternative.h @@ -197,8 +197,8 @@ static inline int alternatives_text_reserved(void *start, void *end) "773:\n" #define ALTINSTR_ENTRY(ft_flags) \ - ".pushsection .altinstructions,\"a\"\n" \ - ANNOTATE_DATA_SPECIAL \ + ".pushsection .altinstructions, \"aM\", @progbits, " \ + __stringify(ALT_INSTR_SIZE) "\n" \ " .long 771b - .\n" /* label */ \ " .long 774f - .\n" /* new instruction */ \ " .4byte " __stringify(ft_flags) "\n" /* feature + flags */ \ @@ -339,7 +339,6 @@ void nop_func(void); * instruction. See apply_alternatives(). */ .macro altinstr_entry orig alt ft_flags orig_len alt_len - ANNOTATE_DATA_SPECIAL .long \orig - . .long \alt - . .4byte \ft_flags @@ -363,7 +362,7 @@ void nop_func(void); 741: \ .skip -(((744f-743f)-(741b-740b)) > 0) * ((744f-743f)-(741b-740b)),0x90 ;\ 742: \ - .pushsection .altinstructions,"a" ; \ + .pushsection .altinstructions, "aM", @progbits, ALT_INSTR_SIZE ;\ altinstr_entry 740b,743f,flag,742b-740b,744f-743f ; \ .popsection ; \ .pushsection .altinstr_replacement,"ax" ; \ diff --git a/arch/x86/kernel/asm-offsets.c b/arch/x86/kernel/asm-offsets.c index 32ba599a51f8..db3bb5143329 100644 --- a/arch/x86/kernel/asm-offsets.c +++ b/arch/x86/kernel/asm-offsets.c @@ -124,4 +124,6 @@ static void __used common(void) OFFSET(ARIA_CTX_rounds, aria_ctx, rounds); #endif + BLANK(); + DEFINE(ALT_INSTR_SIZE, sizeof(struct alt_instr)); } -- 2.51.1 ^ permalink raw reply related [flat|nested] 24+ messages in thread
* [tip: objtool/urgent] x86/alternative: Remove ANNOTATE_DATA_SPECIAL usage 2025-12-02 17:59 ` [PATCH v2 1/4] x86/alternative: Remove ANNOTATE_DATA_SPECIAL usage Josh Poimboeuf @ 2025-12-03 16:40 ` tip-bot2 for Josh Poimboeuf 0 siblings, 0 replies; 24+ messages in thread From: tip-bot2 for Josh Poimboeuf @ 2025-12-03 16:40 UTC (permalink / raw) To: linux-tip-commits Cc: Josh Poimboeuf, Ingo Molnar, Linus Torvalds, x86, linux-kernel The following commit has been merged into the objtool/urgent branch of tip: Commit-ID: a818f28f017b23cfe830dd82e89b5aa6b0fea8e5 Gitweb: https://git.kernel.org/tip/a818f28f017b23cfe830dd82e89b5aa6b0fea8e5 Author: Josh Poimboeuf <jpoimboe@kernel.org> AuthorDate: Tue, 02 Dec 2025 09:59:36 -08:00 Committer: Ingo Molnar <mingo@kernel.org> CommitterDate: Wed, 03 Dec 2025 16:53:19 +01:00 x86/alternative: Remove ANNOTATE_DATA_SPECIAL usage Instead of manually annotating each .altinstructions entry, just make the section mergeable and store the entry size in the ELF section header. Either way works for objtool create_fake_symbols(), this way produces cleaner code generation. 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/5ac04e6db5be6453dce8003a771ebb0c47b4cd7a.1764694625.git.jpoimboe@kernel.org --- arch/um/include/shared/common-offsets.h | 2 ++ arch/x86/include/asm/alternative.h | 7 +++---- arch/x86/kernel/asm-offsets.c | 2 ++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/arch/um/include/shared/common-offsets.h b/arch/um/include/shared/common-offsets.h index 8ca66a1..4e19103 100644 --- a/arch/um/include/shared/common-offsets.h +++ b/arch/um/include/shared/common-offsets.h @@ -18,3 +18,5 @@ DEFINE(UM_NSEC_PER_USEC, NSEC_PER_USEC); DEFINE(UM_KERN_GDT_ENTRY_TLS_ENTRIES, GDT_ENTRY_TLS_ENTRIES); DEFINE(UM_SECCOMP_ARCH_NATIVE, SECCOMP_ARCH_NATIVE); + +DEFINE(ALT_INSTR_SIZE, sizeof(struct alt_instr)); diff --git a/arch/x86/include/asm/alternative.h b/arch/x86/include/asm/alternative.h index b14c045..df2c870 100644 --- a/arch/x86/include/asm/alternative.h +++ b/arch/x86/include/asm/alternative.h @@ -197,8 +197,8 @@ static inline int alternatives_text_reserved(void *start, void *end) "773:\n" #define ALTINSTR_ENTRY(ft_flags) \ - ".pushsection .altinstructions,\"a\"\n" \ - ANNOTATE_DATA_SPECIAL \ + ".pushsection .altinstructions, \"aM\", @progbits, " \ + __stringify(ALT_INSTR_SIZE) "\n" \ " .long 771b - .\n" /* label */ \ " .long 774f - .\n" /* new instruction */ \ " .4byte " __stringify(ft_flags) "\n" /* feature + flags */ \ @@ -339,7 +339,6 @@ void nop_func(void); * instruction. See apply_alternatives(). */ .macro altinstr_entry orig alt ft_flags orig_len alt_len - ANNOTATE_DATA_SPECIAL .long \orig - . .long \alt - . .4byte \ft_flags @@ -363,7 +362,7 @@ void nop_func(void); 741: \ .skip -(((744f-743f)-(741b-740b)) > 0) * ((744f-743f)-(741b-740b)),0x90 ;\ 742: \ - .pushsection .altinstructions,"a" ; \ + .pushsection .altinstructions, "aM", @progbits, ALT_INSTR_SIZE ;\ altinstr_entry 740b,743f,flag,742b-740b,744f-743f ; \ .popsection ; \ .pushsection .altinstr_replacement,"ax" ; \ diff --git a/arch/x86/kernel/asm-offsets.c b/arch/x86/kernel/asm-offsets.c index 32ba599..db3bb51 100644 --- a/arch/x86/kernel/asm-offsets.c +++ b/arch/x86/kernel/asm-offsets.c @@ -124,4 +124,6 @@ static void __used common(void) OFFSET(ARIA_CTX_rounds, aria_ctx, rounds); #endif + BLANK(); + DEFINE(ALT_INSTR_SIZE, sizeof(struct alt_instr)); } ^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH v2 2/4] x86/asm: Remove ANNOTATE_DATA_SPECIAL usage 2025-12-02 17:59 [PATCH v2 0/4] objtool: Improve code generation for annotation macros Josh Poimboeuf 2025-12-02 17:59 ` [PATCH v2 1/4] x86/alternative: Remove ANNOTATE_DATA_SPECIAL usage Josh Poimboeuf @ 2025-12-02 17:59 ` Josh Poimboeuf 2025-12-03 16:40 ` [tip: objtool/urgent] " tip-bot2 for Josh Poimboeuf 2025-12-02 17:59 ` [PATCH v2 3/4] objtool: Consolidate annotation macros Josh Poimboeuf 2025-12-02 17:59 ` [PATCH v2 4/4] objtool: Remove newlines and tabs from " Josh Poimboeuf 3 siblings, 1 reply; 24+ messages in thread From: Josh Poimboeuf @ 2025-12-02 17:59 UTC (permalink / raw) To: x86; +Cc: linux-kernel, Peter Zijlstra, Ingo Molnar Instead of manually annotating each __ex_table entry, just make the section mergeable and store the entry size in the ELF section header. Either way works for objtool create_fake_symbols(), this way produces cleaner code generation. Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org> --- arch/um/include/asm/Kbuild | 1 - arch/um/include/shared/common-offsets.h | 1 + arch/x86/include/asm/asm.h | 25 ++++++++++++---------- arch/x86/kernel/asm-offsets.c | 1 + arch/x86/um/shared/sysdep/kernel-offsets.h | 2 ++ kernel/bounds.c | 1 + scripts/mod/devicetable-offsets.c | 1 + 7 files changed, 20 insertions(+), 12 deletions(-) diff --git a/arch/um/include/asm/Kbuild b/arch/um/include/asm/Kbuild index b6810db24ca4..1b9b82bbe322 100644 --- a/arch/um/include/asm/Kbuild +++ b/arch/um/include/asm/Kbuild @@ -5,7 +5,6 @@ generic-y += device.h generic-y += dma-mapping.h generic-y += emergency-restart.h generic-y += exec.h -generic-y += extable.h generic-y += ftrace.h generic-y += hw_irq.h generic-y += irq_regs.h diff --git a/arch/um/include/shared/common-offsets.h b/arch/um/include/shared/common-offsets.h index 4e19103afd71..a6f77cb6aa7e 100644 --- a/arch/um/include/shared/common-offsets.h +++ b/arch/um/include/shared/common-offsets.h @@ -20,3 +20,4 @@ DEFINE(UM_KERN_GDT_ENTRY_TLS_ENTRIES, GDT_ENTRY_TLS_ENTRIES); DEFINE(UM_SECCOMP_ARCH_NATIVE, SECCOMP_ARCH_NATIVE); DEFINE(ALT_INSTR_SIZE, sizeof(struct alt_instr)); +DEFINE(EXTABLE_SIZE, sizeof(struct exception_table_entry)); diff --git a/arch/x86/include/asm/asm.h b/arch/x86/include/asm/asm.h index bd62bd87a841..0e8c611bc9e2 100644 --- a/arch/x86/include/asm/asm.h +++ b/arch/x86/include/asm/asm.h @@ -126,18 +126,21 @@ static __always_inline __pure void *rip_rel_ptr(void *p) #ifdef __KERNEL__ +#ifndef COMPILE_OFFSETS +#include <asm/asm-offsets.h> +#endif + # include <asm/extable_fixup_types.h> /* Exception table entry */ #ifdef __ASSEMBLER__ -# define _ASM_EXTABLE_TYPE(from, to, type) \ - .pushsection "__ex_table","a" ; \ - .balign 4 ; \ - ANNOTATE_DATA_SPECIAL ; \ - .long (from) - . ; \ - .long (to) - . ; \ - .long type ; \ +# define _ASM_EXTABLE_TYPE(from, to, type) \ + .pushsection "__ex_table", "aM", @progbits, EXTABLE_SIZE ; \ + .balign 4 ; \ + .long (from) - . ; \ + .long (to) - . ; \ + .long type ; \ .popsection # ifdef CONFIG_KPROBES @@ -180,18 +183,18 @@ static __always_inline __pure void *rip_rel_ptr(void *p) ".purgem extable_type_reg\n" # define _ASM_EXTABLE_TYPE(from, to, type) \ - " .pushsection \"__ex_table\",\"a\"\n" \ + " .pushsection __ex_table, \"aM\", @progbits, " \ + __stringify(EXTABLE_SIZE) "\n" \ " .balign 4\n" \ - ANNOTATE_DATA_SPECIAL \ " .long (" #from ") - .\n" \ " .long (" #to ") - .\n" \ " .long " __stringify(type) " \n" \ " .popsection\n" # define _ASM_EXTABLE_TYPE_REG(from, to, type, reg) \ - " .pushsection \"__ex_table\",\"a\"\n" \ + " .pushsection __ex_table, \"aM\", @progbits, " \ + __stringify(EXTABLE_SIZE) "\n" \ " .balign 4\n" \ - ANNOTATE_DATA_SPECIAL \ " .long (" #from ") - .\n" \ " .long (" #to ") - .\n" \ DEFINE_EXTABLE_TYPE_REG \ diff --git a/arch/x86/kernel/asm-offsets.c b/arch/x86/kernel/asm-offsets.c index db3bb5143329..25fcde525c68 100644 --- a/arch/x86/kernel/asm-offsets.c +++ b/arch/x86/kernel/asm-offsets.c @@ -126,4 +126,5 @@ static void __used common(void) BLANK(); DEFINE(ALT_INSTR_SIZE, sizeof(struct alt_instr)); + DEFINE(EXTABLE_SIZE, sizeof(struct exception_table_entry)); } diff --git a/arch/x86/um/shared/sysdep/kernel-offsets.h b/arch/x86/um/shared/sysdep/kernel-offsets.h index 6fd1ed400399..8215a0200ddd 100644 --- a/arch/x86/um/shared/sysdep/kernel-offsets.h +++ b/arch/x86/um/shared/sysdep/kernel-offsets.h @@ -1,4 +1,5 @@ /* SPDX-License-Identifier: GPL-2.0 */ +#define COMPILE_OFFSETS #include <linux/stddef.h> #include <linux/sched.h> #include <linux/elf.h> @@ -7,6 +8,7 @@ #include <linux/audit.h> #include <asm/mman.h> #include <asm/seccomp.h> +#include <asm/extable.h> /* workaround for a warning with -Wmissing-prototypes */ void foo(void); diff --git a/kernel/bounds.c b/kernel/bounds.c index 29b2cd00df2c..02b619eb6106 100644 --- a/kernel/bounds.c +++ b/kernel/bounds.c @@ -6,6 +6,7 @@ */ #define __GENERATING_BOUNDS_H +#define COMPILE_OFFSETS /* Include headers that define the enum constants of interest */ #include <linux/page-flags.h> #include <linux/mmzone.h> diff --git a/scripts/mod/devicetable-offsets.c b/scripts/mod/devicetable-offsets.c index d3d00e85edf7..ef2ffb68f69d 100644 --- a/scripts/mod/devicetable-offsets.c +++ b/scripts/mod/devicetable-offsets.c @@ -1,4 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 +#define COMPILE_OFFSETS #include <linux/kbuild.h> #include <linux/mod_devicetable.h> -- 2.51.1 ^ permalink raw reply related [flat|nested] 24+ messages in thread
* [tip: objtool/urgent] x86/asm: Remove ANNOTATE_DATA_SPECIAL usage 2025-12-02 17:59 ` [PATCH v2 2/4] x86/asm: " Josh Poimboeuf @ 2025-12-03 16:40 ` tip-bot2 for Josh Poimboeuf 0 siblings, 0 replies; 24+ messages in thread From: tip-bot2 for Josh Poimboeuf @ 2025-12-03 16:40 UTC (permalink / raw) To: linux-tip-commits Cc: Josh Poimboeuf, Ingo Molnar, Linus Torvalds, x86, linux-kernel The following commit has been merged into the objtool/urgent branch of tip: Commit-ID: f387d0e1027f2d13cbfc1305b54198af701ede19 Gitweb: https://git.kernel.org/tip/f387d0e1027f2d13cbfc1305b54198af701ede19 Author: Josh Poimboeuf <jpoimboe@kernel.org> AuthorDate: Tue, 02 Dec 2025 09:59:37 -08:00 Committer: Ingo Molnar <mingo@kernel.org> CommitterDate: Wed, 03 Dec 2025 16:53:19 +01:00 x86/asm: Remove ANNOTATE_DATA_SPECIAL usage Instead of manually annotating each __ex_table entry, just make the section mergeable and store the entry size in the ELF section header. Either way works for objtool create_fake_symbols(), this way produces cleaner code generation. 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/b858cb7891c1ba0080e22a9c32595e6c302435e2.1764694625.git.jpoimboe@kernel.org --- arch/um/include/asm/Kbuild | 1 +- arch/um/include/shared/common-offsets.h | 1 +- arch/x86/include/asm/asm.h | 25 +++++++++++---------- arch/x86/kernel/asm-offsets.c | 1 +- arch/x86/um/shared/sysdep/kernel-offsets.h | 2 ++- kernel/bounds.c | 1 +- scripts/mod/devicetable-offsets.c | 1 +- 7 files changed, 20 insertions(+), 12 deletions(-) diff --git a/arch/um/include/asm/Kbuild b/arch/um/include/asm/Kbuild index b6810db..1b9b82b 100644 --- a/arch/um/include/asm/Kbuild +++ b/arch/um/include/asm/Kbuild @@ -5,7 +5,6 @@ generic-y += device.h generic-y += dma-mapping.h generic-y += emergency-restart.h generic-y += exec.h -generic-y += extable.h generic-y += ftrace.h generic-y += hw_irq.h generic-y += irq_regs.h diff --git a/arch/um/include/shared/common-offsets.h b/arch/um/include/shared/common-offsets.h index 4e19103..a6f77cb 100644 --- a/arch/um/include/shared/common-offsets.h +++ b/arch/um/include/shared/common-offsets.h @@ -20,3 +20,4 @@ DEFINE(UM_KERN_GDT_ENTRY_TLS_ENTRIES, GDT_ENTRY_TLS_ENTRIES); DEFINE(UM_SECCOMP_ARCH_NATIVE, SECCOMP_ARCH_NATIVE); DEFINE(ALT_INSTR_SIZE, sizeof(struct alt_instr)); +DEFINE(EXTABLE_SIZE, sizeof(struct exception_table_entry)); diff --git a/arch/x86/include/asm/asm.h b/arch/x86/include/asm/asm.h index bd62bd8..0e8c611 100644 --- a/arch/x86/include/asm/asm.h +++ b/arch/x86/include/asm/asm.h @@ -126,18 +126,21 @@ static __always_inline __pure void *rip_rel_ptr(void *p) #ifdef __KERNEL__ +#ifndef COMPILE_OFFSETS +#include <asm/asm-offsets.h> +#endif + # include <asm/extable_fixup_types.h> /* Exception table entry */ #ifdef __ASSEMBLER__ -# define _ASM_EXTABLE_TYPE(from, to, type) \ - .pushsection "__ex_table","a" ; \ - .balign 4 ; \ - ANNOTATE_DATA_SPECIAL ; \ - .long (from) - . ; \ - .long (to) - . ; \ - .long type ; \ +# define _ASM_EXTABLE_TYPE(from, to, type) \ + .pushsection "__ex_table", "aM", @progbits, EXTABLE_SIZE ; \ + .balign 4 ; \ + .long (from) - . ; \ + .long (to) - . ; \ + .long type ; \ .popsection # ifdef CONFIG_KPROBES @@ -180,18 +183,18 @@ static __always_inline __pure void *rip_rel_ptr(void *p) ".purgem extable_type_reg\n" # define _ASM_EXTABLE_TYPE(from, to, type) \ - " .pushsection \"__ex_table\",\"a\"\n" \ + " .pushsection __ex_table, \"aM\", @progbits, " \ + __stringify(EXTABLE_SIZE) "\n" \ " .balign 4\n" \ - ANNOTATE_DATA_SPECIAL \ " .long (" #from ") - .\n" \ " .long (" #to ") - .\n" \ " .long " __stringify(type) " \n" \ " .popsection\n" # define _ASM_EXTABLE_TYPE_REG(from, to, type, reg) \ - " .pushsection \"__ex_table\",\"a\"\n" \ + " .pushsection __ex_table, \"aM\", @progbits, " \ + __stringify(EXTABLE_SIZE) "\n" \ " .balign 4\n" \ - ANNOTATE_DATA_SPECIAL \ " .long (" #from ") - .\n" \ " .long (" #to ") - .\n" \ DEFINE_EXTABLE_TYPE_REG \ diff --git a/arch/x86/kernel/asm-offsets.c b/arch/x86/kernel/asm-offsets.c index db3bb51..25fcde5 100644 --- a/arch/x86/kernel/asm-offsets.c +++ b/arch/x86/kernel/asm-offsets.c @@ -126,4 +126,5 @@ static void __used common(void) BLANK(); DEFINE(ALT_INSTR_SIZE, sizeof(struct alt_instr)); + DEFINE(EXTABLE_SIZE, sizeof(struct exception_table_entry)); } diff --git a/arch/x86/um/shared/sysdep/kernel-offsets.h b/arch/x86/um/shared/sysdep/kernel-offsets.h index 6fd1ed4..8215a02 100644 --- a/arch/x86/um/shared/sysdep/kernel-offsets.h +++ b/arch/x86/um/shared/sysdep/kernel-offsets.h @@ -1,4 +1,5 @@ /* SPDX-License-Identifier: GPL-2.0 */ +#define COMPILE_OFFSETS #include <linux/stddef.h> #include <linux/sched.h> #include <linux/elf.h> @@ -7,6 +8,7 @@ #include <linux/audit.h> #include <asm/mman.h> #include <asm/seccomp.h> +#include <asm/extable.h> /* workaround for a warning with -Wmissing-prototypes */ void foo(void); diff --git a/kernel/bounds.c b/kernel/bounds.c index 29b2cd0..02b619e 100644 --- a/kernel/bounds.c +++ b/kernel/bounds.c @@ -6,6 +6,7 @@ */ #define __GENERATING_BOUNDS_H +#define COMPILE_OFFSETS /* Include headers that define the enum constants of interest */ #include <linux/page-flags.h> #include <linux/mmzone.h> diff --git a/scripts/mod/devicetable-offsets.c b/scripts/mod/devicetable-offsets.c index d3d00e8..ef2ffb6 100644 --- a/scripts/mod/devicetable-offsets.c +++ b/scripts/mod/devicetable-offsets.c @@ -1,4 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 +#define COMPILE_OFFSETS #include <linux/kbuild.h> #include <linux/mod_devicetable.h> ^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH v2 3/4] objtool: Consolidate annotation macros 2025-12-02 17:59 [PATCH v2 0/4] objtool: Improve code generation for annotation macros Josh Poimboeuf 2025-12-02 17:59 ` [PATCH v2 1/4] x86/alternative: Remove ANNOTATE_DATA_SPECIAL usage Josh Poimboeuf 2025-12-02 17:59 ` [PATCH v2 2/4] x86/asm: " Josh Poimboeuf @ 2025-12-02 17:59 ` Josh Poimboeuf 2025-12-03 16:40 ` [tip: objtool/urgent] " tip-bot2 for Josh Poimboeuf 2025-12-03 18:48 ` tip-bot2 for Josh Poimboeuf 2025-12-02 17:59 ` [PATCH v2 4/4] objtool: Remove newlines and tabs from " Josh Poimboeuf 3 siblings, 2 replies; 24+ messages in thread From: Josh Poimboeuf @ 2025-12-02 17:59 UTC (permalink / raw) To: x86; +Cc: linux-kernel, Peter Zijlstra, Ingo Molnar Consolidate __ASM_ANNOTATE into a single macro which is used by both C and asm. This also makes the code generation a bit more palatable by putting it all on a single line. Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org> --- include/linux/annotate.h | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/include/linux/annotate.h b/include/linux/annotate.h index 7c10d34d198c..996126f5f9ec 100644 --- a/include/linux/annotate.h +++ b/include/linux/annotate.h @@ -6,41 +6,35 @@ #ifdef CONFIG_OBJTOOL +#define __ASM_ANNOTATE(section, label, type) \ + .pushsection section, "M", @progbits, 8; \ + .long label - .; \ + .long type; \ + .popsection + #ifndef __ASSEMBLY__ -#define __ASM_ANNOTATE(section, label, type) \ - ".pushsection " section ",\"M\", @progbits, 8\n\t" \ - ".long " __stringify(label) " - .\n\t" \ - ".long " __stringify(type) "\n\t" \ - ".popsection\n\t" - #define ASM_ANNOTATE_LABEL(label, type) \ - __ASM_ANNOTATE(".discard.annotate_insn", label, type) + __stringify(__ASM_ANNOTATE(".discard.annotate_insn", label, type)) "\n\t" #define ASM_ANNOTATE(type) \ - "911:\n\t" \ - ASM_ANNOTATE_LABEL(911b, type) + "911: " \ + __stringify(__ASM_ANNOTATE(".discard.annotate_insn", 911b, type)) "\n\t" #define ASM_ANNOTATE_DATA(type) \ - "912:\n\t" \ - __ASM_ANNOTATE(".discard.annotate_data", 912b, type) + "912: " \ + __stringify(__ASM_ANNOTATE(".discard.annotate_data", 912b, type)) "\n\t" #else /* __ASSEMBLY__ */ -.macro __ANNOTATE section, type -.Lhere_\@: - .pushsection \section, "M", @progbits, 8 - .long .Lhere_\@ - . - .long \type - .popsection -.endm - .macro ANNOTATE type - __ANNOTATE ".discard.annotate_insn", \type +.Lhere_\@: + __ASM_ANNOTATE(".discard.annotate_insn", .Lhere_\@, \type) .endm .macro ANNOTATE_DATA type - __ANNOTATE ".discard.annotate_data", \type +.Lhere_\@: + __ASM_ANNOTATE(".discard.annotate_data", .Lhere_\@, \type) .endm #endif /* __ASSEMBLY__ */ -- 2.51.1 ^ permalink raw reply related [flat|nested] 24+ messages in thread
* [tip: objtool/urgent] objtool: Consolidate annotation macros 2025-12-02 17:59 ` [PATCH v2 3/4] objtool: Consolidate annotation macros Josh Poimboeuf @ 2025-12-03 16:40 ` tip-bot2 for Josh Poimboeuf 2025-12-03 16:49 ` Linus Torvalds 2025-12-03 18:48 ` tip-bot2 for Josh Poimboeuf 1 sibling, 1 reply; 24+ messages in thread From: tip-bot2 for Josh Poimboeuf @ 2025-12-03 16:40 UTC (permalink / raw) To: linux-tip-commits Cc: Josh Poimboeuf, Ingo Molnar, Linus Torvalds, x86, linux-kernel The following commit has been merged into the objtool/urgent branch of tip: Commit-ID: 50765fb2746db2ac1d0b4dc9033b077734807689 Gitweb: https://git.kernel.org/tip/50765fb2746db2ac1d0b4dc9033b077734807689 Author: Josh Poimboeuf <jpoimboe@kernel.org> AuthorDate: Tue, 02 Dec 2025 09:59:38 -08:00 Committer: Ingo Molnar <mingo@kernel.org> CommitterDate: Wed, 03 Dec 2025 16:53:19 +01:00 objtool: Consolidate annotation macros Consolidate __ASM_ANNOTATE into a single macro which is used by both C and asm. This also makes the code generation a bit more palatable by putting it all on a single line. 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/c05ff40d3383e85c3b59018ef0b3c7aaf993a60d.1764694625.git.jpoimboe@kernel.org --- include/linux/annotate.h | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/include/linux/annotate.h b/include/linux/annotate.h index 7c10d34..996126f 100644 --- a/include/linux/annotate.h +++ b/include/linux/annotate.h @@ -6,41 +6,35 @@ #ifdef CONFIG_OBJTOOL -#ifndef __ASSEMBLY__ - #define __ASM_ANNOTATE(section, label, type) \ - ".pushsection " section ",\"M\", @progbits, 8\n\t" \ - ".long " __stringify(label) " - .\n\t" \ - ".long " __stringify(type) "\n\t" \ - ".popsection\n\t" + .pushsection section, "M", @progbits, 8; \ + .long label - .; \ + .long type; \ + .popsection + +#ifndef __ASSEMBLY__ #define ASM_ANNOTATE_LABEL(label, type) \ - __ASM_ANNOTATE(".discard.annotate_insn", label, type) + __stringify(__ASM_ANNOTATE(".discard.annotate_insn", label, type)) "\n\t" #define ASM_ANNOTATE(type) \ - "911:\n\t" \ - ASM_ANNOTATE_LABEL(911b, type) + "911: " \ + __stringify(__ASM_ANNOTATE(".discard.annotate_insn", 911b, type)) "\n\t" #define ASM_ANNOTATE_DATA(type) \ - "912:\n\t" \ - __ASM_ANNOTATE(".discard.annotate_data", 912b, type) + "912: " \ + __stringify(__ASM_ANNOTATE(".discard.annotate_data", 912b, type)) "\n\t" #else /* __ASSEMBLY__ */ -.macro __ANNOTATE section, type -.Lhere_\@: - .pushsection \section, "M", @progbits, 8 - .long .Lhere_\@ - . - .long \type - .popsection -.endm - .macro ANNOTATE type - __ANNOTATE ".discard.annotate_insn", \type +.Lhere_\@: + __ASM_ANNOTATE(".discard.annotate_insn", .Lhere_\@, \type) .endm .macro ANNOTATE_DATA type - __ANNOTATE ".discard.annotate_data", \type +.Lhere_\@: + __ASM_ANNOTATE(".discard.annotate_data", .Lhere_\@, \type) .endm #endif /* __ASSEMBLY__ */ ^ permalink raw reply related [flat|nested] 24+ messages in thread
* Re: [tip: objtool/urgent] objtool: Consolidate annotation macros 2025-12-03 16:40 ` [tip: objtool/urgent] " tip-bot2 for Josh Poimboeuf @ 2025-12-03 16:49 ` Linus Torvalds 2025-12-03 16:57 ` Ingo Molnar 0 siblings, 1 reply; 24+ messages in thread From: Linus Torvalds @ 2025-12-03 16:49 UTC (permalink / raw) To: linux-kernel; +Cc: linux-tip-commits, Josh Poimboeuf, Ingo Molnar, x86 On Wed, 3 Dec 2025 at 08:40, tip-bot2 for Josh Poimboeuf <tip-bot2@linutronix.de> wrote: > > Consolidate __ASM_ANNOTATE into a single macro which is used by both C > and asm. This also makes the code generation a bit more palatable by > putting it all on a single line. No objections, but I just wanted to say that when stating "this makes the code generation more palatable", it would be good to actually show *how* it does it (with just an example). Because it's hard to read that diff and figure out what the actual effect is. I can just about see it, but... Linus ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [tip: objtool/urgent] objtool: Consolidate annotation macros 2025-12-03 16:49 ` Linus Torvalds @ 2025-12-03 16:57 ` Ingo Molnar 2025-12-03 17:20 ` Josh Poimboeuf 2025-12-03 17:21 ` Linus Torvalds 0 siblings, 2 replies; 24+ messages in thread From: Ingo Molnar @ 2025-12-03 16:57 UTC (permalink / raw) To: Linus Torvalds; +Cc: linux-kernel, linux-tip-commits, Josh Poimboeuf, x86 * Linus Torvalds <torvalds@linux-foundation.org> wrote: > On Wed, 3 Dec 2025 at 08:40, tip-bot2 for Josh Poimboeuf > <tip-bot2@linutronix.de> wrote: > > > > Consolidate __ASM_ANNOTATE into a single macro which is used by both C > > and asm. This also makes the code generation a bit more palatable by > > putting it all on a single line. > > No objections, but I just wanted to say that when stating "this makes > the code generation more palatable", it would be good to actually show > *how* it does it (with just an example). > > Because it's hard to read that diff and figure out what the actual > effect is. I can just about see it, but... Sorry, should have added this to the changelog. Find below a diff of the arch/x86/kernel/process.s output of your tree versus current tip:objtool/urgent. Thanks, Ingo --- process.s.linus 2025-12-03 17:52:48.210562871 +0100 +++ process.s.fixed 2025-12-03 17:53:11.003622421 +0100 @@ -13,12 +13,8 @@ .align 4 .globl __SCT__x86_idle __SCT__x86_idle: -911: - .pushsection .discard.annotate_insn,"M", @progbits, 8 - .long 911b - . - .long 1 - .popsection - jmp __x86_return_thunk +911: .pushsection ".discard.annotate_insn", "M", @progbits, 8; .long 911b - .; .long 1; .popsection +jmp __x86_return_thunk .byte 0x0f, 0xb9, 0xcc .type __SCT__x86_idle, @function .size __SCT__x86_idle, . - __SCT__x86_idle @@ -58,35 +54,22 @@ default_idle: # 107 "/home/mingo/tip/arch/x86/include/asm/paravirt.h" 1 # ALT: oldinstr 771: - 911: - .pushsection .discard.annotate_insn,"M", @progbits, 8 - .long 911b - . - .long 2 - .popsection + 911: .pushsection ".discard.annotate_insn", "M", @progbits, 8; .long 911b - .; .long 2; .popsection call *pv_ops+8(%rip); # pv_ops.irq.safe_halt 772: # ALT: padding .skip -(((775f-774f)-(772b-771b)) > 0) * ((775f-774f)-(772b-771b)),0x90 773: -.pushsection .altinstructions,"a" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 771b - . +.pushsection .altinstructions, "aM", @progbits, 14 + .long 771b - . .long 774f - . .4byte (((1 << 1) << 16) | (( 3*32+21))) .byte 773b-771b .byte 775f-774f .popsection .pushsection .altinstr_replacement, "ax" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - # ALT: replacement +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +# ALT: replacement 774: call BUG_func 775: ... @@ -139,12 +122,8 @@ mwait_idle: 1:jmp .L5 # .pushsection __jump_table, "aw" .balign 8 - 912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 1b - . + 912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +.long 1b - . .long .L5 - . # .quad cpu_buf_idle_clear + 1 - . #, .popsection @@ -183,25 +162,16 @@ mwait_idle: # ALT: padding .skip -(((775f-774f)-(772b-771b)) > 0) * ((775f-774f)-(772b-771b)),0x90 773: -.pushsection .altinstructions,"a" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 771b - . +.pushsection .altinstructions, "aM", @progbits, 14 + .long 771b - . .long 774f - . .4byte (22*32 + (7)) .byte 773b-771b .byte 775f-774f .popsection .pushsection .altinstr_replacement, "ax" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - # ALT: replacement +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +# ALT: replacement 774: clflush (%rax) # pretmp_19 775: @@ -589,14 +559,9 @@ set_cpuid_faulting: # 80 "/home/mingo/tip/arch/x86/include/asm/msr.h" 1 1: wrmsr 2: - .pushsection "__ex_table","a" + .pushsection __ex_table, "aM", @progbits, 12 .balign 4 -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long (1b) - . + .long (1b) - . .long (2b) - . .long 8 .popsection @@ -607,12 +572,8 @@ set_cpuid_faulting: 1: jmp .L32 # objtool NOPs this # .pushsection __jump_table, "aw" .balign 8 - 912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 1b - . + 912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +.long 1b - . .long .L32 - . # .quad __tracepoint_write_msr+8 + 0 + 2 - . #, .popsection @@ -807,12 +768,8 @@ arch_release_task_struct: 1: jmp .L60 # objtool NOPs this # .pushsection __jump_table, "aw" .balign 8 - 912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 1b - . + 912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +.long 1b - . .long .L60 - . # .quad __fpu_state_size_dynamic + 0 + 2 - . #, .popsection @@ -1027,25 +984,16 @@ copy_thread: # ALT: padding .skip -(((775f-774f)-(772b-771b)) > 0) * ((775f-774f)-(772b-771b)),0x90 773: -.pushsection .altinstructions,"a" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 771b - . +.pushsection .altinstructions, "aM", @progbits, 14 + .long 771b - . .long 774f - . .4byte ( 3*32+21) .byte 773b-771b .byte 775f-774f .popsection .pushsection .altinstr_replacement, "ax" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - # ALT: replacement +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +# ALT: replacement 774: jmp .L78 # 775: @@ -1055,37 +1003,24 @@ copy_thread: # ALT: padding .skip -(((775f-774f)-(772b-771b)) > 0) * ((775f-774f)-(772b-771b)),0x90 773: -.pushsection .altinstructions,"a" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 771b - . +.pushsection .altinstructions, "aM", @progbits, 14 + .long 771b - . .long 774f - . .4byte 516 # .byte 773b-771b .byte 775f-774f .popsection .pushsection .altinstr_replacement, "ax" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - # ALT: replacement +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +# ALT: replacement 774: 775: .popsection .pushsection .altinstr_aux,"ax" 6: -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - testb $16, boot_cpu_data+112(%rip) #, +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection + testb $16, boot_cpu_data+112(%rip) #, jnz .L77 # jmp .L78 # .popsection @@ -1283,25 +1218,16 @@ flush_thread: # ALT: padding .skip -(((775f-774f)-(772b-771b)) > 0) * ((775f-774f)-(772b-771b)),0x90 773: -.pushsection .altinstructions,"a" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 771b - . +.pushsection .altinstructions, "aM", @progbits, 14 + .long 771b - . .long 774f - . .4byte ( 3*32+21) .byte 773b-771b .byte 775f-774f .popsection .pushsection .altinstr_replacement, "ax" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - # ALT: replacement +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +# ALT: replacement 774: jmp .L103 # 775: @@ -1311,37 +1237,24 @@ flush_thread: # ALT: padding .skip -(((775f-774f)-(772b-771b)) > 0) * ((775f-774f)-(772b-771b)),0x90 773: -.pushsection .altinstructions,"a" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 771b - . +.pushsection .altinstructions, "aM", @progbits, 14 + .long 771b - . .long 774f - . .4byte 516 # .byte 773b-771b .byte 775f-774f .popsection .pushsection .altinstr_replacement, "ax" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - # ALT: replacement +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +# ALT: replacement 774: 775: .popsection .pushsection .altinstr_aux,"ax" 6: -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - testb $16, boot_cpu_data+112(%rip) #, +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection + testb $16, boot_cpu_data+112(%rip) #, jnz .L104 # jmp .L103 # .popsection @@ -1820,20 +1733,12 @@ native_tss_update_io_bitmap: #APP # 486 "/home/mingo/tip/arch/x86/kernel/process.c" 1 855: nop - .pushsection .discard.annotate_insn,"M", @progbits, 8 - .long 855b - . - .long 3 - .popsection - + .pushsection ".discard.annotate_insn", "M", @progbits, 8; .long 855b - .; .long 3; .popsection # 0 "" 2 # 486 "/home/mingo/tip/arch/x86/kernel/process.c" 1 1: .byte 0x0f, 0x0b ; .pushsection __bug_table,"aw" - 912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection + 912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection 2: .long 1b - . # bug_entry::bug_addr .long .LC4 - . # bug_entry::format # @@ -1842,19 +1747,11 @@ native_tss_update_io_bitmap: .word 2307 # bug_entry::flags # .org 2b + 16 # .popsection -.pushsection .discard.annotate_insn,"M", @progbits, 8 - .long 1b - . - .long 8 - .popsection - +.pushsection ".discard.annotate_insn", "M", @progbits, 8; .long 1b - .; .long 8; .popsection # 0 "" 2 # 486 "/home/mingo/tip/arch/x86/kernel/process.c" 1 856: nop - .pushsection .discard.annotate_insn,"M", @progbits, 8 - .long 856b - . - .long 4 - .popsection - + .pushsection ".discard.annotate_insn", "M", @progbits, 8; .long 856b - .; .long 4; .popsection # 0 "" 2 # /home/mingo/tip/arch/x86/include/asm/bitops.h:75: asm_inline volatile(LOCK_PREFIX "andb %b1,%0" # 75 "/home/mingo/tip/arch/x86/include/asm/bitops.h" 1 @@ -1886,11 +1783,7 @@ native_tss_update_io_bitmap: #APP # 328 "/home/mingo/tip/arch/x86/include/asm/desc.h" 1 463: nop - .pushsection .discard.annotate_insn,"M", @progbits, 8 - .long 463b - . - .long 3 - .popsection - + .pushsection ".discard.annotate_insn", "M", @progbits, 8; .long 463b - .; .long 3; .popsection # 0 "" 2 #NO_APP call debug_locks_off # @@ -1906,11 +1799,7 @@ native_tss_update_io_bitmap: #APP # 328 "/home/mingo/tip/arch/x86/include/asm/desc.h" 1 465: nop - .pushsection .discard.annotate_insn,"M", @progbits, 8 - .long 465b - . - .long 4 - .popsection - + .pushsection ".discard.annotate_insn", "M", @progbits, 8; .long 465b - .; .long 4; .popsection # 0 "" 2 #NO_APP jmp .L149 # @@ -1936,11 +1825,7 @@ native_tss_update_io_bitmap: lea (2f)(%rip), %rdi # bug 1: .pushsection __bug_table,"aw" - 912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection + 912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection 2: .long 1b - . # bug_entry::bug_addr .long .LC6 - . # bug_entry::format # @@ -2003,11 +1888,7 @@ ret_from_fork: #APP # 193 "/home/mingo/tip/include/linux/entry-common.h" 1 768: nop - .pushsection .discard.annotate_insn,"M", @progbits, 8 - .long 768b - . - .long 3 - .popsection - + .pushsection ".discard.annotate_insn", "M", @progbits, 8; .long 768b - .; .long 3; .popsection # 0 "" 2 # /home/mingo/tip/arch/x86/include/asm/current.h:23: return this_cpu_read_const(const_current_task); #NO_APP @@ -2020,12 +1901,8 @@ ret_from_fork: 1: jmp .L174 # objtool NOPs this # .pushsection __jump_table, "aw" .balign 8 - 912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 1b - . + 912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +.long 1b - . .long .L174 - . # .quad rseq_debug_enabled + 0 + 2 - . #, .popsection @@ -2062,12 +1939,8 @@ ret_from_fork: 1: jmp .L182 # objtool NOPs this # .pushsection __jump_table, "aw" .balign 8 - 912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 1b - . + 912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +.long 1b - . .long .L182 - . # .quad randomize_kstack_offset + 0 + 2 - . #, .popsection @@ -2087,25 +1960,16 @@ ret_from_fork: # ALT: padding .skip -(((775f-774f)-(772b-771b)) > 0) * ((775f-774f)-(772b-771b)),0x90 773: -.pushsection .altinstructions,"a" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 771b - . +.pushsection .altinstructions, "aM", @progbits, 14 + .long 771b - . .long 774f - . .4byte ( 3*32+21) .byte 773b-771b .byte 775f-774f .popsection .pushsection .altinstr_replacement, "ax" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - # ALT: replacement +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +# ALT: replacement 774: jmp .L185 # 775: @@ -2115,37 +1979,24 @@ ret_from_fork: # ALT: padding .skip -(((775f-774f)-(772b-771b)) > 0) * ((775f-774f)-(772b-771b)),0x90 773: -.pushsection .altinstructions,"a" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 771b - . +.pushsection .altinstructions, "aM", @progbits, 14 + .long 771b - . .long 774f - . .4byte 686 # .byte 773b-771b .byte 775f-774f .popsection .pushsection .altinstr_replacement, "ax" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - # ALT: replacement +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +# ALT: replacement 774: 775: .popsection .pushsection .altinstr_aux,"ax" 6: -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - testb $64, boot_cpu_data+133(%rip) #, +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection + testb $64, boot_cpu_data+133(%rip) #, jnz .L184 # jmp .L185 # .popsection @@ -2163,20 +2014,12 @@ ret_from_fork: #APP # 195 "/home/mingo/tip/include/linux/entry-common.h" 1 769: nop - .pushsection .discard.annotate_insn,"M", @progbits, 8 - .long 769b - . - .long 4 - .popsection - + .pushsection ".discard.annotate_insn", "M", @progbits, 8; .long 769b - .; .long 4; .popsection # 0 "" 2 # /home/mingo/tip/include/linux/irq-entry-common.h:295: instrumentation_begin(); # 295 "/home/mingo/tip/include/linux/irq-entry-common.h" 1 759: nop - .pushsection .discard.annotate_insn,"M", @progbits, 8 - .long 759b - . - .long 3 - .popsection - + .pushsection ".discard.annotate_insn", "M", @progbits, 8; .long 759b - .; .long 3; .popsection # 0 "" 2 # /home/mingo/tip/arch/x86/include/asm/atomic64_64.h:15: return __READ_ONCE((v)->counter); #NO_APP @@ -2189,11 +2032,7 @@ ret_from_fork: #APP # 299 "/home/mingo/tip/include/linux/irq-entry-common.h" 1 760: nop - .pushsection .discard.annotate_insn,"M", @progbits, 8 - .long 760b - . - .long 4 - .popsection - + .pushsection ".discard.annotate_insn", "M", @progbits, 8; .long 760b - .; .long 4; .popsection # 0 "" 2 # /home/mingo/tip/arch/x86/include/asm/processor.h:709: asm volatile(ALTERNATIVE("", "div %2\n\t", X86_BUG_DIV0) #NO_APP @@ -2209,25 +2048,16 @@ ret_from_fork: # ALT: padding .skip -(((775f-774f)-(772b-771b)) > 0) * ((775f-774f)-(772b-771b)),0x90 773: -.pushsection .altinstructions,"a" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 771b - . +.pushsection .altinstructions, "aM", @progbits, 14 + .long 771b - . .long 774f - . .4byte (22*32 + (1*32+ 1)) .byte 773b-771b .byte 775f-774f .popsection .pushsection .altinstr_replacement, "ax" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - # ALT: replacement +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +# ALT: replacement 774: div %ecx # tmp152 @@ -2280,25 +2110,16 @@ ret_from_fork: # ALT: padding .skip -(((775f-774f)-(772b-771b)) > 0) * ((775f-774f)-(772b-771b)),0x90 773: -.pushsection .altinstructions,"a" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 771b - . +.pushsection .altinstructions, "aM", @progbits, 14 + .long 771b - . .long 774f - . .4byte ( 7*32+26) .byte 773b-771b .byte 775f-774f .popsection .pushsection .altinstr_replacement, "ax" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - # ALT: replacement +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +# ALT: replacement 774: call write_ibpb 775: @@ -2534,25 +2355,16 @@ speculation_ctrl_update: # ALT: padding .skip -(((775f-774f)-(772b-771b)) > 0) * ((775f-774f)-(772b-771b)),0x90 773: -.pushsection .altinstructions,"a" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 771b - . +.pushsection .altinstructions, "aM", @progbits, 14 + .long 771b - . .long 774f - . .4byte ( 3*32+21) .byte 773b-771b .byte 775f-774f .popsection .pushsection .altinstr_replacement, "ax" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - # ALT: replacement +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +# ALT: replacement 774: jmp .L234 # 775: @@ -2562,37 +2374,24 @@ speculation_ctrl_update: # ALT: padding .skip -(((775f-774f)-(772b-771b)) > 0) * ((775f-774f)-(772b-771b)),0x90 773: -.pushsection .altinstructions,"a" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 771b - . +.pushsection .altinstructions, "aM", @progbits, 14 + .long 771b - . .long 774f - . .4byte 441 # .byte 773b-771b .byte 775f-774f .popsection .pushsection .altinstr_replacement, "ax" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - # ALT: replacement +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +# ALT: replacement 774: 775: .popsection .pushsection .altinstr_aux,"ax" 6: -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - testb $2, boot_cpu_data+103(%rip) #, +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection + testb $2, boot_cpu_data+103(%rip) #, jnz .L235 # jmp .L234 # .popsection @@ -2613,14 +2412,9 @@ speculation_ctrl_update: # 80 "/home/mingo/tip/arch/x86/include/asm/msr.h" 1 1: wrmsr 2: - .pushsection "__ex_table","a" + .pushsection __ex_table, "aM", @progbits, 12 .balign 4 -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long (1b) - . + .long (1b) - . .long (2b) - . .long 8 .popsection @@ -2631,12 +2425,8 @@ speculation_ctrl_update: 1: jmp .L239 # objtool NOPs this # .pushsection __jump_table, "aw" .balign 8 - 912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 1b - . + 912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +.long 1b - . .long .L239 - . # .quad __tracepoint_write_msr+8 + 0 + 2 - . #, .popsection @@ -2653,12 +2443,8 @@ speculation_ctrl_update: 1: jmp .L257 # objtool NOPs this # .pushsection __jump_table, "aw" .balign 8 - 912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 1b - . + 912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +.long 1b - . .long .L257 - . # .quad switch_to_cond_stibp + 0 + 2 - . #, .popsection @@ -2708,25 +2494,16 @@ speculation_ctrl_update: # ALT: padding .skip -(((775f-774f)-(772b-771b)) > 0) * ((775f-774f)-(772b-771b)),0x90 773: -.pushsection .altinstructions,"a" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 771b - . +.pushsection .altinstructions, "aM", @progbits, 14 + .long 771b - . .long 774f - . .4byte ( 3*32+21) .byte 773b-771b .byte 775f-774f .popsection .pushsection .altinstr_replacement, "ax" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - # ALT: replacement +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +# ALT: replacement 774: jmp .L237 # 775: @@ -2736,37 +2513,24 @@ speculation_ctrl_update: # ALT: padding .skip -(((775f-774f)-(772b-771b)) > 0) * ((775f-774f)-(772b-771b)),0x90 773: -.pushsection .altinstructions,"a" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 771b - . +.pushsection .altinstructions, "aM", @progbits, 14 + .long 771b - . .long 774f - . .4byte 248 # .byte 773b-771b .byte 775f-774f .popsection .pushsection .altinstr_replacement, "ax" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - # ALT: replacement +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +# ALT: replacement 774: 775: .popsection .pushsection .altinstr_aux,"ax" 6: -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - testb $1, boot_cpu_data+79(%rip) #, +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection + testb $1, boot_cpu_data+79(%rip) #, jnz .L238 # jmp .L237 # .popsection @@ -2792,25 +2556,16 @@ speculation_ctrl_update: # ALT: padding .skip -(((775f-774f)-(772b-771b)) > 0) * ((775f-774f)-(772b-771b)),0x90 773: -.pushsection .altinstructions,"a" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 771b - . +.pushsection .altinstructions, "aM", @progbits, 14 + .long 771b - . .long 774f - . .4byte ( 3*32+21) .byte 773b-771b .byte 775f-774f .popsection .pushsection .altinstr_replacement, "ax" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - # ALT: replacement +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +# ALT: replacement 774: jmp .L245 # 775: @@ -2820,37 +2575,24 @@ speculation_ctrl_update: # ALT: padding .skip -(((775f-774f)-(772b-771b)) > 0) * ((775f-774f)-(772b-771b)),0x90 773: -.pushsection .altinstructions,"a" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 771b - . +.pushsection .altinstructions, "aM", @progbits, 14 + .long 771b - . .long 774f - . .4byte 252 # .byte 773b-771b .byte 775f-774f .popsection .pushsection .altinstr_replacement, "ax" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - # ALT: replacement +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +# ALT: replacement 774: 775: .popsection .pushsection .altinstr_aux,"ax" 6: -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - testb $16, boot_cpu_data+79(%rip) #, +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection + testb $16, boot_cpu_data+79(%rip) #, jnz .L244 # jmp .L245 # .popsection @@ -2919,25 +2661,16 @@ speculation_ctrl_update: # ALT: padding .skip -(((775f-774f)-(772b-771b)) > 0) * ((775f-774f)-(772b-771b)),0x90 773: -.pushsection .altinstructions,"a" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 771b - . +.pushsection .altinstructions, "aM", @progbits, 14 + .long 771b - . .long 774f - . .4byte ( 3*32+21) .byte 773b-771b .byte 775f-774f .popsection .pushsection .altinstr_replacement, "ax" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - # ALT: replacement +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +# ALT: replacement 774: jmp .L242 # 775: @@ -2947,37 +2680,24 @@ speculation_ctrl_update: # ALT: padding .skip -(((775f-774f)-(772b-771b)) > 0) * ((775f-774f)-(772b-771b)),0x90 773: -.pushsection .altinstructions,"a" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 771b - . +.pushsection .altinstructions, "aM", @progbits, 14 + .long 771b - . .long 774f - . .4byte 607 # .byte 773b-771b .byte 775f-774f .popsection .pushsection .altinstr_replacement, "ax" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - # ALT: replacement +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +# ALT: replacement 774: 775: .popsection .pushsection .altinstr_aux,"ax" 6: -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - testb $128, boot_cpu_data+123(%rip) #, +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection + testb $128, boot_cpu_data+123(%rip) #, jnz .L243 # jmp .L242 # .popsection @@ -3022,14 +2742,9 @@ speculation_ctrl_update: # 80 "/home/mingo/tip/arch/x86/include/asm/msr.h" 1 1: wrmsr 2: - .pushsection "__ex_table","a" + .pushsection __ex_table, "aM", @progbits, 12 .balign 4 -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long (1b) - . + .long (1b) - . .long (2b) - . .long 8 .popsection @@ -3040,12 +2755,8 @@ speculation_ctrl_update: 1: jmp .L250 # objtool NOPs this # .pushsection __jump_table, "aw" .balign 8 - 912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 1b - . + 912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +.long 1b - . .long .L250 - . # .quad __tracepoint_write_msr+8 + 0 + 2 - . #, .popsection @@ -3066,25 +2777,16 @@ speculation_ctrl_update: # ALT: padding .skip -(((775f-774f)-(772b-771b)) > 0) * ((775f-774f)-(772b-771b)),0x90 773: -.pushsection .altinstructions,"a" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 771b - . +.pushsection .altinstructions, "aM", @progbits, 14 + .long 771b - . .long 774f - . .4byte ( 3*32+21) .byte 773b-771b .byte 775f-774f .popsection .pushsection .altinstr_replacement, "ax" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - # ALT: replacement +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +# ALT: replacement 774: jmp .L240 # 775: @@ -3094,37 +2796,24 @@ speculation_ctrl_update: # ALT: padding .skip -(((775f-774f)-(772b-771b)) > 0) * ((775f-774f)-(772b-771b)),0x90 773: -.pushsection .altinstructions,"a" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 771b - . +.pushsection .altinstructions, "aM", @progbits, 14 + .long 771b - . .long 774f - . .4byte 440 # .byte 773b-771b .byte 775f-774f .popsection .pushsection .altinstr_replacement, "ax" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - # ALT: replacement +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +# ALT: replacement 774: 775: .popsection .pushsection .altinstr_aux,"ax" 6: -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - testb $1, boot_cpu_data+103(%rip) #, +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection + testb $1, boot_cpu_data+103(%rip) #, jnz .L243 # jmp .L240 # .popsection @@ -3197,14 +2886,9 @@ speculation_ctrl_update: # 80 "/home/mingo/tip/arch/x86/include/asm/msr.h" 1 1: wrmsr 2: - .pushsection "__ex_table","a" + .pushsection __ex_table, "aM", @progbits, 12 .balign 4 -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long (1b) - . + .long (1b) - . .long (2b) - . .long 8 .popsection @@ -3215,12 +2899,8 @@ speculation_ctrl_update: 1: jmp .L254 # objtool NOPs this # .pushsection __jump_table, "aw" .balign 8 - 912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 1b - . + 912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +.long 1b - . .long .L254 - . # .quad __tracepoint_write_msr+8 + 0 + 2 - . #, .popsection @@ -3243,14 +2923,9 @@ speculation_ctrl_update: # 80 "/home/mingo/tip/arch/x86/include/asm/msr.h" 1 1: wrmsr 2: - .pushsection "__ex_table","a" + .pushsection __ex_table, "aM", @progbits, 12 .balign 4 -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long (1b) - . + .long (1b) - . .long (2b) - . .long 8 .popsection @@ -3261,12 +2936,8 @@ speculation_ctrl_update: 1: jmp .L252 # objtool NOPs this # .pushsection __jump_table, "aw" .balign 8 - 912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 1b - . + 912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +.long 1b - . .long .L252 - . # .quad __tracepoint_write_msr+8 + 0 + 2 - . #, .popsection @@ -3551,14 +3222,9 @@ __switch_to_xtra: # 70 "/home/mingo/tip/arch/x86/include/asm/msr.h" 1 1: rdmsr 2: - .pushsection "__ex_table","a" + .pushsection __ex_table, "aM", @progbits, 12 .balign 4 -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long (1b) - . + .long (1b) - . .long (2b) - . .long 9 .popsection @@ -3574,12 +3240,8 @@ __switch_to_xtra: 1: jmp .L310 # objtool NOPs this # .pushsection __jump_table, "aw" .balign 8 - 912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 1b - . + 912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +.long 1b - . .long .L310 - . # .quad __tracepoint_read_msr+8 + 0 + 2 - . #, .popsection @@ -3606,14 +3268,9 @@ __switch_to_xtra: # 80 "/home/mingo/tip/arch/x86/include/asm/msr.h" 1 1: wrmsr 2: - .pushsection "__ex_table","a" + .pushsection __ex_table, "aM", @progbits, 12 .balign 4 -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long (1b) - . + .long (1b) - . .long (2b) - . .long 8 .popsection @@ -3624,12 +3281,8 @@ __switch_to_xtra: 1: jmp .L312 # objtool NOPs this # .pushsection __jump_table, "aw" .balign 8 - 912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 1b - . + 912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +.long 1b - . .long .L312 - . # .quad __tracepoint_write_msr+8 + 0 + 2 - . #, .popsection @@ -3665,25 +3318,16 @@ __switch_to_xtra: # ALT: padding .skip -(((775f-774f)-(772b-771b)) > 0) * ((775f-774f)-(772b-771b)),0x90 773: -.pushsection .altinstructions,"a" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 771b - . +.pushsection .altinstructions, "aM", @progbits, 14 + .long 771b - . .long 774f - . .4byte ( 3*32+21) .byte 773b-771b .byte 775f-774f .popsection .pushsection .altinstr_replacement, "ax" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - # ALT: replacement +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +# ALT: replacement 774: jmp .L318 # 775: @@ -3693,37 +3337,24 @@ __switch_to_xtra: # ALT: padding .skip -(((775f-774f)-(772b-771b)) > 0) * ((775f-774f)-(772b-771b)),0x90 773: -.pushsection .altinstructions,"a" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 771b - . +.pushsection .altinstructions, "aM", @progbits, 14 + .long 771b - . .long 774f - . .4byte 441 # .byte 773b-771b .byte 775f-774f .popsection .pushsection .altinstr_replacement, "ax" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - # ALT: replacement +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +# ALT: replacement 774: 775: .popsection .pushsection .altinstr_aux,"ax" 6: -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - testb $2, boot_cpu_data+103(%rip) #, +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection + testb $2, boot_cpu_data+103(%rip) #, jnz .L317 # jmp .L318 # .popsection @@ -3744,12 +3375,8 @@ __switch_to_xtra: 1: jmp .L342 # objtool NOPs this # .pushsection __jump_table, "aw" .balign 8 - 912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 1b - . + 912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +.long 1b - . .long .L342 - . # .quad switch_to_cond_stibp + 0 + 2 - . #, .popsection @@ -3785,25 +3412,16 @@ __switch_to_xtra: # ALT: padding .skip -(((775f-774f)-(772b-771b)) > 0) * ((775f-774f)-(772b-771b)),0x90 773: -.pushsection .altinstructions,"a" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 771b - . +.pushsection .altinstructions, "aM", @progbits, 14 + .long 771b - . .long 774f - . .4byte ( 3*32+21) .byte 773b-771b .byte 775f-774f .popsection .pushsection .altinstr_replacement, "ax" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - # ALT: replacement +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +# ALT: replacement 774: jmp .L324 # 775: @@ -3813,37 +3431,24 @@ __switch_to_xtra: # ALT: padding .skip -(((775f-774f)-(772b-771b)) > 0) * ((775f-774f)-(772b-771b)),0x90 773: -.pushsection .altinstructions,"a" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 771b - . +.pushsection .altinstructions, "aM", @progbits, 14 + .long 771b - . .long 774f - . .4byte 248 # .byte 773b-771b .byte 775f-774f .popsection .pushsection .altinstr_replacement, "ax" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - # ALT: replacement +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +# ALT: replacement 774: 775: .popsection .pushsection .altinstr_aux,"ax" 6: -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - testb $1, boot_cpu_data+79(%rip) #, +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection + testb $1, boot_cpu_data+79(%rip) #, jnz .L325 # jmp .L324 # .popsection @@ -3872,25 +3477,16 @@ __switch_to_xtra: # ALT: padding .skip -(((775f-774f)-(772b-771b)) > 0) * ((775f-774f)-(772b-771b)),0x90 773: -.pushsection .altinstructions,"a" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 771b - . +.pushsection .altinstructions, "aM", @progbits, 14 + .long 771b - . .long 774f - . .4byte ( 3*32+21) .byte 773b-771b .byte 775f-774f .popsection .pushsection .altinstr_replacement, "ax" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - # ALT: replacement +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +# ALT: replacement 774: jmp .L331 # 775: @@ -3900,37 +3496,24 @@ __switch_to_xtra: # ALT: padding .skip -(((775f-774f)-(772b-771b)) > 0) * ((775f-774f)-(772b-771b)),0x90 773: -.pushsection .altinstructions,"a" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 771b - . +.pushsection .altinstructions, "aM", @progbits, 14 + .long 771b - . .long 774f - . .4byte 252 # .byte 773b-771b .byte 775f-774f .popsection .pushsection .altinstr_replacement, "ax" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - # ALT: replacement +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +# ALT: replacement 774: 775: .popsection .pushsection .altinstr_aux,"ax" 6: -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - testb $16, boot_cpu_data+79(%rip) #, +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection + testb $16, boot_cpu_data+79(%rip) #, jnz .L330 # jmp .L331 # .popsection @@ -4028,25 +3611,16 @@ __switch_to_xtra: # ALT: padding .skip -(((775f-774f)-(772b-771b)) > 0) * ((775f-774f)-(772b-771b)),0x90 773: -.pushsection .altinstructions,"a" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 771b - . +.pushsection .altinstructions, "aM", @progbits, 14 + .long 771b - . .long 774f - . .4byte ( 3*32+21) .byte 773b-771b .byte 775f-774f .popsection .pushsection .altinstr_replacement, "ax" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - # ALT: replacement +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +# ALT: replacement 774: jmp .L347 # 775: @@ -4056,37 +3630,24 @@ __switch_to_xtra: # ALT: padding .skip -(((775f-774f)-(772b-771b)) > 0) * ((775f-774f)-(772b-771b)),0x90 773: -.pushsection .altinstructions,"a" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 771b - . +.pushsection .altinstructions, "aM", @progbits, 14 + .long 771b - . .long 774f - . .4byte 441 # .byte 773b-771b .byte 775f-774f .popsection .pushsection .altinstr_replacement, "ax" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - # ALT: replacement +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +# ALT: replacement 774: 775: .popsection .pushsection .altinstr_aux,"ax" 6: -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - testb $2, boot_cpu_data+103(%rip) #, +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection + testb $2, boot_cpu_data+103(%rip) #, jnz .L348 # jmp .L347 # .popsection @@ -4107,14 +3668,9 @@ __switch_to_xtra: # 80 "/home/mingo/tip/arch/x86/include/asm/msr.h" 1 1: wrmsr 2: - .pushsection "__ex_table","a" + .pushsection __ex_table, "aM", @progbits, 12 .balign 4 -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long (1b) - . + .long (1b) - . .long (2b) - . .long 8 .popsection @@ -4125,12 +3681,8 @@ __switch_to_xtra: 1: jmp .L352 # objtool NOPs this # .pushsection __jump_table, "aw" .balign 8 - 912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 1b - . + 912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +.long 1b - . .long .L352 - . # .quad __tracepoint_write_msr+8 + 0 + 2 - . #, .popsection @@ -4147,12 +3699,8 @@ __switch_to_xtra: 1: jmp .L370 # objtool NOPs this # .pushsection __jump_table, "aw" .balign 8 - 912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 1b - . + 912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +.long 1b - . .long .L370 - . # .quad switch_to_cond_stibp + 0 + 2 - . #, .popsection @@ -4213,25 +3761,16 @@ __switch_to_xtra: # ALT: padding .skip -(((775f-774f)-(772b-771b)) > 0) * ((775f-774f)-(772b-771b)),0x90 773: -.pushsection .altinstructions,"a" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 771b - . +.pushsection .altinstructions, "aM", @progbits, 14 + .long 771b - . .long 774f - . .4byte ( 3*32+21) .byte 773b-771b .byte 775f-774f .popsection .pushsection .altinstr_replacement, "ax" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - # ALT: replacement +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +# ALT: replacement 774: jmp .L328 # 775: @@ -4241,37 +3780,24 @@ __switch_to_xtra: # ALT: padding .skip -(((775f-774f)-(772b-771b)) > 0) * ((775f-774f)-(772b-771b)),0x90 773: -.pushsection .altinstructions,"a" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 771b - . +.pushsection .altinstructions, "aM", @progbits, 14 + .long 771b - . .long 774f - . .4byte 607 # .byte 773b-771b .byte 775f-774f .popsection .pushsection .altinstr_replacement, "ax" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - # ALT: replacement +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +# ALT: replacement 774: 775: .popsection .pushsection .altinstr_aux,"ax" 6: -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - testb $128, boot_cpu_data+123(%rip) #, +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection + testb $128, boot_cpu_data+123(%rip) #, jnz .L329 # jmp .L328 # .popsection @@ -4308,14 +3834,9 @@ __switch_to_xtra: # 80 "/home/mingo/tip/arch/x86/include/asm/msr.h" 1 1: wrmsr 2: - .pushsection "__ex_table","a" + .pushsection __ex_table, "aM", @progbits, 12 .balign 4 -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long (1b) - . + .long (1b) - . .long (2b) - . .long 8 .popsection @@ -4326,12 +3847,8 @@ __switch_to_xtra: 1: jmp .L326 # objtool NOPs this # .pushsection __jump_table, "aw" .balign 8 - 912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 1b - . + 912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +.long 1b - . .long .L326 - . # .quad __tracepoint_write_msr+8 + 0 + 2 - . #, .popsection @@ -4352,25 +3869,16 @@ __switch_to_xtra: # ALT: padding .skip -(((775f-774f)-(772b-771b)) > 0) * ((775f-774f)-(772b-771b)),0x90 773: -.pushsection .altinstructions,"a" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 771b - . +.pushsection .altinstructions, "aM", @progbits, 14 + .long 771b - . .long 774f - . .4byte ( 3*32+21) .byte 773b-771b .byte 775f-774f .popsection .pushsection .altinstr_replacement, "ax" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - # ALT: replacement +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +# ALT: replacement 774: jmp .L321 # 775: @@ -4380,37 +3888,24 @@ __switch_to_xtra: # ALT: padding .skip -(((775f-774f)-(772b-771b)) > 0) * ((775f-774f)-(772b-771b)),0x90 773: -.pushsection .altinstructions,"a" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 771b - . +.pushsection .altinstructions, "aM", @progbits, 14 + .long 771b - . .long 774f - . .4byte 440 # .byte 773b-771b .byte 775f-774f .popsection .pushsection .altinstr_replacement, "ax" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - # ALT: replacement +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +# ALT: replacement 774: 775: .popsection .pushsection .altinstr_aux,"ax" 6: -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - testb $1, boot_cpu_data+103(%rip) #, +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection + testb $1, boot_cpu_data+103(%rip) #, jnz .L329 # jmp .L321 # .popsection @@ -4445,14 +3940,9 @@ __switch_to_xtra: # 80 "/home/mingo/tip/arch/x86/include/asm/msr.h" 1 1: wrmsr 2: - .pushsection "__ex_table","a" + .pushsection __ex_table, "aM", @progbits, 12 .balign 4 -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long (1b) - . + .long (1b) - . .long (2b) - . .long 8 .popsection @@ -4463,12 +3953,8 @@ __switch_to_xtra: 1: jmp .L336 # objtool NOPs this # .pushsection __jump_table, "aw" .balign 8 - 912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 1b - . + 912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +.long 1b - . .long .L336 - . # .quad __tracepoint_write_msr+8 + 0 + 2 - . #, .popsection @@ -4496,25 +3982,16 @@ __switch_to_xtra: # ALT: padding .skip -(((775f-774f)-(772b-771b)) > 0) * ((775f-774f)-(772b-771b)),0x90 773: -.pushsection .altinstructions,"a" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 771b - . +.pushsection .altinstructions, "aM", @progbits, 14 + .long 771b - . .long 774f - . .4byte ( 3*32+21) .byte 773b-771b .byte 775f-774f .popsection .pushsection .altinstr_replacement, "ax" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - # ALT: replacement +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +# ALT: replacement 774: jmp .L350 # 775: @@ -4524,37 +4001,24 @@ __switch_to_xtra: # ALT: padding .skip -(((775f-774f)-(772b-771b)) > 0) * ((775f-774f)-(772b-771b)),0x90 773: -.pushsection .altinstructions,"a" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 771b - . +.pushsection .altinstructions, "aM", @progbits, 14 + .long 771b - . .long 774f - . .4byte 248 # .byte 773b-771b .byte 775f-774f .popsection .pushsection .altinstr_replacement, "ax" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - # ALT: replacement +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +# ALT: replacement 774: 775: .popsection .pushsection .altinstr_aux,"ax" 6: -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - testb $1, boot_cpu_data+79(%rip) #, +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection + testb $1, boot_cpu_data+79(%rip) #, jnz .L351 # jmp .L350 # .popsection @@ -4580,25 +4044,16 @@ __switch_to_xtra: # ALT: padding .skip -(((775f-774f)-(772b-771b)) > 0) * ((775f-774f)-(772b-771b)),0x90 773: -.pushsection .altinstructions,"a" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 771b - . +.pushsection .altinstructions, "aM", @progbits, 14 + .long 771b - . .long 774f - . .4byte ( 3*32+21) .byte 773b-771b .byte 775f-774f .popsection .pushsection .altinstr_replacement, "ax" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - # ALT: replacement +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +# ALT: replacement 774: jmp .L358 # 775: @@ -4608,37 +4063,24 @@ __switch_to_xtra: # ALT: padding .skip -(((775f-774f)-(772b-771b)) > 0) * ((775f-774f)-(772b-771b)),0x90 773: -.pushsection .altinstructions,"a" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 771b - . +.pushsection .altinstructions, "aM", @progbits, 14 + .long 771b - . .long 774f - . .4byte 252 # .byte 773b-771b .byte 775f-774f .popsection .pushsection .altinstr_replacement, "ax" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - # ALT: replacement +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +# ALT: replacement 774: 775: .popsection .pushsection .altinstr_aux,"ax" 6: -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - testb $16, boot_cpu_data+79(%rip) #, +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection + testb $16, boot_cpu_data+79(%rip) #, jnz .L357 # jmp .L358 # .popsection @@ -4728,25 +4170,16 @@ __switch_to_xtra: # ALT: padding .skip -(((775f-774f)-(772b-771b)) > 0) * ((775f-774f)-(772b-771b)),0x90 773: -.pushsection .altinstructions,"a" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 771b - . +.pushsection .altinstructions, "aM", @progbits, 14 + .long 771b - . .long 774f - . .4byte ( 3*32+21) .byte 773b-771b .byte 775f-774f .popsection .pushsection .altinstr_replacement, "ax" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - # ALT: replacement +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +# ALT: replacement 774: jmp .L355 # 775: @@ -4756,37 +4189,24 @@ __switch_to_xtra: # ALT: padding .skip -(((775f-774f)-(772b-771b)) > 0) * ((775f-774f)-(772b-771b)),0x90 773: -.pushsection .altinstructions,"a" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 771b - . +.pushsection .altinstructions, "aM", @progbits, 14 + .long 771b - . .long 774f - . .4byte 607 # .byte 773b-771b .byte 775f-774f .popsection .pushsection .altinstr_replacement, "ax" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - # ALT: replacement +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +# ALT: replacement 774: 775: .popsection .pushsection .altinstr_aux,"ax" 6: -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - testb $128, boot_cpu_data+123(%rip) #, +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection + testb $128, boot_cpu_data+123(%rip) #, jnz .L356 # jmp .L355 # .popsection @@ -4823,25 +4243,16 @@ __switch_to_xtra: # ALT: padding .skip -(((775f-774f)-(772b-771b)) > 0) * ((775f-774f)-(772b-771b)),0x90 773: -.pushsection .altinstructions,"a" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 771b - . +.pushsection .altinstructions, "aM", @progbits, 14 + .long 771b - . .long 774f - . .4byte ( 3*32+21) .byte 773b-771b .byte 775f-774f .popsection .pushsection .altinstr_replacement, "ax" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - # ALT: replacement +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +# ALT: replacement 774: jmp .L353 # 775: @@ -4851,37 +4262,24 @@ __switch_to_xtra: # ALT: padding .skip -(((775f-774f)-(772b-771b)) > 0) * ((775f-774f)-(772b-771b)),0x90 773: -.pushsection .altinstructions,"a" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 771b - . +.pushsection .altinstructions, "aM", @progbits, 14 + .long 771b - . .long 774f - . .4byte 440 # .byte 773b-771b .byte 775f-774f .popsection .pushsection .altinstr_replacement, "ax" -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - # ALT: replacement +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +# ALT: replacement 774: 775: .popsection .pushsection .altinstr_aux,"ax" 6: -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - testb $1, boot_cpu_data+103(%rip) #, +912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection + testb $1, boot_cpu_data+103(%rip) #, jnz .L356 # jmp .L353 # .popsection @@ -4909,14 +4307,9 @@ __switch_to_xtra: # 80 "/home/mingo/tip/arch/x86/include/asm/msr.h" 1 1: wrmsr 2: - .pushsection "__ex_table","a" + .pushsection __ex_table, "aM", @progbits, 12 .balign 4 -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long (1b) - . + .long (1b) - . .long (2b) - . .long 8 .popsection @@ -4927,12 +4320,8 @@ __switch_to_xtra: 1: jmp .L363 # objtool NOPs this # .pushsection __jump_table, "aw" .balign 8 - 912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 1b - . + 912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +.long 1b - . .long .L363 - . # .quad __tracepoint_write_msr+8 + 0 + 2 - . #, .popsection @@ -4990,14 +4379,9 @@ __switch_to_xtra: # 80 "/home/mingo/tip/arch/x86/include/asm/msr.h" 1 1: wrmsr 2: - .pushsection "__ex_table","a" + .pushsection __ex_table, "aM", @progbits, 12 .balign 4 -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long (1b) - . + .long (1b) - . .long (2b) - . .long 8 .popsection @@ -5008,12 +4392,8 @@ __switch_to_xtra: 1: jmp .L338 # objtool NOPs this # .pushsection __jump_table, "aw" .balign 8 - 912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 1b - . + 912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +.long 1b - . .long .L338 - . # .quad __tracepoint_write_msr+8 + 0 + 2 - . #, .popsection @@ -5039,14 +4419,9 @@ __switch_to_xtra: # 80 "/home/mingo/tip/arch/x86/include/asm/msr.h" 1 1: wrmsr 2: - .pushsection "__ex_table","a" + .pushsection __ex_table, "aM", @progbits, 12 .balign 4 -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long (1b) - . + .long (1b) - . .long (2b) - . .long 8 .popsection @@ -5057,12 +4432,8 @@ __switch_to_xtra: 1: jmp .L340 # objtool NOPs this # .pushsection __jump_table, "aw" .balign 8 - 912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 1b - . + 912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +.long 1b - . .long .L340 - . # .quad __tracepoint_write_msr+8 + 0 + 2 - . #, .popsection @@ -5099,14 +4470,9 @@ __switch_to_xtra: # 80 "/home/mingo/tip/arch/x86/include/asm/msr.h" 1 1: wrmsr 2: - .pushsection "__ex_table","a" + .pushsection __ex_table, "aM", @progbits, 12 .balign 4 -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long (1b) - . + .long (1b) - . .long (2b) - . .long 8 .popsection @@ -5117,12 +4483,8 @@ __switch_to_xtra: 1: jmp .L367 # objtool NOPs this # .pushsection __jump_table, "aw" .balign 8 - 912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 1b - . + 912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +.long 1b - . .long .L367 - . # .quad __tracepoint_write_msr+8 + 0 + 2 - . #, .popsection @@ -5151,14 +4513,9 @@ __switch_to_xtra: # 80 "/home/mingo/tip/arch/x86/include/asm/msr.h" 1 1: wrmsr 2: - .pushsection "__ex_table","a" + .pushsection __ex_table, "aM", @progbits, 12 .balign 4 -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long (1b) - . + .long (1b) - . .long (2b) - . .long 8 .popsection @@ -5169,12 +4526,8 @@ __switch_to_xtra: 1: jmp .L365 # objtool NOPs this # .pushsection __jump_table, "aw" .balign 8 - 912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 1b - . + 912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +.long 1b - . .long .L365 - . # .quad __tracepoint_write_msr+8 + 0 + 2 - . #, .popsection @@ -5269,20 +4622,12 @@ arch_cpu_idle_dead: #APP # 85 "/home/mingo/tip/arch/x86/include/asm/smp.h" 1 56: nop - .pushsection .discard.annotate_insn,"M", @progbits, 8 - .long 56b - . - .long 3 - .popsection - + .pushsection ".discard.annotate_insn", "M", @progbits, 8; .long 56b - .; .long 3; .popsection # 0 "" 2 # 85 "/home/mingo/tip/arch/x86/include/asm/smp.h" 1 1: .byte 0x0f, 0x0b ; .pushsection __bug_table,"aw" - 912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection + 912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection 2: .long 1b - . # bug_entry::bug_addr .long .LC4 - . # bug_entry::format # @@ -5378,12 +4723,8 @@ stop_this_cpu: 1:jmp .L422 # .pushsection __jump_table, "aw" .balign 8 - 912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 1b - . + 912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +.long 1b - . .long .L422 - . # .quad cpu_buf_idle_clear + 1 - . #, .popsection @@ -5410,20 +4751,12 @@ stop_this_cpu: #APP # 854 "/home/mingo/tip/arch/x86/kernel/process.c" 1 862: nop - .pushsection .discard.annotate_insn,"M", @progbits, 8 - .long 862b - . - .long 3 - .popsection - + .pushsection ".discard.annotate_insn", "M", @progbits, 8; .long 862b - .; .long 3; .popsection # 0 "" 2 # 854 "/home/mingo/tip/arch/x86/kernel/process.c" 1 1: .byte 0x0f, 0x0b ; .pushsection __bug_table,"aw" - 912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection + 912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection 2: .long 1b - . # bug_entry::bug_addr .long .LC4 - . # bug_entry::format # @@ -5669,14 +5002,9 @@ arch_post_acpi_subsys_init: # 70 "/home/mingo/tip/arch/x86/include/asm/msr.h" 1 1: rdmsr 2: - .pushsection "__ex_table","a" + .pushsection __ex_table, "aM", @progbits, 12 .balign 4 -912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long (1b) - . + .long (1b) - . .long (2b) - . .long 9 .popsection @@ -5693,12 +5021,8 @@ arch_post_acpi_subsys_init: 1: jmp .L457 # objtool NOPs this # .pushsection __jump_table, "aw" .balign 8 - 912: - .pushsection .discard.annotate_data,"M", @progbits, 8 - .long 912b - . - .long 1 - .popsection - .long 1b - . + 912: .pushsection ".discard.annotate_data", "M", @progbits, 8; .long 912b - .; .long 1; .popsection +.long 1b - . .long .L457 - . # .quad __tracepoint_read_msr+8 + 0 + 2 - . #, .popsection ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [tip: objtool/urgent] objtool: Consolidate annotation macros 2025-12-03 16:57 ` Ingo Molnar @ 2025-12-03 17:20 ` Josh Poimboeuf 2025-12-03 17:21 ` Linus Torvalds 1 sibling, 0 replies; 24+ messages in thread From: Josh Poimboeuf @ 2025-12-03 17:20 UTC (permalink / raw) To: Ingo Molnar; +Cc: Linus Torvalds, linux-kernel, linux-tip-commits, x86 On Wed, Dec 03, 2025 at 05:57:00PM +0100, Ingo Molnar wrote: > * Linus Torvalds <torvalds@linux-foundation.org> wrote: > > > On Wed, 3 Dec 2025 at 08:40, tip-bot2 for Josh Poimboeuf > > <tip-bot2@linutronix.de> wrote: > > > > > > Consolidate __ASM_ANNOTATE into a single macro which is used by both C > > > and asm. This also makes the code generation a bit more palatable by > > > putting it all on a single line. > > > > No objections, but I just wanted to say that when stating "this makes > > the code generation more palatable", it would be good to actually show > > *how* it does it (with just an example). > > > > Because it's hard to read that diff and figure out what the actual > > effect is. I can just about see it, but... > > Sorry, should have added this to the changelog. > > Find below a diff of the arch/x86/kernel/process.s output > of your tree versus current tip:objtool/urgent. It's still not exactly "pretty", but I'm looking again at how to make all that better... Hopefully we can get .macro working with Clang inline asm at some point. -- Josh ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [tip: objtool/urgent] objtool: Consolidate annotation macros 2025-12-03 16:57 ` Ingo Molnar 2025-12-03 17:20 ` Josh Poimboeuf @ 2025-12-03 17:21 ` Linus Torvalds 2025-12-03 17:44 ` Linus Torvalds ` (2 more replies) 1 sibling, 3 replies; 24+ messages in thread From: Linus Torvalds @ 2025-12-03 17:21 UTC (permalink / raw) To: Ingo Molnar; +Cc: linux-kernel, linux-tip-commits, Josh Poimboeuf, x86 On Wed, 3 Dec 2025 at 08:57, Ingo Molnar <mingo@kernel.org> wrote: > > Find below a diff of the arch/x86/kernel/process.s output > of your tree versus current tip:objtool/urgent. Yeah, just a single example would have been sufficient, ie a simple Turn 911: .pushsection .discard.annotate_insn,"M", @progbits, 8 .long 911b - . .long 1 .popsection jmp __x86_return_thunk Into 911: .pushsection ".discard.annotate_insn", "M", @progbits, 8; .long 911b - .; .long 1; .popsection jmp __x86_return_thunk and btw, the quotes around the section name are not necessary afaik. Also, I have to say that being mergeable is a bit annoying here: without that, we could drop the "@progbits, 8" parts too which is just strange noise. Is the mergeability really a win? Because I'd assume that it's never *actually* merged, since the expression "911b-." ends up being a unique value? What am I missing? It *feels* like this should just all be 911: .pushsection .discard.annotate_insn ; .long 911b - .; .long 1; .popsection jmp __x86_return_thunk instead. But it's entirely possible I'm not seeing the reason here... Linus ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [tip: objtool/urgent] objtool: Consolidate annotation macros 2025-12-03 17:21 ` Linus Torvalds @ 2025-12-03 17:44 ` Linus Torvalds 2025-12-03 17:51 ` Josh Poimboeuf 2025-12-03 17:46 ` [tip: objtool/urgent] objtool: Consolidate annotation macros Josh Poimboeuf 2025-12-03 18:48 ` Ingo Molnar 2 siblings, 1 reply; 24+ messages in thread From: Linus Torvalds @ 2025-12-03 17:44 UTC (permalink / raw) To: Ingo Molnar; +Cc: linux-kernel, linux-tip-commits, Josh Poimboeuf, x86 On Wed, 3 Dec 2025 at 09:21, Linus Torvalds <torvalds@linux-foundation.org> wrote: > > It *feels* like this should just all be > > 911: .pushsection .discard.annotate_insn ; .long 911b - .; .long 1; .popsection > jmp __x86_return_thunk > > instead. Actually, I think it should just be 911: jmp __x86_return_thunk .pushsection .discard.annotate_insn ; .long 911b - . , 1; .popsection but again: it's entirely possible that there's something I am missing. Linus ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [tip: objtool/urgent] objtool: Consolidate annotation macros 2025-12-03 17:44 ` Linus Torvalds @ 2025-12-03 17:51 ` Josh Poimboeuf 2025-12-03 18:07 ` [PATCH] objtool: More annotation code generation tweaks Josh Poimboeuf 0 siblings, 1 reply; 24+ messages in thread From: Josh Poimboeuf @ 2025-12-03 17:51 UTC (permalink / raw) To: Linus Torvalds; +Cc: Ingo Molnar, linux-kernel, linux-tip-commits, x86 On Wed, Dec 03, 2025 at 09:44:45AM -0800, Linus Torvalds wrote: > On Wed, 3 Dec 2025 at 09:21, Linus Torvalds > <torvalds@linux-foundation.org> wrote: > > > > It *feels* like this should just all be > > > > 911: .pushsection .discard.annotate_insn ; .long 911b - .; .long 1; .popsection > > jmp __x86_return_thunk > > > > instead. > > Actually, I think it should just be > > 911: jmp __x86_return_thunk > .pushsection .discard.annotate_insn ; .long 911b - . , 1; .popsection > > but again: it's entirely possible that there's something I am missing. Indeed, we can combine the longs (though see my other email for the explanation about the mergeable thing). -- Josh ^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH] objtool: More annotation code generation tweaks 2025-12-03 17:51 ` Josh Poimboeuf @ 2025-12-03 18:07 ` Josh Poimboeuf 2025-12-03 18:48 ` [tip: objtool/urgent] objtool: Simplify .annotate_insn code generation output some more tip-bot2 for Josh Poimboeuf 0 siblings, 1 reply; 24+ messages in thread From: Josh Poimboeuf @ 2025-12-03 18:07 UTC (permalink / raw) To: Linus Torvalds; +Cc: Ingo Molnar, linux-kernel, linux-tip-commits, x86 Remove the superfluous section name quotes, and combine the longs into a single command. Before: 911: .pushsection ".discard.annotate_insn", "M", @progbits, 8; .long 911b - .; .long 2; .popsection After: 911: .pushsection .discard.annotate_insn, "M", @progbits, 8; .long 911b - ., 2; .popsection Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org> --- include/linux/annotate.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/include/linux/annotate.h b/include/linux/annotate.h index 5efac5d4f9cf..2f1599c9e573 100644 --- a/include/linux/annotate.h +++ b/include/linux/annotate.h @@ -8,33 +8,32 @@ #define __ASM_ANNOTATE(section, label, type) \ .pushsection section, "M", @progbits, 8; \ - .long label - .; \ - .long type; \ + .long label - ., type; \ .popsection #ifndef __ASSEMBLY__ #define ASM_ANNOTATE_LABEL(label, type) \ - __stringify(__ASM_ANNOTATE(".discard.annotate_insn", label, type)) + __stringify(__ASM_ANNOTATE(.discard.annotate_insn, label, type)) #define ASM_ANNOTATE(type) \ "911: " \ - __stringify(__ASM_ANNOTATE(".discard.annotate_insn", 911b, type)) + __stringify(__ASM_ANNOTATE(.discard.annotate_insn, 911b, type)) #define ASM_ANNOTATE_DATA(type) \ "912: " \ - __stringify(__ASM_ANNOTATE(".discard.annotate_data", 912b, type)) + __stringify(__ASM_ANNOTATE(.discard.annotate_data, 912b, type)) #else /* __ASSEMBLY__ */ .macro ANNOTATE type .Lhere_\@: - __ASM_ANNOTATE(".discard.annotate_insn", .Lhere_\@, \type) + __ASM_ANNOTATE(.discard.annotate_insn, .Lhere_\@, \type) .endm .macro ANNOTATE_DATA type .Lhere_\@: - __ASM_ANNOTATE(".discard.annotate_data", .Lhere_\@, \type) + __ASM_ANNOTATE(.discard.annotate_data, .Lhere_\@, \type) .endm #endif /* __ASSEMBLY__ */ -- 2.51.1 ^ permalink raw reply related [flat|nested] 24+ messages in thread
* [tip: objtool/urgent] objtool: Simplify .annotate_insn code generation output some more 2025-12-03 18:07 ` [PATCH] objtool: More annotation code generation tweaks Josh Poimboeuf @ 2025-12-03 18:48 ` tip-bot2 for Josh Poimboeuf 0 siblings, 0 replies; 24+ messages in thread From: tip-bot2 for Josh Poimboeuf @ 2025-12-03 18:48 UTC (permalink / raw) To: linux-tip-commits Cc: Linus Torvalds, Josh Poimboeuf, Ingo Molnar, x86, linux-kernel The following commit has been merged into the objtool/urgent branch of tip: Commit-ID: 2d3451ef1ef679ae496f8e335f4b1305885e8083 Gitweb: https://git.kernel.org/tip/2d3451ef1ef679ae496f8e335f4b1305885e8083 Author: Josh Poimboeuf <jpoimboe@kernel.org> AuthorDate: Wed, 03 Dec 2025 10:07:38 -08:00 Committer: Ingo Molnar <mingo@kernel.org> CommitterDate: Wed, 03 Dec 2025 19:45:29 +01:00 objtool: Simplify .annotate_insn code generation output some more Remove the superfluous section name quotes, and combine the longs into a single command. Before: 911: .pushsection ".discard.annotate_insn", "M", @progbits, 8; .long 911b - .; .long 2; .popsection After: 911: .pushsection .discard.annotate_insn, "M", @progbits, 8; .long 911b - ., 2; .popsection No change in functionality. Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://patch.msgid.link/hpsfcihgqmhcdrg7pop7z73ptymakgjq7qlxrawrjxilosk43l@xikqif3ievj4 --- include/linux/annotate.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/include/linux/annotate.h b/include/linux/annotate.h index 5efac5d..2f1599c 100644 --- a/include/linux/annotate.h +++ b/include/linux/annotate.h @@ -8,33 +8,32 @@ #define __ASM_ANNOTATE(section, label, type) \ .pushsection section, "M", @progbits, 8; \ - .long label - .; \ - .long type; \ + .long label - ., type; \ .popsection #ifndef __ASSEMBLY__ #define ASM_ANNOTATE_LABEL(label, type) \ - __stringify(__ASM_ANNOTATE(".discard.annotate_insn", label, type)) + __stringify(__ASM_ANNOTATE(.discard.annotate_insn, label, type)) #define ASM_ANNOTATE(type) \ "911: " \ - __stringify(__ASM_ANNOTATE(".discard.annotate_insn", 911b, type)) + __stringify(__ASM_ANNOTATE(.discard.annotate_insn, 911b, type)) #define ASM_ANNOTATE_DATA(type) \ "912: " \ - __stringify(__ASM_ANNOTATE(".discard.annotate_data", 912b, type)) + __stringify(__ASM_ANNOTATE(.discard.annotate_data, 912b, type)) #else /* __ASSEMBLY__ */ .macro ANNOTATE type .Lhere_\@: - __ASM_ANNOTATE(".discard.annotate_insn", .Lhere_\@, \type) + __ASM_ANNOTATE(.discard.annotate_insn, .Lhere_\@, \type) .endm .macro ANNOTATE_DATA type .Lhere_\@: - __ASM_ANNOTATE(".discard.annotate_data", .Lhere_\@, \type) + __ASM_ANNOTATE(.discard.annotate_data, .Lhere_\@, \type) .endm #endif /* __ASSEMBLY__ */ ^ permalink raw reply related [flat|nested] 24+ messages in thread
* Re: [tip: objtool/urgent] objtool: Consolidate annotation macros 2025-12-03 17:21 ` Linus Torvalds 2025-12-03 17:44 ` Linus Torvalds @ 2025-12-03 17:46 ` Josh Poimboeuf 2025-12-03 18:41 ` Linus Torvalds 2025-12-03 18:48 ` Ingo Molnar 2 siblings, 1 reply; 24+ messages in thread From: Josh Poimboeuf @ 2025-12-03 17:46 UTC (permalink / raw) To: Linus Torvalds; +Cc: Ingo Molnar, linux-kernel, linux-tip-commits, x86 On Wed, Dec 03, 2025 at 09:21:55AM -0800, Linus Torvalds wrote: > On Wed, 3 Dec 2025 at 08:57, Ingo Molnar <mingo@kernel.org> wrote: > > > > Find below a diff of the arch/x86/kernel/process.s output > > of your tree versus current tip:objtool/urgent. > > Yeah, just a single example would have been sufficient, ie a simple > > Turn > > 911: > .pushsection .discard.annotate_insn,"M", @progbits, 8 > .long 911b - . > .long 1 > .popsection > jmp __x86_return_thunk > > Into > > 911: .pushsection ".discard.annotate_insn", "M", @progbits, 8; > .long 911b - .; .long 1; .popsection > jmp __x86_return_thunk > > and btw, the quotes around the section name are not necessary afaik. Indeed, I can remove those quotes. > Also, I have to say that being mergeable is a bit annoying here: > without that, we could drop the "@progbits, 8" parts too which is just > strange noise. Is the mergeability really a win? Because I'd assume > that it's never *actually* merged, since the expression "911b-." ends > up being a unique value? > > What am I missing? It *feels* like this should just all be > > 911: .pushsection .discard.annotate_insn ; .long 911b - .; > .long 1; .popsection > jmp __x86_return_thunk > > instead. But it's entirely possible I'm not seeing the reason here... So that mergeable thing is the only way to convince the toolchains to allow setting the section entsize, which is a generic way for objtool to look at the myriad of special sections and determine their entry sizes, so it can extract individual entries for the purposes of creating livepatch modules. In this case I do realize the irony of objtool needing to know the section size of a section which is explicitly created for objtool's use (so of course it already knows the size). In actuality they are two completely separate subcommands of objtool. "Regular" objtool reads .discard.annotate_insn for its annotations, whereas "objtool klp diff" extracts special section entries. It does so in a generic way (entsize), regardless of whether the special section is objtool-specific or not (e.g., the bug table). -- Josh ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [tip: objtool/urgent] objtool: Consolidate annotation macros 2025-12-03 17:46 ` [tip: objtool/urgent] objtool: Consolidate annotation macros Josh Poimboeuf @ 2025-12-03 18:41 ` Linus Torvalds 2025-12-03 19:17 ` Josh Poimboeuf 0 siblings, 1 reply; 24+ messages in thread From: Linus Torvalds @ 2025-12-03 18:41 UTC (permalink / raw) To: Josh Poimboeuf; +Cc: Ingo Molnar, linux-kernel, linux-tip-commits, x86 On Wed, 3 Dec 2025 at 09:46, Josh Poimboeuf <jpoimboe@kernel.org> wrote: > > So that mergeable thing is the only way to convince the toolchains to > allow setting the section entsize Ugh. What a horrid reason. That *should* be trivially done by just having a linker script setting, but if one doesn't exist... What are the actual entry sizes, though? Because maybe we could just use alignment instead - which is trivially settable in the linker script. Linus ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [tip: objtool/urgent] objtool: Consolidate annotation macros 2025-12-03 18:41 ` Linus Torvalds @ 2025-12-03 19:17 ` Josh Poimboeuf 2025-12-03 19:24 ` Linus Torvalds 0 siblings, 1 reply; 24+ messages in thread From: Josh Poimboeuf @ 2025-12-03 19:17 UTC (permalink / raw) To: Linus Torvalds; +Cc: Ingo Molnar, linux-kernel, linux-tip-commits, x86 On Wed, Dec 03, 2025 at 10:41:30AM -0800, Linus Torvalds wrote: > On Wed, 3 Dec 2025 at 09:46, Josh Poimboeuf <jpoimboe@kernel.org> wrote: > > > > So that mergeable thing is the only way to convince the toolchains to > > allow setting the section entsize > > Ugh. What a horrid reason. That *should* be trivially done by just > having a linker script setting, but if one doesn't exist... Believe me, I looked and there's surprisingly no way to do that from linker script. > What are the actual entry sizes, though? Because maybe we could just > use alignment instead - which is trivially settable in the linker > script. That could work. At least .altinstructions (14 bytes) and __ex_table (12 bytes) aren't power of two. We could certainly pad them, That does increase memory usage though. On my defconfig kernel that would add about ~11k. -- Josh ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [tip: objtool/urgent] objtool: Consolidate annotation macros 2025-12-03 19:17 ` Josh Poimboeuf @ 2025-12-03 19:24 ` Linus Torvalds 0 siblings, 0 replies; 24+ messages in thread From: Linus Torvalds @ 2025-12-03 19:24 UTC (permalink / raw) To: Josh Poimboeuf; +Cc: Ingo Molnar, linux-kernel, linux-tip-commits, x86 On Wed, 3 Dec 2025 at 11:17, Josh Poimboeuf <jpoimboe@kernel.org> wrote: > > > What are the actual entry sizes, though? Because maybe we could just > > use alignment instead - which is trivially settable in the linker > > script. > > That could work. At least .altinstructions (14 bytes) and __ex_table > (12 bytes) aren't power of two. > > We could certainly pad them, That does increase memory usage though. On > my defconfig kernel that would add about ~11k. Ok, if they aren't all naturally aligned, let's just keep with the horrid 'mergeable' thing for now. It's not wonderful, but nobody sane looks at the generated asm anyway. And regardless, it's better than it used to be. Linus ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [tip: objtool/urgent] objtool: Consolidate annotation macros 2025-12-03 17:21 ` Linus Torvalds 2025-12-03 17:44 ` Linus Torvalds 2025-12-03 17:46 ` [tip: objtool/urgent] objtool: Consolidate annotation macros Josh Poimboeuf @ 2025-12-03 18:48 ` Ingo Molnar 2 siblings, 0 replies; 24+ messages in thread From: Ingo Molnar @ 2025-12-03 18:48 UTC (permalink / raw) To: Linus Torvalds; +Cc: linux-kernel, linux-tip-commits, Josh Poimboeuf, x86 * Linus Torvalds <torvalds@linux-foundation.org> wrote: > On Wed, 3 Dec 2025 at 08:57, Ingo Molnar <mingo@kernel.org> wrote: > > > > Find below a diff of the arch/x86/kernel/process.s output > > of your tree versus current tip:objtool/urgent. > > Yeah, just a single example would have been sufficient, ie a simple > > Turn > > 911: > .pushsection .discard.annotate_insn,"M", @progbits, 8 > .long 911b - . > .long 1 > .popsection > jmp __x86_return_thunk > > Into > > 911: .pushsection ".discard.annotate_insn", "M", @progbits, 8; > .long 911b - .; .long 1; .popsection > jmp __x86_return_thunk I ended up rebasing the commit after all and added your example, because seeing it written out triggered further enhancements: > and btw, the quotes around the section name are not necessary afaik. > > Also, I have to say that being mergeable is a bit annoying here: > without that, we could drop the "@progbits, 8" parts too which is just > strange noise. Is the mergeability really a win? Because I'd assume > that it's never *actually* merged, since the expression "911b-." ends > up being a unique value? > > What am I missing? It *feels* like this should just all be > > 911: .pushsection .discard.annotate_insn ; .long 911b - .; > .long 1; .popsection > jmp __x86_return_thunk > > instead. But it's entirely possible I'm not seeing the reason here... Thanks, Ingo ^ permalink raw reply [flat|nested] 24+ messages in thread
* [tip: objtool/urgent] objtool: Consolidate annotation macros 2025-12-02 17:59 ` [PATCH v2 3/4] objtool: Consolidate annotation macros Josh Poimboeuf 2025-12-03 16:40 ` [tip: objtool/urgent] " tip-bot2 for Josh Poimboeuf @ 2025-12-03 18:48 ` tip-bot2 for Josh Poimboeuf 1 sibling, 0 replies; 24+ messages in thread From: tip-bot2 for Josh Poimboeuf @ 2025-12-03 18:48 UTC (permalink / raw) To: linux-tip-commits Cc: Josh Poimboeuf, Ingo Molnar, Linus Torvalds, x86, linux-kernel The following commit has been merged into the objtool/urgent branch of tip: Commit-ID: 305c8dc477175eb29df18accc95c868acd2cdd4e Gitweb: https://git.kernel.org/tip/305c8dc477175eb29df18accc95c868acd2cdd4e Author: Josh Poimboeuf <jpoimboe@kernel.org> AuthorDate: Tue, 02 Dec 2025 09:59:38 -08:00 Committer: Ingo Molnar <mingo@kernel.org> CommitterDate: Wed, 03 Dec 2025 19:40:44 +01:00 objtool: Consolidate annotation macros Consolidate __ASM_ANNOTATE into a single macro which is used by both C and asm. This also makes the code generation a bit more palatable by putting it all on a single line. Turn this: 911: .pushsection .discard.annotate_insn,"M", @progbits, 8 .long 911b - . .long 1 .popsection jmp __x86_return_thunk Into: 911: .pushsection ".discard.annotate_insn", "M", @progbits, 8; .long 911b - .; .long 1; .popsection jmp __x86_return_thunk 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/c05ff40d3383e85c3b59018ef0b3c7aaf993a60d.1764694625.git.jpoimboe@kernel.org --- include/linux/annotate.h | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/include/linux/annotate.h b/include/linux/annotate.h index 7c10d34..996126f 100644 --- a/include/linux/annotate.h +++ b/include/linux/annotate.h @@ -6,41 +6,35 @@ #ifdef CONFIG_OBJTOOL -#ifndef __ASSEMBLY__ - #define __ASM_ANNOTATE(section, label, type) \ - ".pushsection " section ",\"M\", @progbits, 8\n\t" \ - ".long " __stringify(label) " - .\n\t" \ - ".long " __stringify(type) "\n\t" \ - ".popsection\n\t" + .pushsection section, "M", @progbits, 8; \ + .long label - .; \ + .long type; \ + .popsection + +#ifndef __ASSEMBLY__ #define ASM_ANNOTATE_LABEL(label, type) \ - __ASM_ANNOTATE(".discard.annotate_insn", label, type) + __stringify(__ASM_ANNOTATE(".discard.annotate_insn", label, type)) "\n\t" #define ASM_ANNOTATE(type) \ - "911:\n\t" \ - ASM_ANNOTATE_LABEL(911b, type) + "911: " \ + __stringify(__ASM_ANNOTATE(".discard.annotate_insn", 911b, type)) "\n\t" #define ASM_ANNOTATE_DATA(type) \ - "912:\n\t" \ - __ASM_ANNOTATE(".discard.annotate_data", 912b, type) + "912: " \ + __stringify(__ASM_ANNOTATE(".discard.annotate_data", 912b, type)) "\n\t" #else /* __ASSEMBLY__ */ -.macro __ANNOTATE section, type -.Lhere_\@: - .pushsection \section, "M", @progbits, 8 - .long .Lhere_\@ - . - .long \type - .popsection -.endm - .macro ANNOTATE type - __ANNOTATE ".discard.annotate_insn", \type +.Lhere_\@: + __ASM_ANNOTATE(".discard.annotate_insn", .Lhere_\@, \type) .endm .macro ANNOTATE_DATA type - __ANNOTATE ".discard.annotate_data", \type +.Lhere_\@: + __ASM_ANNOTATE(".discard.annotate_data", .Lhere_\@, \type) .endm #endif /* __ASSEMBLY__ */ ^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH v2 4/4] objtool: Remove newlines and tabs from annotation macros 2025-12-02 17:59 [PATCH v2 0/4] objtool: Improve code generation for annotation macros Josh Poimboeuf ` (2 preceding siblings ...) 2025-12-02 17:59 ` [PATCH v2 3/4] objtool: Consolidate annotation macros Josh Poimboeuf @ 2025-12-02 17:59 ` Josh Poimboeuf 2025-12-03 16:40 ` [tip: objtool/urgent] " tip-bot2 for Josh Poimboeuf 2025-12-03 18:48 ` tip-bot2 for Josh Poimboeuf 3 siblings, 2 replies; 24+ messages in thread From: Josh Poimboeuf @ 2025-12-02 17:59 UTC (permalink / raw) To: x86; +Cc: linux-kernel, Peter Zijlstra, Ingo Molnar 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> --- arch/x86/include/asm/alternative.h | 2 +- arch/x86/include/asm/bug.h | 2 +- arch/x86/include/asm/cpufeature.h | 2 +- arch/x86/include/asm/irq_stack.h | 2 +- arch/x86/include/asm/jump_label.h | 2 +- arch/x86/include/asm/nospec-branch.h | 4 ++-- arch/x86/include/asm/paravirt_types.h | 2 +- arch/x86/include/asm/smap.h | 8 ++++---- arch/x86/include/asm/static_call.h | 2 +- arch/x86/kernel/alternative.c | 4 ++-- arch/x86/kernel/rethook.c | 2 +- arch/x86/kernel/static_call.c | 4 ++-- arch/x86/lib/error-inject.c | 2 +- include/linux/annotate.h | 6 +++--- include/linux/objtool.h | 2 +- 15 files changed, 23 insertions(+), 23 deletions(-) diff --git a/arch/x86/include/asm/alternative.h b/arch/x86/include/asm/alternative.h index df2c8705e17b..03364510d5fe 100644 --- a/arch/x86/include/asm/alternative.h +++ b/arch/x86/include/asm/alternative.h @@ -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" diff --git a/arch/x86/include/asm/bug.h b/arch/x86/include/asm/bug.h index ab5bba6cf7f5..ee23b98353d7 100644 --- a/arch/x86/include/asm/bug.h +++ b/arch/x86/include/asm/bug.h @@ -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" \ diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h index fc5f32d4da6e..d8bc614f92fa 100644 --- a/arch/x86/include/asm/cpufeature.h +++ b/arch/x86/include/asm/cpufeature.h @@ -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" diff --git a/arch/x86/include/asm/irq_stack.h b/arch/x86/include/asm/irq_stack.h index 735c3a491f60..8325b79f2ac6 100644 --- a/arch/x86/include/asm/irq_stack.h +++ b/arch/x86/include/asm/irq_stack.h @@ -101,7 +101,7 @@ #define ASM_CALL_ARG0 \ "1: call %c[__func] \n" \ - ANNOTATE_REACHABLE(1b) + ANNOTATE_REACHABLE(1b) " \n" #define ASM_CALL_ARG1 \ "movq %[arg1], %%rdi \n" \ diff --git a/arch/x86/include/asm/jump_label.h b/arch/x86/include/asm/jump_label.h index e0a6930a4029..05b16299588d 100644 --- a/arch/x86/include/asm/jump_label.h +++ b/arch/x86/include/asm/jump_label.h @@ -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" \ diff --git a/arch/x86/include/asm/nospec-branch.h b/arch/x86/include/asm/nospec-branch.h index 08ed5a2e46a5..a5d41d8cd70a 100644 --- a/arch/x86/include/asm/nospec-branch.h +++ b/arch/x86/include/asm/nospec-branch.h @@ -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) diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h index 37a8627d8277..3502939415ad 100644 --- a/arch/x86/include/asm/paravirt_types.h +++ b/arch/x86/include/asm/paravirt_types.h @@ -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];" /* diff --git a/arch/x86/include/asm/smap.h b/arch/x86/include/asm/smap.h index 4f84d421d1cf..cd173facecd2 100644 --- a/arch/x86/include/asm/smap.h +++ b/arch/x86/include/asm/smap.h @@ -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__ */ diff --git a/arch/x86/include/asm/static_call.h b/arch/x86/include/asm/static_call.h index 41502bd2afd6..4cd725a8fe91 100644 --- a/arch/x86/include/asm/static_call.h +++ b/arch/x86/include/asm/static_call.h @@ -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" \ diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index e377b06e70e3..3bda5118969f 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c @@ -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" diff --git a/arch/x86/kernel/rethook.c b/arch/x86/kernel/rethook.c index 8a1c0111ae79..85e2f2d16a90 100644 --- a/arch/x86/kernel/rethook.c +++ b/arch/x86/kernel/rethook.c @@ -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 diff --git a/arch/x86/kernel/static_call.c b/arch/x86/kernel/static_call.c index 2892cdb14563..61592e41a6b1 100644 --- a/arch/x86/kernel/static_call.c +++ b/arch/x86/kernel/static_call.c @@ -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"); diff --git a/arch/x86/lib/error-inject.c b/arch/x86/lib/error-inject.c index b5a6d83106bc..512a2538596f 100644 --- a/arch/x86/lib/error-inject.c +++ b/arch/x86/lib/error-inject.c @@ -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" ); diff --git a/include/linux/annotate.h b/include/linux/annotate.h index 996126f5f9ec..5efac5d4f9cf 100644 --- a/include/linux/annotate.h +++ b/include/linux/annotate.h @@ -15,15 +15,15 @@ #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__ */ diff --git a/include/linux/objtool.h b/include/linux/objtool.h index b18ab53561c9..9a00e701454c 100644 --- a/include/linux/objtool.h +++ b/include/linux/objtool.h @@ -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" \ -- 2.51.1 ^ permalink raw reply related [flat|nested] 24+ messages in thread
* [tip: objtool/urgent] objtool: Remove newlines and tabs from annotation macros 2025-12-02 17:59 ` [PATCH v2 4/4] objtool: Remove newlines and tabs from " Josh Poimboeuf @ 2025-12-03 16:40 ` tip-bot2 for Josh Poimboeuf 2025-12-03 18:48 ` tip-bot2 for Josh Poimboeuf 1 sibling, 0 replies; 24+ messages in thread From: tip-bot2 for Josh Poimboeuf @ 2025-12-03 16:40 UTC (permalink / raw) To: linux-tip-commits Cc: Josh Poimboeuf, Ingo Molnar, Linus Torvalds, x86, linux-kernel The following commit has been merged into the objtool/urgent branch of tip: Commit-ID: 8d20ad6893d0c03eb009c984faeb25bc8cffda90 Gitweb: https://git.kernel.org/tip/8d20ad6893d0c03eb009c984faeb25bc8cffda90 Author: Josh Poimboeuf <jpoimboe@kernel.org> AuthorDate: Tue, 02 Dec 2025 09:59:39 -08:00 Committer: Ingo Molnar <mingo@kernel.org> CommitterDate: Wed, 03 Dec 2025 16:53:19 +01:00 objtool: Remove newlines and tabs from annotation macros 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 --- arch/x86/include/asm/alternative.h | 2 +- arch/x86/include/asm/bug.h | 2 +- arch/x86/include/asm/cpufeature.h | 2 +- arch/x86/include/asm/irq_stack.h | 2 +- arch/x86/include/asm/jump_label.h | 2 +- arch/x86/include/asm/nospec-branch.h | 4 ++-- arch/x86/include/asm/paravirt_types.h | 2 +- arch/x86/include/asm/smap.h | 8 ++++---- arch/x86/include/asm/static_call.h | 2 +- arch/x86/kernel/alternative.c | 4 ++-- arch/x86/kernel/rethook.c | 2 +- arch/x86/kernel/static_call.c | 4 ++-- arch/x86/lib/error-inject.c | 2 +- include/linux/annotate.h | 6 +++--- include/linux/objtool.h | 2 +- 15 files changed, 23 insertions(+), 23 deletions(-) diff --git a/arch/x86/include/asm/alternative.h b/arch/x86/include/asm/alternative.h index df2c870..0336451 100644 --- a/arch/x86/include/asm/alternative.h +++ b/arch/x86/include/asm/alternative.h @@ -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" diff --git a/arch/x86/include/asm/bug.h b/arch/x86/include/asm/bug.h index ab5bba6..ee23b98 100644 --- a/arch/x86/include/asm/bug.h +++ b/arch/x86/include/asm/bug.h @@ -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" \ diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h index fc5f32d..d8bc614 100644 --- a/arch/x86/include/asm/cpufeature.h +++ b/arch/x86/include/asm/cpufeature.h @@ -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" diff --git a/arch/x86/include/asm/irq_stack.h b/arch/x86/include/asm/irq_stack.h index 735c3a4..8325b79 100644 --- a/arch/x86/include/asm/irq_stack.h +++ b/arch/x86/include/asm/irq_stack.h @@ -101,7 +101,7 @@ #define ASM_CALL_ARG0 \ "1: call %c[__func] \n" \ - ANNOTATE_REACHABLE(1b) + ANNOTATE_REACHABLE(1b) " \n" #define ASM_CALL_ARG1 \ "movq %[arg1], %%rdi \n" \ diff --git a/arch/x86/include/asm/jump_label.h b/arch/x86/include/asm/jump_label.h index e0a6930..05b1629 100644 --- a/arch/x86/include/asm/jump_label.h +++ b/arch/x86/include/asm/jump_label.h @@ -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" \ diff --git a/arch/x86/include/asm/nospec-branch.h b/arch/x86/include/asm/nospec-branch.h index 08ed5a2..a5d41d8 100644 --- a/arch/x86/include/asm/nospec-branch.h +++ b/arch/x86/include/asm/nospec-branch.h @@ -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) diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h index 37a8627..3502939 100644 --- a/arch/x86/include/asm/paravirt_types.h +++ b/arch/x86/include/asm/paravirt_types.h @@ -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];" /* diff --git a/arch/x86/include/asm/smap.h b/arch/x86/include/asm/smap.h index 4f84d42..cd173fa 100644 --- a/arch/x86/include/asm/smap.h +++ b/arch/x86/include/asm/smap.h @@ -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__ */ diff --git a/arch/x86/include/asm/static_call.h b/arch/x86/include/asm/static_call.h index 41502bd..4cd725a 100644 --- a/arch/x86/include/asm/static_call.h +++ b/arch/x86/include/asm/static_call.h @@ -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" \ diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index e377b06..3bda511 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c @@ -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" diff --git a/arch/x86/kernel/rethook.c b/arch/x86/kernel/rethook.c index 8a1c011..85e2f2d 100644 --- a/arch/x86/kernel/rethook.c +++ b/arch/x86/kernel/rethook.c @@ -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 diff --git a/arch/x86/kernel/static_call.c b/arch/x86/kernel/static_call.c index 2892cdb..61592e4 100644 --- a/arch/x86/kernel/static_call.c +++ b/arch/x86/kernel/static_call.c @@ -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"); diff --git a/arch/x86/lib/error-inject.c b/arch/x86/lib/error-inject.c index b5a6d83..512a253 100644 --- a/arch/x86/lib/error-inject.c +++ b/arch/x86/lib/error-inject.c @@ -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" ); diff --git a/include/linux/annotate.h b/include/linux/annotate.h index 996126f..5efac5d 100644 --- a/include/linux/annotate.h +++ b/include/linux/annotate.h @@ -15,15 +15,15 @@ #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__ */ diff --git a/include/linux/objtool.h b/include/linux/objtool.h index b18ab53..9a00e70 100644 --- a/include/linux/objtool.h +++ b/include/linux/objtool.h @@ -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" \ ^ permalink raw reply related [flat|nested] 24+ messages in thread
* [tip: objtool/urgent] objtool: Remove newlines and tabs from annotation macros 2025-12-02 17:59 ` [PATCH v2 4/4] objtool: Remove newlines and tabs from " Josh Poimboeuf 2025-12-03 16:40 ` [tip: objtool/urgent] " tip-bot2 for Josh Poimboeuf @ 2025-12-03 18:48 ` tip-bot2 for Josh Poimboeuf 1 sibling, 0 replies; 24+ messages in thread From: tip-bot2 for Josh Poimboeuf @ 2025-12-03 18:48 UTC (permalink / raw) To: linux-tip-commits Cc: Josh Poimboeuf, Ingo Molnar, Linus Torvalds, x86, linux-kernel The following commit has been merged into the objtool/urgent branch of tip: Commit-ID: ed3bf863dc9150b56233b01ec073cbbd1fc9c6a3 Gitweb: https://git.kernel.org/tip/ed3bf863dc9150b56233b01ec073cbbd1fc9c6a3 Author: Josh Poimboeuf <jpoimboe@kernel.org> AuthorDate: Tue, 02 Dec 2025 09:59:39 -08:00 Committer: Ingo Molnar <mingo@kernel.org> CommitterDate: Wed, 03 Dec 2025 19:42:37 +01:00 objtool: Remove newlines and tabs from annotation macros 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 --- arch/x86/include/asm/alternative.h | 2 +- arch/x86/include/asm/bug.h | 2 +- arch/x86/include/asm/cpufeature.h | 2 +- arch/x86/include/asm/irq_stack.h | 2 +- arch/x86/include/asm/jump_label.h | 2 +- arch/x86/include/asm/nospec-branch.h | 4 ++-- arch/x86/include/asm/paravirt_types.h | 2 +- arch/x86/include/asm/smap.h | 8 ++++---- arch/x86/include/asm/static_call.h | 2 +- arch/x86/kernel/alternative.c | 4 ++-- arch/x86/kernel/rethook.c | 2 +- arch/x86/kernel/static_call.c | 4 ++-- arch/x86/lib/error-inject.c | 2 +- include/linux/annotate.h | 6 +++--- include/linux/objtool.h | 2 +- 15 files changed, 23 insertions(+), 23 deletions(-) diff --git a/arch/x86/include/asm/alternative.h b/arch/x86/include/asm/alternative.h index df2c870..0336451 100644 --- a/arch/x86/include/asm/alternative.h +++ b/arch/x86/include/asm/alternative.h @@ -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" diff --git a/arch/x86/include/asm/bug.h b/arch/x86/include/asm/bug.h index ab5bba6..ee23b98 100644 --- a/arch/x86/include/asm/bug.h +++ b/arch/x86/include/asm/bug.h @@ -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" \ diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h index fc5f32d..d8bc614 100644 --- a/arch/x86/include/asm/cpufeature.h +++ b/arch/x86/include/asm/cpufeature.h @@ -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" diff --git a/arch/x86/include/asm/irq_stack.h b/arch/x86/include/asm/irq_stack.h index 735c3a4..8325b79 100644 --- a/arch/x86/include/asm/irq_stack.h +++ b/arch/x86/include/asm/irq_stack.h @@ -101,7 +101,7 @@ #define ASM_CALL_ARG0 \ "1: call %c[__func] \n" \ - ANNOTATE_REACHABLE(1b) + ANNOTATE_REACHABLE(1b) " \n" #define ASM_CALL_ARG1 \ "movq %[arg1], %%rdi \n" \ diff --git a/arch/x86/include/asm/jump_label.h b/arch/x86/include/asm/jump_label.h index e0a6930..05b1629 100644 --- a/arch/x86/include/asm/jump_label.h +++ b/arch/x86/include/asm/jump_label.h @@ -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" \ diff --git a/arch/x86/include/asm/nospec-branch.h b/arch/x86/include/asm/nospec-branch.h index 08ed5a2..a5d41d8 100644 --- a/arch/x86/include/asm/nospec-branch.h +++ b/arch/x86/include/asm/nospec-branch.h @@ -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) diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h index 37a8627..3502939 100644 --- a/arch/x86/include/asm/paravirt_types.h +++ b/arch/x86/include/asm/paravirt_types.h @@ -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];" /* diff --git a/arch/x86/include/asm/smap.h b/arch/x86/include/asm/smap.h index 4f84d42..cd173fa 100644 --- a/arch/x86/include/asm/smap.h +++ b/arch/x86/include/asm/smap.h @@ -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__ */ diff --git a/arch/x86/include/asm/static_call.h b/arch/x86/include/asm/static_call.h index 41502bd..4cd725a 100644 --- a/arch/x86/include/asm/static_call.h +++ b/arch/x86/include/asm/static_call.h @@ -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" \ diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index e377b06..3bda511 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c @@ -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" diff --git a/arch/x86/kernel/rethook.c b/arch/x86/kernel/rethook.c index 8a1c011..85e2f2d 100644 --- a/arch/x86/kernel/rethook.c +++ b/arch/x86/kernel/rethook.c @@ -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 diff --git a/arch/x86/kernel/static_call.c b/arch/x86/kernel/static_call.c index 2892cdb..61592e4 100644 --- a/arch/x86/kernel/static_call.c +++ b/arch/x86/kernel/static_call.c @@ -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"); diff --git a/arch/x86/lib/error-inject.c b/arch/x86/lib/error-inject.c index b5a6d83..512a253 100644 --- a/arch/x86/lib/error-inject.c +++ b/arch/x86/lib/error-inject.c @@ -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" ); diff --git a/include/linux/annotate.h b/include/linux/annotate.h index 996126f..5efac5d 100644 --- a/include/linux/annotate.h +++ b/include/linux/annotate.h @@ -15,15 +15,15 @@ #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__ */ diff --git a/include/linux/objtool.h b/include/linux/objtool.h index b18ab53..9a00e70 100644 --- a/include/linux/objtool.h +++ b/include/linux/objtool.h @@ -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" \ ^ permalink raw reply related [flat|nested] 24+ messages in thread
end of thread, other threads:[~2025-12-03 19:24 UTC | newest] Thread overview: 24+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2025-12-02 17:59 [PATCH v2 0/4] objtool: Improve code generation for annotation macros Josh Poimboeuf 2025-12-02 17:59 ` [PATCH v2 1/4] x86/alternative: Remove ANNOTATE_DATA_SPECIAL usage Josh Poimboeuf 2025-12-03 16:40 ` [tip: objtool/urgent] " tip-bot2 for Josh Poimboeuf 2025-12-02 17:59 ` [PATCH v2 2/4] x86/asm: " Josh Poimboeuf 2025-12-03 16:40 ` [tip: objtool/urgent] " tip-bot2 for Josh Poimboeuf 2025-12-02 17:59 ` [PATCH v2 3/4] objtool: Consolidate annotation macros Josh Poimboeuf 2025-12-03 16:40 ` [tip: objtool/urgent] " tip-bot2 for Josh Poimboeuf 2025-12-03 16:49 ` Linus Torvalds 2025-12-03 16:57 ` Ingo Molnar 2025-12-03 17:20 ` Josh Poimboeuf 2025-12-03 17:21 ` Linus Torvalds 2025-12-03 17:44 ` Linus Torvalds 2025-12-03 17:51 ` Josh Poimboeuf 2025-12-03 18:07 ` [PATCH] objtool: More annotation code generation tweaks Josh Poimboeuf 2025-12-03 18:48 ` [tip: objtool/urgent] objtool: Simplify .annotate_insn code generation output some more tip-bot2 for Josh Poimboeuf 2025-12-03 17:46 ` [tip: objtool/urgent] objtool: Consolidate annotation macros Josh Poimboeuf 2025-12-03 18:41 ` Linus Torvalds 2025-12-03 19:17 ` Josh Poimboeuf 2025-12-03 19:24 ` Linus Torvalds 2025-12-03 18:48 ` Ingo Molnar 2025-12-03 18:48 ` tip-bot2 for Josh Poimboeuf 2025-12-02 17:59 ` [PATCH v2 4/4] objtool: Remove newlines and tabs from " Josh Poimboeuf 2025-12-03 16:40 ` [tip: objtool/urgent] " tip-bot2 for Josh Poimboeuf 2025-12-03 18:48 ` tip-bot2 for Josh Poimboeuf
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox