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

MIPS: r4k-bugs64: Limit R4k bug checks to affected systems

Only build the checks for R4k errata workarounds if we expect that the
kernel might actually run on a system with an R4k CPU - ie.
CONFIG_SYS_HAS_CPU_R4X00=y & we're targeting a pre-MIPSr1 ISA revision.

Rename cpu-bugs64.c to r4k-bugs64.c to indicate the fact that the code
is specific to R4k CPUs.

Signed-off-by: Paul Burton <paul.burton@mips.com>
Cc: linux-mips@vger.kernel.org

+14 -12
+4
arch/mips/Kconfig
··· 2554 2554 config CPU_R4400_WORKAROUNDS 2555 2555 bool 2556 2556 2557 + config CPU_R4X00_BUGS64 2558 + bool 2559 + default y if SYS_HAS_CPU_R4X00 && 64BIT && (TARGET_ISA_REV < 1) 2560 + 2557 2561 config MIPS_ASID_SHIFT 2558 2562 int 2559 2563 default 6 if CPU_R3000 || CPU_TX39XX
+8 -10
arch/mips/include/asm/bugs.h
··· 26 26 27 27 static inline void check_bugs_early(void) 28 28 { 29 - #ifdef CONFIG_64BIT 30 - check_bugs64_early(); 31 - #endif 29 + if (IS_ENABLED(CONFIG_CPU_R4X00_BUGS64)) 30 + check_bugs64_early(); 32 31 } 33 32 34 33 static inline void check_bugs(void) ··· 36 37 37 38 cpu_data[cpu].udelay_val = loops_per_jiffy; 38 39 check_bugs32(); 39 - #ifdef CONFIG_64BIT 40 - check_bugs64(); 41 - #endif 40 + 41 + if (IS_ENABLED(CONFIG_CPU_R4X00_BUGS64)) 42 + check_bugs64(); 42 43 } 43 44 44 45 static inline int r4k_daddiu_bug(void) 45 46 { 46 - #ifdef CONFIG_64BIT 47 + if (!IS_ENABLED(CONFIG_CPU_R4X00_BUGS64)) 48 + return 0; 49 + 47 50 WARN_ON(daddiu_bug < 0); 48 51 return daddiu_bug != 0; 49 - #else 50 - return 0; 51 - #endif 52 52 } 53 53 54 54 #endif /* _ASM_BUGS_H */
+1 -1
arch/mips/kernel/Makefile
··· 80 80 obj-$(CONFIG_PROC_FS) += proc.o 81 81 obj-$(CONFIG_MAGIC_SYSRQ) += sysrq.o 82 82 83 - obj-$(CONFIG_64BIT) += cpu-bugs64.o 83 + obj-$(CONFIG_CPU_R4X00_BUGS64) += r4k-bugs64.o 84 84 85 85 obj-$(CONFIG_I8253) += i8253.o 86 86
arch/mips/kernel/cpu-bugs64.c arch/mips/kernel/r4k-bugs64.c
+1 -1
arch/mips/kernel/genex.S
··· 657 657 .set pop 658 658 END(handle_ri_rdhwr) 659 659 660 - #ifdef CONFIG_64BIT 660 + #ifdef CONFIG_CPU_R4X00_BUGS64 661 661 /* A temporary overflow handler used by check_daddi(). */ 662 662 663 663 __INIT