Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'x86-fpu-2023-02-20' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 fpu updates from Ingo Molnar:

- Replace zero-length array in struct xregs_state with flexible-array
member, to help the enabling of stricter compiler checks.

- Don't set TIF_NEED_FPU_LOAD for PF_IO_WORKER threads.

* tag 'x86-fpu-2023-02-20' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/fpu: Don't set TIF_NEED_FPU_LOAD for PF_IO_WORKER threads
x86/fpu: Replace zero-length array in struct xregs_state with flexible-array member

+4 -4
+1 -1
arch/x86/include/asm/fpu/sched.h
··· 39 39 static inline void switch_fpu_prepare(struct fpu *old_fpu, int cpu) 40 40 { 41 41 if (cpu_feature_enabled(X86_FEATURE_FPU) && 42 - !(current->flags & PF_KTHREAD)) { 42 + !(current->flags & (PF_KTHREAD | PF_IO_WORKER))) { 43 43 save_fpregs_to_fpstate(old_fpu); 44 44 /* 45 45 * The save operation preserved register state, so the
+1 -1
arch/x86/include/asm/fpu/types.h
··· 321 321 struct xregs_state { 322 322 struct fxregs_state i387; 323 323 struct xstate_header header; 324 - u8 extended_state_area[0]; 324 + u8 extended_state_area[]; 325 325 } __attribute__ ((packed, aligned (64))); 326 326 327 327 /*
+1 -1
arch/x86/kernel/fpu/context.h
··· 57 57 struct fpu *fpu = &current->thread.fpu; 58 58 int cpu = smp_processor_id(); 59 59 60 - if (WARN_ON_ONCE(current->flags & PF_KTHREAD)) 60 + if (WARN_ON_ONCE(current->flags & (PF_KTHREAD | PF_IO_WORKER))) 61 61 return; 62 62 63 63 if (!fpregs_state_valid(fpu, cpu)) {
+1 -1
arch/x86/kernel/fpu/core.c
··· 426 426 427 427 this_cpu_write(in_kernel_fpu, true); 428 428 429 - if (!(current->flags & PF_KTHREAD) && 429 + if (!(current->flags & (PF_KTHREAD | PF_IO_WORKER)) && 430 430 !test_thread_flag(TIF_NEED_FPU_LOAD)) { 431 431 set_thread_flag(TIF_NEED_FPU_LOAD); 432 432 save_fpregs_to_fpstate(&current->thread.fpu);