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

MIPS: Correct `nofpu' non-functionality

The `cpu_has_fpu' feature flag must not be hardcoded to 1 or the `nofpu'
kernel option will be ignored. Remove any such overrides and add a
cautionary note. Hardcoding to 0 is fine for FPU-less platforms.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9694/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Maciej W. Rozycki and committed by
Ralf Baechle
18a2c2c6 e06b530b

+1 -6
+1
arch/mips/include/asm/cpu-features.h
··· 68 68 #ifndef cpu_has_octeon_cache 69 69 #define cpu_has_octeon_cache 0 70 70 #endif 71 + /* Don't override `cpu_has_fpu' to 1 or the "nofpu" option won't work. */ 71 72 #ifndef cpu_has_fpu 72 73 #define cpu_has_fpu (current_cpu_data.options & MIPS_CPU_FPU) 73 74 #define raw_cpu_has_fpu (raw_current_cpu_data.options & MIPS_CPU_FPU)
-1
arch/mips/include/asm/mach-cobalt/cpu-feature-overrides.h
··· 14 14 #define cpu_has_3k_cache 0 15 15 #define cpu_has_4k_cache 1 16 16 #define cpu_has_tx39_cache 0 17 - #define cpu_has_fpu 1 18 17 #define cpu_has_32fpr 1 19 18 #define cpu_has_counter 1 20 19 #define cpu_has_watch 0
-1
arch/mips/include/asm/mach-dec/cpu-feature-overrides.h
··· 15 15 /* Generic ones first. */ 16 16 #define cpu_has_tlb 1 17 17 #define cpu_has_tx39_cache 0 18 - #define cpu_has_fpu 1 19 18 #define cpu_has_divec 0 20 19 #define cpu_has_prefetch 0 21 20 #define cpu_has_mcheck 0
-1
arch/mips/include/asm/mach-ip22/cpu-feature-overrides.h
··· 16 16 #define cpu_has_tlb 1 17 17 #define cpu_has_4kex 1 18 18 #define cpu_has_4k_cache 1 19 - #define cpu_has_fpu 1 20 19 #define cpu_has_32fpr 1 21 20 #define cpu_has_counter 1 22 21 #define cpu_has_mips16 0
-1
arch/mips/include/asm/mach-ip32/cpu-feature-overrides.h
··· 26 26 /* Settings which are common for all ip32 CPUs */ 27 27 #define cpu_has_tlb 1 28 28 #define cpu_has_4kex 1 29 - #define cpu_has_fpu 1 30 29 #define cpu_has_32fpr 1 31 30 #define cpu_has_counter 1 32 31 #define cpu_has_mips16 0
-1
arch/mips/include/asm/mach-loongson/cpu-feature-overrides.h
··· 34 34 #define cpu_has_dsp 0 35 35 #define cpu_has_dsp2 0 36 36 #define cpu_has_ejtag 0 37 - #define cpu_has_fpu 1 38 37 #define cpu_has_ic_fills_f_dc 0 39 38 #define cpu_has_inclusive_pcaches 1 40 39 #define cpu_has_llsc 1
-1
arch/mips/include/asm/mach-rm/cpu-feature-overrides.h
··· 15 15 #define cpu_has_tlb 1 16 16 #define cpu_has_4kex 1 17 17 #define cpu_has_4k_cache 1 18 - #define cpu_has_fpu 1 19 18 #define cpu_has_32fpr 1 20 19 #define cpu_has_counter 1 21 20 #define cpu_has_watch 0