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

MIPS: Remove struct mm_context_t fp_mode_switching field

The fp_mode_switching field in struct mm_context_t was left unused by
commit 8c8d953c2800 ("MIPS: Schedule on CPUs we need to lose FPU for a
mode switch") in v4.19, with nothing modifying its value & nothing
waiting on it having any particular value after that commit. Remove the
unused field & the one remaining reference to it.

Signed-off-by: Paul Burton <paul.burton@mips.com>

+3 -7
-1
arch/mips/include/asm/mmu.h
··· 9 9 typedef struct { 10 10 u64 asid[NR_CPUS]; 11 11 void *vdso; 12 - atomic_t fp_mode_switching; 13 12 14 13 /* lock to be held whilst modifying fp_bd_emupage_allocmap */ 15 14 spinlock_t bd_emupage_lock;
+3 -6
arch/mips/kernel/process.c
··· 737 737 /* 738 738 * This is icky, but we use this to simply ensure that all CPUs have 739 739 * context switched, regardless of whether they were previously running 740 - * kernel or user code. This ensures that no CPU currently has its FPU 741 - * enabled, or is about to attempt to enable it through any path other 742 - * than enable_restore_fp_context() which will wait appropriately for 743 - * fp_mode_switching to be zero. 740 + * kernel or user code. This ensures that no CPU that a mode-switching 741 + * program may execute on keeps its FPU enabled (& in the old mode) 742 + * throughout the mode switch. 744 743 */ 745 744 return 0; 746 745 } ··· 827 828 for_each_cpu_and(cpu, &process_cpus, cpu_online_mask) 828 829 work_on_cpu(cpu, prepare_for_fp_mode_switch, NULL); 829 830 put_online_cpus(); 830 - 831 - wake_up_var(&task->mm->context.fp_mode_switching); 832 831 833 832 return 0; 834 833 }