From: Nathan Chancellor <nathan@kernel.org>
To: David Laight <david.laight.linux@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <peterz@infradead.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, 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: Fri, 26 Jun 2026 16:28:53 -0700 [thread overview]
Message-ID: <20260626232853.GA547411@ax162> (raw)
In-Reply-To: <20260625090617.4f3f68bf@pumpkin>
On Thu, Jun 25, 2026 at 09:06:17AM +0100, David Laight wrote:
> On Wed, 24 Jun 2026 15:17:39 -0700
> Nathan Chancellor <nathan@kernel.org> wrote:
>
> > 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
>
> Isn't this solving a different problem?
> Jump tables are disabled for the kernel build to avoid speculation of
> mispredicted indirect jumps.
> Here they are needed to stop the compiler output containing 'things' the
> restricted environment can't support.
Yeah but if the end result for both is just -fno-jump-tables, it is not
like the reasoning really matters all that much? Maybe it matters for
the person that comes along to blame -fno-jump-tables in the compressed
boot Makefile. In that case, my patch could be added to Peter's series
with its original justification but applied to all compilers like Ingo
suggested? Again, no real preference.
> Someone building a kernel for a local machine may want to disable all of
> the mitigations to avoid their associated costs and also enable jump
> tables to avoid the cost of all the mispredicted branches in the comparison
> tree.
Then they get to deal with the fallout of such a change :)
--
Cheers,
Nathan
prev parent reply other threads:[~2026-06-26 23:28 UTC|newest]
Thread overview: 8+ 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
2026-06-25 8:06 ` David Laight
2026-06-26 23:28 ` Nathan Chancellor [this message]
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=20260626232853.GA547411@ax162 \
--to=nathan@kernel.org \
--cc=ardb@kernel.org \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=david.laight.linux@gmail.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.