mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Ard Biesheuvel" <ardb@kernel.org>
To: "Nathan Chancellor" <nathan@kernel.org>,
	"Thomas Gleixner" <tglx@kernel.org>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Borislav Petkov" <bp@alien8.de>,
	"Dave Hansen" <dave.hansen@linux.intel.com>,
	x86@kernel.org
Cc: "Nick Desaulniers" <ndesaulniers@google.com>,
	"Bill Wendling" <morbo@google.com>,
	"Justin Stitt" <justinstitt@google.com>,
	linux-kernel@vger.kernel.org, llvm@lists.linux.dev,
	stable@vger.kernel.org
Subject: Re: [PATCH v2] x86/boot/compressed: Disable jump tables
Date: Thu, 23 Jul 2026 08:32:40 +0200	[thread overview]
Message-ID: <592164b0-9a0b-40f7-84ed-26705dca8408@app.fastmail.com> (raw)
In-Reply-To: <20260722-x86-boot-compressed-disable-jt-clang-v2-1-7373d38482fb@kernel.org>



On Thu, 23 Jul 2026, at 02:09, Nathan Chancellor wrote:
> After a recent upstream LLVM change to start generating jump and lookup
> tables in switch statements in more instances [1], linking the
> compressed x86 boot image when CONFIG_KERNEL_ZSTD is enabled fails with:
>
>   ld.lld: error: Unexpected run-time relocations (.rela) detected!
>
> Dumping the relocations in misc.o, which is the only file influenced by
> CONFIG_KERNEL_ZSTD in the decompressor, shows dynamic relocations to
> some string constants, which correspond to the string literals in the
> switch statement in handle_zstd_error():
>
>   Relocation section '.rela.data.rel.ro' at offset 0x277b0 contains 31 
> entries:
>       Offset             Info             Type               Symbol's 
> Value  Symbol's Name + Addend
>   0000000000000000  0000006600000001 R_X86_64_64            
> 0000000000000000 .rodata.str1.1 + 73a
>   0000000000000008  0000006600000001 R_X86_64_64            
> 0000000000000000 .rodata.str1.1 + 78e
>   0000000000000010  0000006600000001 R_X86_64_64            
> 0000000000000000 .rodata.str1.1 + 78e
>   0000000000000018  0000006600000001 R_X86_64_64            
> 0000000000000000 .rodata.str1.1 + 78e
>   ...
>
> This optimization is problematic for the decompressor environment, as it
> is built as -fPIE without any explicit absolute references (as described
> at the top of misc.c) while not applying any dynamic relocations, hence
> the linker assertion. To opt out of this optimization, which is of
> little value in this special early boot code, and to mirror the other
> x86 startup code in arch/x86/boot/startup, disable jump tables in the
> decompressor.
>
> Cc: stable@vger.kernel.org
> Closes: https://github.com/ClangBuiltLinux/linux/issues/2165
> Link: 
> https://github.com/llvm/llvm-project/commit/fa02a6ed66b1700c996b49c96c6bc0eb014c9518 
> [1]
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>

Acked-by: Ard Biesheuvel <ardb@kernel.org>

  reply	other threads:[~2026-07-23  6:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-23  0:09 Nathan Chancellor
2026-07-23  6:32 ` Ard Biesheuvel [this message]
2026-07-23  8:11 ` [tip: x86/urgent] " tip-bot2 for Nathan Chancellor

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=592164b0-9a0b-40f7-84ed-26705dca8408@app.fastmail.com \
    --to=ardb@kernel.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=justinstitt@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=mingo@redhat.com \
    --cc=morbo@google.com \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=stable@vger.kernel.org \
    --cc=tglx@kernel.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®