[PATCH 04/15] x86: implement thread identity handoff

Peter Zijlstra peterz at infradead.org
Mon Sep 14 04:46:56 PDT 2026


On Fri, Sep 11, 2026 at 09:40:54AM -0600, Jens Axboe wrote:

> +/* state bound to the task that neither side may have */
> +static bool thread_handoff_task_ok(struct task_struct *tsk)
> +{
> +	/* I/O permissions, the bitmap hangs off the task */
> +	if (test_tsk_thread_flag(tsk, TIF_IO_BITMAP) || tsk->thread.iopl_emul)
> +		return false;
> +#ifdef CONFIG_X86_USER_SHADOW_STACK
> +	/* the shadow stack is per-thread and would have to move along */
> +	if (tsk->thread.features & ARCH_SHSTK_SHSTK)
> +		return false;
> +#endif

Distributions are having this enabled, this means nobody will pass this
check.

> +	/* only the default sized FPU state gets copied over, no AMX */
> +	if (x86_task_fpu(tsk)->fpstate->is_valloc)
> +		return false;
> +	return true;
> +}



More information about the linux-arm-kernel mailing list