Re: [PATCH v10 00/10] x86: Quiesce text_poke() IPIs

From: Valentin Schneider

Date: Tue Dec 01 2026 - 13:41:40 EST


On 01/12/26 13:55, Peter Zijlstra wrote:
> On Tue, Dec 01, 2026 at 12:10:26PM +0100, Valentin Schneider wrote:
>
>> The real problem is those (kernel) TLB flushes. I found no way to
>> check/validate when/where exactly vmalloc accesses can happen in the kernel
>> entry, so the only sane approach was to have the catch-up sequence (TLB
>> flush) happen exactly when any vmalloc becomes possible: at the kPTI CR3
>> switch.
>
> Right, so the task stacks are vmalloc. So since you didn't qualify what
> vmalloc accesses are problematic, it is pretty much the very first thing
> you touch.
>

Well AFAICT it's quite often the task stacks... At least anything somewhat
fork-heavy on the HK CPUs will get there.

> On 'legacy' IDT systems we do that trampoline stack thing due to PTI;
> however:
>
>> All of that ugly ASM code is to pretty much reproduce context_tracking but
>> at CR3-switch level. If we can somehow validate/confirm that we can live
>> with stale vmalloc entries down to where ct_kernel_enter_state() happens,
>> then I could have this all be tied back to context_tracking() which was so
>> much cleaner. Unfortunately from what I understood from Dave regarding what
>> the CPU is allowed to cache behind our backs, it's really not that
>> straightforward, nor maybe even possible.
>
> all of that ugly CR3 ASM code is totally unused on FRED and as such none
> of this will work with FRED on.
>

Bah, I had dismissed that when looking at the NMI paths but now that I take
a proper look at it yeah, FRED gives this the finger.

> Realistically we will likely live if you do it from the normal context
> tracking code (you done that, it worked), but yes, tricky.

I don't really know how to go about this; yes technically this survived for
a few days of soak test, but the moment it explodes it's going to be nearly
undebuggable.

And that's all going to be hardware dependent, so even if I find a customer
willing to soak test this for a while, that's no guarantee it'll also work
on other setups.