From: Nathan Chancellor <nathan@kernel.org>
To: Ingo Molnar <mingo@kernel.org>, Peter Zijlstra <peterz@infradead.org>
Cc: 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, Ard Biesheuvel <ardb@kernel.org>,
Nick Desaulniers <nick.desaulniers+lkml@gmail.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] x86/boot/compressed: Disable jump tables for clang
Date: Wed, 24 Jun 2026 15:17:39 -0700 [thread overview]
Message-ID: <20260624221739.GA7516@ax162> (raw)
In-Reply-To: <ajupfkcZTTxGP2dG@gmail.com>
On Wed, Jun 24, 2026 at 11:55:10AM +0200, Ingo Molnar wrote:
>
> * Ingo Molnar <mingo@kernel.org> wrote:
>
>
> > > I'm sitting on a patch to unconditionally disable jump-tables for
> > > x86_64:
> > >
> > > https://web.git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/log/?h=x86/syscall
> >
> > In particular:
> >
> > https://web.git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/commit/?h=x86/syscall&id=76612388fe7aa41a8eb88f890d451bc17255eda0
>
> Side note: since arch/x86/boot/compressed/Makefile constructs
> its own KBUILD_CFLAGS, so a change to that Makefile will still
> be required to universally apply -fno-jump-tables and work
> around this Clang optimization in the decompression code.
Right. I had intentionally kept my change scoped to clang to be less
controversial but in the face of Peter's series, it makes sense to do it
for all compilers like Ingo suggested. I have no preference for how we
proceed here. I don't mind sending a v2 with something like
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
index 07e0e64b9a98..06934f9691d6 100644
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
@@ -27,6 +27,7 @@ targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma \
KBUILD_CFLAGS := -m$(BITS) -O2 $(CLANG_FLAGS)
KBUILD_CFLAGS += $(CC_FLAGS_DIALECT)
KBUILD_CFLAGS += -fno-strict-aliasing -fPIE
+KBUILD_CFLAGS += -fno-jump-tables
KBUILD_CFLAGS += -Wundef
KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
cflags-$(CONFIG_X86_32) := -march=i386
--
Another option would be Peter folding that diff into his series then
once it lands, I could send this patch to the stable team with most of
this patch's justification intact with a note that the equivalent change
has been applied to mainline under a different justification. Just let
me know what you all would prefer.
--
Cheers,
Nathan
next prev parent reply other threads:[~2026-06-24 22:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-23 21:47 [PATCH] x86/boot/compressed: Disable jump tables for clang Nathan Chancellor
2026-06-24 9:36 ` Ingo Molnar
2026-06-24 9:38 ` Peter Zijlstra
2026-06-24 9:51 ` Ingo Molnar
2026-06-24 9:55 ` Ingo Molnar
2026-06-24 22:17 ` Nathan Chancellor [this message]
2026-06-25 8:06 ` David Laight
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=20260624221739.GA7516@ax162 \
--to=nathan@kernel.org \
--cc=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@kernel.org \
--cc=mingo@redhat.com \
--cc=morbo@google.com \
--cc=nick.desaulniers+lkml@gmail.com \
--cc=peterz@infradead.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.