From: Ingo Molnar Date: Wed, 9 Apr 2025 21:11:20 +0000 (+0200) Subject: x86/fpu: Introduce the x86_task_fpu() helper method X-Git-Tag: v6.16-rc1~195^2~28^2~29 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=77fbccede633a5565cae084348b5459f6849086d;p=thirdparty%2Flinux.git x86/fpu: Introduce the x86_task_fpu() helper method The per-task FPU context/save area is allocated right next to task_struct, currently in a variable-size array via task_struct::thread.fpu[], but we plan to fully hide it from the C type scope. Introduce the x86_task_fpu() accessor that gets to the FPU context pointer explicitly from the task pointer. Right now this is a simple (task)->thread.fpu wrapper. Signed-off-by: Ingo Molnar Cc: Andy Lutomirski Cc: Brian Gerst Cc: Chang S. Bae Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Oleg Nesterov Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20250409211127.3544993-2-mingo@kernel.org --- diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index 5d2f7e5aff261..2f631e0adea34 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h @@ -523,6 +523,8 @@ struct thread_struct { */ }; +#define x86_task_fpu(task) (&(task)->thread.fpu) + extern void fpu_thread_struct_whitelist(unsigned long *offset, unsigned long *size); static inline void arch_thread_struct_whitelist(unsigned long *offset,