[issue report] ARM: compile error of frame size

Geert Uytterhoeven geert at linux-m68k.org
Wed Oct 15 02:26:21 PDT 2025


Hi Liam,

On Tue, 14 Oct 2025 at 18:53, Liam R. Howlett <Liam.Howlett at oracle.com> wrote:
> * Geert Uytterhoeven <geert at linux-m68k.org> [251014 10:47]:
> > On Tue, 29 Jul 2025 at 09:49, Geert Uytterhoeven <geert at linux-m68k.org> wrote:
> > > On Tue, 29 Jul 2025 at 09:27, Arnd Bergmann <arnd at arndb.de> wrote:
> > > > On Tue, Jul 29, 2025, at 09:15, Geert Uytterhoeven wrote:
> > > > > On Tue, 29 Jul 2025 at 02:12, Kuninori Morimoto
> > > > > <kuninori.morimoto.gx at renesas.com> wrote:
> > > > >> > >         > grep CONFIG_FRAME_WARN .config
> > > > >> > >         CONFIG_FRAME_WARN=2040
> > > > >> > >
> > > > >> > >         > git diff
> > > > >> > >         diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
> > > > >> > >         index d61369b1eabe..c5173bd82380 100644
> > > > >> > >         --- a/arch/arm/boot/compressed/Makefile
> > > > >> > >         +++ b/arch/arm/boot/compressed/Makefile
> > > > >> > >         @@ -80,7 +80,7 @@ libfdt_objs := fdt_rw.o fdt_ro.o fdt_wip.o fdt.o
> > > > >> > >
> > > > >> > >          ifeq ($(CONFIG_ARM_ATAG_DTB_COMPAT),y)
> > > > >> > >          CFLAGS_REMOVE_atags_to_fdt.o += -Wframe-larger-than=${CONFIG_FRAME_WARN}
> > > > >> > > -        CFLAGS_atags_to_fdt.o += -Wframe-larger-than=1280
> > > > >> > > +        CFLAGS_atags_to_fdt.o += -Wframe-larger-than=2040
> > > > >> > >          OBJS   += $(libfdt_objs) atags_to_fdt.o
> > > > >> > >          endif
> > > > >> > >          ifeq ($(CONFIG_USE_OF),y)
> > > > >> (snip)
> > > > >> > Yes it is.  And it is hard to fix, according to the maple_tree maintainer:
> > > > >>
> > > > >> Hmm...
> > > > >> Actually I have tried to same solution (= remove or fix the big node), but
> > > > >> noticed there are many such code. My suggested was very simple solution
> > > > >> I guess, but I'm not sure detail of ARM limitation, and/or it can solve all
> > > > >> cases, etc...
> > > > >>
> > > > >> But other CPU (like ARM64) doesn't have this issue, so we can follow same
> > > > >> way (= allow large frame) I guess.
> > > > >
> > > > > I do see it in one my arm64 builds, it depends on your kernel config:
> > > > >
> > > > >     lib/maple_tree.c: In function ‘mas_wr_spanning_store’:
> > > > >     lib/maple_tree.c:3812:1: warning: the frame size of 1040 bytes is
> > > > > larger than 1024 bytes [-Wframe-larger-than=] 3812 | }
> > > > >
> > > > > I guess Arnd has seen it in his randconfig builds, too...
> > > > >
> > > > >> Does ARM has some reason which can't use large frame ? If not, do you think
> > > > >> we can allow to use it on ARM ?
> > > > >
> > > > > (stacked) Large frames may cause kernel stack overflow.
> > > >
> > > > The version below works around the warning for arm, arm64 and x86
> > > > on both gcc and clang.
> > >
> > > Thanks, that indeed works for my arm64 config that triggered it before.
> >
> > Unfortunately it no longer helps for my rbxt4927 build...
>
> I've been working on fixing this for a while and am approaching a point
> where I'll share my solution.
>
> The change is non-trivial and is required for expanding node type
> support.  But with the amount of change this introduces, I do not want
> to backport the patch set, if possible.
>
> Considering how close we are here (16 bytes), it may be better to find
> another solution to avoid the particular troubled builds.
>
> It is odd that this only shows up in certain cases though.  Is there a
> particular config option that is needed to cause the size to grow beyond
> 1024?

I don't know.  I bisected the issue in my rbxt4927 (MIPS) build to commit
6bf377b06c08049d ("maple_tree: Add single node allocation support to
maple state") in v6.18-rc1.

Reverting the s/inline/__always_inline/ in that commit does not fix
the issue, but

    --- a/lib/maple_tree.c
    +++ b/lib/maple_tree.c
    @@ -159,7 +159,7 @@ struct maple_subtree_state {
            struct maple_big_node *bn;
     };

    -#ifdef CONFIG_KASAN_STACK
    +#if 1 //def CONFIG_KASAN_STACK
     /* Prevent mas_wr_bnode() from exceeding the stack frame limit */
     #define noinline_for_kasan noinline_for_stack
     #else

does.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds



More information about the linux-arm-kernel mailing list