Re: [PATCH v10 00/10] x86: Quiesce text_poke() IPIs
From: Steven Rostedt
Date: Mon Nov 30 2026 - 13:50:50 EST
On Mon, 30 Nov 2026 09:55:32 -0800
Dave Hansen <dave.hansen@xxxxxxxxx> wrote:
> On 11/30/26 09:44, Steven Rostedt wrote:
> > On Mon, 30 Nov 2026 09:31:55 -0800 Dave Hansen <dave.hansen@xxxxxxxxx> wrote:
> >> On 11/27/26 12:12, Valentin Schneider wrote:
> >>> So yeah, thoughts welcome here!
> >> My first thought is that it's not worth it. Want to skip text patching
> >> IPIs? Get a Meltdown-free CPU.
> > Hmm, how does that help?
>
> I honestly don't mean to be dismissive about it. There are natural
> limits to how far we're willing to push the kernel to achieve a given
> goal. Think of the 4G/4G kernel patches [1] for example.
>
> There were two ways to get 64GB of RAM on x86 in those days: Run the
> 4G/4G patches or get an x86_64 CPU. The upstream kernel path was "get an
> x86_64 CPU".
>
> So, how do we avoid text_poke() IPIs? There are two paths I see:
>
> A. Get a Meltdown-free CPU.
> Pro: Simpler kernel maintenance forever
> Con: Lots of otherwise-fine CPUs can't avoid the IPIs
I guess my question is why does a Meltdown-free CPU not need the IPIs?
Text poke changes the running kernel text. To do so, it must synchronize
*all* CPUs. It's needed because of required memory barrier that all CPUs
must perform.
In order to convert a nop into a jump, the patching CPU will create a new
page table over the text page that needs to be udpated. It then inserts a
breakpoint at the beginning instruction. In order to make sure all CPUs see
that breakpoint, it issues an IPI to all CPUS to force memory barriers. It
then updates the rest of the instruction and issues another set of IPIs to
force all CPUs to see the new update. It then replaces the breakpoint with
the jump op code and now all CPUs see a jump and not a nop.
Of course a CPU running in user space under NO_HZ doesn't need the IPI as
it's not executing kernel code. Which is the point of this patch series.
> B. Merge something like this series
> Pro: Old CPUs are free of text_poke() IPIs
> Con: A harder to maintain kernel forever
>
> So, how does it help to just throw out all the old CPUs? It makes
> maintaining this chunk of the kernel easier forever.
>
> 1. https://lwn.net/Articles/39283/
I haven't looked at the entire patch set yet, and I'm guessing there's ugly
logic to handle old Meltdown CPUs. I'm fine if we only make this feature
available for kernels without the meltdown mitigation. My point was that
even with a Meltdown-free CPU we still need IPIs.
-- Steve