Re: [PATCH v10 00/10] x86: Quiesce text_poke() IPIs
From: Peter Zijlstra
Date: Tue Dec 01 2026 - 07:56:00 EST
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.
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.
Realistically we will likely live if you do it from the normal context
tracking code (you done that, it worked), but yes, tricky.