[PATCH] arm64: scs: Work around full LTO issue with dynamic SCS

Sami Tolvanen samitolvanen at google.com
Wed Jan 10 12:33:42 PST 2024


On Wed, Jan 10, 2024 at 12:22 PM Ard Biesheuvel <ardb at kernel.org> wrote:
>
> (cc Nathan)
>
> On Wed, 10 Jan 2024 at 20:58, Sami Tolvanen <samitolvanen at google.com> wrote:
> >
> > Hi Ard,
> >
> > On Wed, Jan 10, 2024 at 5:26 AM Ard Biesheuvel <ardb+git at google.com> wrote:
> > >
> > > From: Ard Biesheuvel <ardb at kernel.org>
> > >
> > > Full LTO takes the '-mbranch-protection=none' passed to the compiler
> > > when generating the dynamic shadow call stack patching code as a hint to
> > > stop emitting PAC instructions altogether. (Thin LTO appears unaffected
> > > by this)
> >
> > Does this affect all Clang versions? Is there a compiler bug filed for
> > this issue?
> >
>
> No, not yet.
>
> I suppose reporting this as-is with LLVM is not going to be practical,
> but I'm not sure how to isolate a reproducer. Note that there are
> other compilation units (under arch/arm64/kernel/pi) that are also
> built with -mbranch-protection=none, but those don't appear to trigger
> this issue in the same way.

It's probably because LTO is disabled for the directory, so the TUs
there get compiled separately.

Sami



More information about the linux-arm-kernel mailing list