From: "tip-bot2 for Josh Poimboeuf" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Josh Poimboeuf <jpoimboe@kernel.org>,
Ingo Molnar <mingo@kernel.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: objtool/urgent] x86/asm: Remove ANNOTATE_DATA_SPECIAL usage
Date: Wed, 03 Dec 2025 16:40:35 -0000 [thread overview]
Message-ID: <176478003520.498.13862518343962465253.tip-bot2@tip-bot2> (raw)
In-Reply-To: <b858cb7891c1ba0080e22a9c32595e6c302435e2.1764694625.git.jpoimboe@kernel.org>
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>
next prev parent reply other threads:[~2025-12-03 16:40 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
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-bot2 for Josh Poimboeuf [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=176478003520.498.13862518343962465253.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=jpoimboe@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®