* Re: [PATCH] x86/cfi: add __init_or_module annotations for fineibt
2026-05-26 3:22 [PATCH] x86/cfi: add __init_or_module annotations for fineibt Calvin Owens
@ 2026-05-26 5:08 ` Juergen Gross
2026-06-10 15:54 ` Calvin Owens
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Juergen Gross @ 2026-05-26 5:08 UTC (permalink / raw)
To: Calvin Owens, linux-kernel
Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
H. Peter Anvin, Peter Zijlstra, Mike Rapoport (Microsoft),
Kees Cook, Josh Poimboeuf, Mark Rutland
[-- Attachment #1.1.1: Type: text/plain, Size: 2016 bytes --]
On 26.05.26 05:22, Calvin Owens wrote:
> I'm seeing some benign section mismatch warnings with fineibt when
> building kernels with CONFIG_MODULES=n:
>
> WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0x1db (section: .text) -> text_poke_early (section: .init.text)
> WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0x473 (section: .text) -> text_poke_early (section: .init.text)
> WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0x57c (section: .text) -> text_poke_early (section: .init.text)
> WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0x6d9 (section: .text) -> text_poke_early (section: .init.text)
> WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0xb57 (section: .text) -> text_poke_early (section: .init.text)
> WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0xb81 (section: .text) -> text_poke_early (section: .init.text)
> WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0xd00 (section: .text) -> poison_endbr (section: .init.text)
> WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0xdd3 (section: .text) -> text_poke_early (section: .init.text)
> WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0xe58 (section: .text) -> text_poke_early (section: .init.text)
> WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0xe85 (section: .text) -> text_poke_early (section: .init.text)
> WARNING: modpost: vmlinux: section mismatch in reference: apply_fineibt+0x8 (section: .text.unlikely.) -> __apply_fineibt (section: .init.text)
>
> Add the missing __init_or_module section annotations to fix the
> warnings, and also free up a tiny bit of memory after boot.
>
> Signed-off-by: Calvin Owens <calvin@wbinvd.org>
Reviewed-by: Juergen Gross <jgross@suse.com>
Juergen
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3743 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] x86/cfi: add __init_or_module annotations for fineibt
2026-05-26 3:22 [PATCH] x86/cfi: add __init_or_module annotations for fineibt Calvin Owens
2026-05-26 5:08 ` Juergen Gross
@ 2026-06-10 15:54 ` Calvin Owens
2026-06-10 20:02 ` Borislav Petkov
2026-06-10 19:54 ` Kees Cook
2026-06-28 22:24 ` [tip: x86/cleanups] x86/cfi: Add " tip-bot2 for Calvin Owens
3 siblings, 1 reply; 7+ messages in thread
From: Calvin Owens @ 2026-06-10 15:54 UTC (permalink / raw)
To: linux-kernel
Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
H. Peter Anvin, Peter Zijlstra, Mike Rapoport (Microsoft),
Kees Cook, Juergen Gross, Josh Poimboeuf, Mark Rutland
On Monday 05/25 at 20:22 -0700, Calvin Owens wrote:
> I'm seeing some benign section mismatch warnings with fineibt when
> building kernels with CONFIG_MODULES=n:
>
> WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0x1db (section: .text) -> text_poke_early (section: .init.text)
> WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0x473 (section: .text) -> text_poke_early (section: .init.text)
> WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0x57c (section: .text) -> text_poke_early (section: .init.text)
> WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0x6d9 (section: .text) -> text_poke_early (section: .init.text)
> WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0xb57 (section: .text) -> text_poke_early (section: .init.text)
> WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0xb81 (section: .text) -> text_poke_early (section: .init.text)
> WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0xd00 (section: .text) -> poison_endbr (section: .init.text)
> WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0xdd3 (section: .text) -> text_poke_early (section: .init.text)
> WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0xe58 (section: .text) -> text_poke_early (section: .init.text)
> WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0xe85 (section: .text) -> text_poke_early (section: .init.text)
> WARNING: modpost: vmlinux: section mismatch in reference: apply_fineibt+0x8 (section: .text.unlikely.) -> __apply_fineibt (section: .init.text)
>
> Add the missing __init_or_module section annotations to fix the
> warnings, and also free up a tiny bit of memory after boot.
>
> Signed-off-by: Calvin Owens <calvin@wbinvd.org>
Gentle ping.
> ---
> arch/x86/kernel/alternative.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
> index 62936a3bde19..400baffcd609 100644
> --- a/arch/x86/kernel/alternative.c
> +++ b/arch/x86/kernel/alternative.c
> @@ -1775,8 +1775,8 @@ static int cfi_rewrite_callers(s32 *start, s32 *end)
> #define FINEIBT_WARN(_f, _v) \
> WARN_ONCE((_f) != (_v), "FineIBT: " #_f " %ld != %d\n", _f, _v)
>
> -static void __apply_fineibt(s32 *start_retpoline, s32 *end_retpoline,
> - s32 *start_cfi, s32 *end_cfi, bool builtin)
> +static void __init_or_module __apply_fineibt(s32 *start_retpoline, s32 *end_retpoline,
> + s32 *start_cfi, s32 *end_cfi, bool builtin)
> {
> int ret;
>
> @@ -2088,8 +2088,8 @@ bool decode_fineibt_insn(struct pt_regs *regs, unsigned long *target, u32 *type)
>
> #else /* !CONFIG_FINEIBT: */
>
> -static void __apply_fineibt(s32 *start_retpoline, s32 *end_retpoline,
> - s32 *start_cfi, s32 *end_cfi, bool builtin)
> +static void __init_or_module __apply_fineibt(s32 *start_retpoline, s32 *end_retpoline,
> + s32 *start_cfi, s32 *end_cfi, bool builtin)
> {
> if (IS_ENABLED(CONFIG_CFI) && builtin)
> pr_info("CFI: Using standard kCFI\n");
> @@ -2101,8 +2101,8 @@ static void poison_cfi(void *addr) { }
>
> #endif /* !CONFIG_FINEIBT */
>
> -void apply_fineibt(s32 *start_retpoline, s32 *end_retpoline,
> - s32 *start_cfi, s32 *end_cfi)
> +void __init_or_module apply_fineibt(s32 *start_retpoline, s32 *end_retpoline,
> + s32 *start_cfi, s32 *end_cfi)
> {
> return __apply_fineibt(start_retpoline, end_retpoline,
> start_cfi, end_cfi,
> --
> 2.47.3
>
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] x86/cfi: add __init_or_module annotations for fineibt
2026-06-10 15:54 ` Calvin Owens
@ 2026-06-10 20:02 ` Borislav Petkov
2026-06-11 4:05 ` Calvin Owens
0 siblings, 1 reply; 7+ messages in thread
From: Borislav Petkov @ 2026-06-10 20:02 UTC (permalink / raw)
To: Calvin Owens
Cc: linux-kernel, Thomas Gleixner, Ingo Molnar, Dave Hansen, x86,
H. Peter Anvin, Peter Zijlstra, Mike Rapoport (Microsoft),
Kees Cook, Juergen Gross, Josh Poimboeuf, Mark Rutland
On Wed, Jun 10, 2026 at 08:54:26AM -0700, Calvin Owens wrote:
> On Monday 05/25 at 20:22 -0700, Calvin Owens wrote:
> > I'm seeing some benign section mismatch warnings with fineibt when
> > building kernels with CONFIG_MODULES=n:
> >
> > WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0x1db (section: .text) -> text_poke_early (section: .init.text)
> > WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0x473 (section: .text) -> text_poke_early (section: .init.text)
> > WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0x57c (section: .text) -> text_poke_early (section: .init.text)
> > WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0x6d9 (section: .text) -> text_poke_early (section: .init.text)
> > WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0xb57 (section: .text) -> text_poke_early (section: .init.text)
> > WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0xb81 (section: .text) -> text_poke_early (section: .init.text)
> > WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0xd00 (section: .text) -> poison_endbr (section: .init.text)
> > WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0xdd3 (section: .text) -> text_poke_early (section: .init.text)
> > WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0xe58 (section: .text) -> text_poke_early (section: .init.text)
> > WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0xe85 (section: .text) -> text_poke_early (section: .init.text)
> > WARNING: modpost: vmlinux: section mismatch in reference: apply_fineibt+0x8 (section: .text.unlikely.) -> __apply_fineibt (section: .init.text)
> >
> > Add the missing __init_or_module section annotations to fix the
> > warnings, and also free up a tiny bit of memory after boot.
> >
> > Signed-off-by: Calvin Owens <calvin@wbinvd.org>
>
> Gentle ping.
This is just fixing warnings so it can wait until after the merge window,
right?
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] x86/cfi: add __init_or_module annotations for fineibt
2026-06-10 20:02 ` Borislav Petkov
@ 2026-06-11 4:05 ` Calvin Owens
0 siblings, 0 replies; 7+ messages in thread
From: Calvin Owens @ 2026-06-11 4:05 UTC (permalink / raw)
To: Borislav Petkov
Cc: linux-kernel, Thomas Gleixner, Ingo Molnar, Dave Hansen, x86,
H. Peter Anvin, Peter Zijlstra, Mike Rapoport (Microsoft),
Kees Cook, Juergen Gross, Josh Poimboeuf, Mark Rutland
On Wednesday 06/10 at 13:02 -0700, Borislav Petkov wrote:
> On Wed, Jun 10, 2026 at 08:54:26AM -0700, Calvin Owens wrote:
> > On Monday 05/25 at 20:22 -0700, Calvin Owens wrote:
> > > I'm seeing some benign section mismatch warnings with fineibt when
> > > building kernels with CONFIG_MODULES=n:
> > >
> > > WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0x1db (section: .text) -> text_poke_early (section: .init.text)
> > > WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0x473 (section: .text) -> text_poke_early (section: .init.text)
> > > WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0x57c (section: .text) -> text_poke_early (section: .init.text)
> > > WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0x6d9 (section: .text) -> text_poke_early (section: .init.text)
> > > WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0xb57 (section: .text) -> text_poke_early (section: .init.text)
> > > WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0xb81 (section: .text) -> text_poke_early (section: .init.text)
> > > WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0xd00 (section: .text) -> poison_endbr (section: .init.text)
> > > WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0xdd3 (section: .text) -> text_poke_early (section: .init.text)
> > > WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0xe58 (section: .text) -> text_poke_early (section: .init.text)
> > > WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0xe85 (section: .text) -> text_poke_early (section: .init.text)
> > > WARNING: modpost: vmlinux: section mismatch in reference: apply_fineibt+0x8 (section: .text.unlikely.) -> __apply_fineibt (section: .init.text)
> > >
> > > Add the missing __init_or_module section annotations to fix the
> > > warnings, and also free up a tiny bit of memory after boot.
> > >
> > > Signed-off-by: Calvin Owens <calvin@wbinvd.org>
> >
> > Gentle ping.
>
> This is just fixing warnings so it can wait until after the merge window,
> right?
It can definitely wait for 7.2, I just haven't seen it in -next yet.
But if it's easier to do it after 7.2-rc1 at this point that's fine too.
> --
> Regards/Gruss,
> Boris.
>
> https://people.kernel.org/tglx/notes-about-netiquette
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] x86/cfi: add __init_or_module annotations for fineibt
2026-05-26 3:22 [PATCH] x86/cfi: add __init_or_module annotations for fineibt Calvin Owens
2026-05-26 5:08 ` Juergen Gross
2026-06-10 15:54 ` Calvin Owens
@ 2026-06-10 19:54 ` Kees Cook
2026-06-28 22:24 ` [tip: x86/cleanups] x86/cfi: Add " tip-bot2 for Calvin Owens
3 siblings, 0 replies; 7+ messages in thread
From: Kees Cook @ 2026-06-10 19:54 UTC (permalink / raw)
To: Calvin Owens
Cc: linux-kernel, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
Dave Hansen, x86, H. Peter Anvin, Peter Zijlstra,
Mike Rapoport (Microsoft),
Juergen Gross, Josh Poimboeuf, Mark Rutland
On Mon, May 25, 2026 at 08:22:53PM -0700, Calvin Owens wrote:
> I'm seeing some benign section mismatch warnings with fineibt when
> building kernels with CONFIG_MODULES=n:
>
> WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0x1db (section: .text) -> text_poke_early (section: .init.text)
> WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0x473 (section: .text) -> text_poke_early (section: .init.text)
> WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0x57c (section: .text) -> text_poke_early (section: .init.text)
> WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0x6d9 (section: .text) -> text_poke_early (section: .init.text)
> WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0xb57 (section: .text) -> text_poke_early (section: .init.text)
> WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0xb81 (section: .text) -> text_poke_early (section: .init.text)
> WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0xd00 (section: .text) -> poison_endbr (section: .init.text)
> WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0xdd3 (section: .text) -> text_poke_early (section: .init.text)
> WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0xe58 (section: .text) -> text_poke_early (section: .init.text)
> WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0xe85 (section: .text) -> text_poke_early (section: .init.text)
> WARNING: modpost: vmlinux: section mismatch in reference: apply_fineibt+0x8 (section: .text.unlikely.) -> __apply_fineibt (section: .init.text)
>
> Add the missing __init_or_module section annotations to fix the
> warnings, and also free up a tiny bit of memory after boot.
>
> Signed-off-by: Calvin Owens <calvin@wbinvd.org>
Reviewed-by: Kees Cook <kees@kernel.org>
--
Kees Cook
^ permalink raw reply [flat|nested] 7+ messages in thread
* [tip: x86/cleanups] x86/cfi: Add __init_or_module annotations for fineibt
2026-05-26 3:22 [PATCH] x86/cfi: add __init_or_module annotations for fineibt Calvin Owens
` (2 preceding siblings ...)
2026-06-10 19:54 ` Kees Cook
@ 2026-06-28 22:24 ` tip-bot2 for Calvin Owens
3 siblings, 0 replies; 7+ messages in thread
From: tip-bot2 for Calvin Owens @ 2026-06-28 22:24 UTC (permalink / raw)
To: linux-tip-commits
Cc: Calvin Owens, Borislav Petkov (AMD),
Kees Cook, Juergen Gross, x86, linux-kernel
The following commit has been merged into the x86/cleanups branch of tip:
Commit-ID: bed18bbbf9d9af55ccc01a6e2a8ec90d7e35cb11
Gitweb: https://git.kernel.org/tip/bed18bbbf9d9af55ccc01a6e2a8ec90d7e35cb11
Author: Calvin Owens <calvin@wbinvd.org>
AuthorDate: Mon, 25 May 2026 20:22:53 -07:00
Committer: Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Sun, 28 Jun 2026 15:10:10 -07:00
x86/cfi: Add __init_or_module annotations for fineibt
I'm seeing some benign section mismatch warnings with fineibt when
building kernels with CONFIG_MODULES=n:
WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0x1db (section: .text) -> text_poke_early (section: .init.text)
WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0x473 (section: .text) -> text_poke_early (section: .init.text)
WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0x57c (section: .text) -> text_poke_early (section: .init.text)
WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0x6d9 (section: .text) -> text_poke_early (section: .init.text)
WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0xb57 (section: .text) -> text_poke_early (section: .init.text)
WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0xb81 (section: .text) -> text_poke_early (section: .init.text)
WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0xd00 (section: .text) -> poison_endbr (section: .init.text)
WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0xdd3 (section: .text) -> text_poke_early (section: .init.text)
WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0xe58 (section: .text) -> text_poke_early (section: .init.text)
WARNING: modpost: vmlinux: section mismatch in reference: __apply_fineibt+0xe85 (section: .text) -> text_poke_early (section: .init.text)
WARNING: modpost: vmlinux: section mismatch in reference: apply_fineibt+0x8 (section: .text.unlikely.) -> __apply_fineibt (section: .init.text)
Add the missing __init_or_module section annotations to fix the
warnings, and also free up a tiny bit of memory after boot.
Signed-off-by: Calvin Owens <calvin@wbinvd.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Kees Cook <kees@kernel.org>
Reviewed-by: Juergen Gross <jgross@suse.com>
Link: https://patch.msgid.link/1f50aecf23311dc5ffb965c5ccfb8b49208dbb3f.1779763849.git.calvin@wbinvd.org
---
arch/x86/kernel/alternative.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
index 62936a3..400baff 100644
--- a/arch/x86/kernel/alternative.c
+++ b/arch/x86/kernel/alternative.c
@@ -1775,8 +1775,8 @@ static int cfi_rewrite_callers(s32 *start, s32 *end)
#define FINEIBT_WARN(_f, _v) \
WARN_ONCE((_f) != (_v), "FineIBT: " #_f " %ld != %d\n", _f, _v)
-static void __apply_fineibt(s32 *start_retpoline, s32 *end_retpoline,
- s32 *start_cfi, s32 *end_cfi, bool builtin)
+static void __init_or_module __apply_fineibt(s32 *start_retpoline, s32 *end_retpoline,
+ s32 *start_cfi, s32 *end_cfi, bool builtin)
{
int ret;
@@ -2088,8 +2088,8 @@ bool decode_fineibt_insn(struct pt_regs *regs, unsigned long *target, u32 *type)
#else /* !CONFIG_FINEIBT: */
-static void __apply_fineibt(s32 *start_retpoline, s32 *end_retpoline,
- s32 *start_cfi, s32 *end_cfi, bool builtin)
+static void __init_or_module __apply_fineibt(s32 *start_retpoline, s32 *end_retpoline,
+ s32 *start_cfi, s32 *end_cfi, bool builtin)
{
if (IS_ENABLED(CONFIG_CFI) && builtin)
pr_info("CFI: Using standard kCFI\n");
@@ -2101,8 +2101,8 @@ static void poison_cfi(void *addr) { }
#endif /* !CONFIG_FINEIBT */
-void apply_fineibt(s32 *start_retpoline, s32 *end_retpoline,
- s32 *start_cfi, s32 *end_cfi)
+void __init_or_module apply_fineibt(s32 *start_retpoline, s32 *end_retpoline,
+ s32 *start_cfi, s32 *end_cfi)
{
return __apply_fineibt(start_retpoline, end_retpoline,
start_cfi, end_cfi,
^ permalink raw reply [flat|nested] 7+ messages in thread