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

MIPS: remove asm/war.h

The major part for workaround handling has already moved to config
options. This change replaces the remaining defines by already
available config options and gets rid of war.h

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>

+47 -91
+38
arch/mips/Kconfig
··· 2521 2521 # 2522 2522 # CPU non-features 2523 2523 # 2524 + 2525 + # Work around the "daddi" and "daddiu" CPU errata: 2526 + # 2527 + # - The `daddi' instruction fails to trap on overflow. 2528 + # "MIPS R4000PC/SC Errata, Processor Revision 2.2 and 3.0", 2529 + # erratum #23 2530 + # 2531 + # - The `daddiu' instruction can produce an incorrect result. 2532 + # "MIPS R4000PC/SC Errata, Processor Revision 2.2 and 3.0", 2533 + # erratum #41 2534 + # "MIPS R4000MC Errata, Processor Revision 2.2 and 3.0", erratum 2535 + # #15 2536 + # "MIPS R4400PC/SC Errata, Processor Revision 1.0", erratum #7 2537 + # "MIPS R4400MC Errata, Processor Revision 1.0", erratum #5 2524 2538 config CPU_DADDI_WORKAROUNDS 2525 2539 bool 2526 2540 2541 + # Work around certain R4000 CPU errata (as implemented by GCC): 2542 + # 2543 + # - A double-word or a variable shift may give an incorrect result 2544 + # if executed immediately after starting an integer division: 2545 + # "MIPS R4000PC/SC Errata, Processor Revision 2.2 and 3.0", 2546 + # erratum #28 2547 + # "MIPS R4000MC Errata, Processor Revision 2.2 and 3.0", erratum 2548 + # #19 2549 + # 2550 + # - A double-word or a variable shift may give an incorrect result 2551 + # if executed while an integer multiplication is in progress: 2552 + # "MIPS R4000PC/SC Errata, Processor Revision 2.2 and 3.0", 2553 + # errata #16 & #28 2554 + # 2555 + # - An integer division may give an incorrect result if started in 2556 + # a delay slot of a taken branch or a jump: 2557 + # "MIPS R4000PC/SC Errata, Processor Revision 2.2 and 3.0", 2558 + # erratum #52 2527 2559 config CPU_R4000_WORKAROUNDS 2528 2560 bool 2529 2561 select CPU_R4400_WORKAROUNDS 2530 2562 2563 + # Work around certain R4400 CPU errata (as implemented by GCC): 2564 + # 2565 + # - A double-word or a variable shift may give an incorrect result 2566 + # if executed immediately after starting an integer division: 2567 + # "MIPS R4400MC Errata, Processor Revision 1.0", erratum #10 2568 + # "MIPS R4400MC Errata, Processor Revision 2.0 & 3.0", erratum #4 2531 2569 config CPU_R4400_WORKAROUNDS 2532 2570 bool 2533 2571
-1
arch/mips/include/asm/futex.h
··· 17 17 #include <asm/compiler.h> 18 18 #include <asm/errno.h> 19 19 #include <asm/sync.h> 20 - #include <asm/war.h> 21 20 22 21 #define arch_futex_atomic_op_inuser arch_futex_atomic_op_inuser 23 22 #define futex_atomic_cmpxchg_inatomic futex_atomic_cmpxchg_inatomic
-1
arch/mips/include/asm/mipsmtregs.h
··· 9 9 #define _ASM_MIPSMTREGS_H 10 10 11 11 #include <asm/mipsregs.h> 12 - #include <asm/war.h> 13 12 14 13 #ifndef __ASSEMBLY__ 15 14
-1
arch/mips/include/asm/mipsregs.h
··· 17 17 #include <linux/types.h> 18 18 #include <asm/hazards.h> 19 19 #include <asm/isa-rev.h> 20 - #include <asm/war.h> 21 20 22 21 /* 23 22 * The following macros are especially useful for __asm__
-73
arch/mips/include/asm/war.h
··· 1 - /* 2 - * This file is subject to the terms and conditions of the GNU General Public 3 - * License. See the file "COPYING" in the main directory of this archive 4 - * for more details. 5 - * 6 - * Copyright (C) 2002, 2004, 2007 by Ralf Baechle 7 - * Copyright (C) 2007 Maciej W. Rozycki 8 - */ 9 - #ifndef _ASM_WAR_H 10 - #define _ASM_WAR_H 11 - 12 - /* 13 - * Work around certain R4000 CPU errata (as implemented by GCC): 14 - * 15 - * - A double-word or a variable shift may give an incorrect result 16 - * if executed immediately after starting an integer division: 17 - * "MIPS R4000PC/SC Errata, Processor Revision 2.2 and 3.0", 18 - * erratum #28 19 - * "MIPS R4000MC Errata, Processor Revision 2.2 and 3.0", erratum 20 - * #19 21 - * 22 - * - A double-word or a variable shift may give an incorrect result 23 - * if executed while an integer multiplication is in progress: 24 - * "MIPS R4000PC/SC Errata, Processor Revision 2.2 and 3.0", 25 - * errata #16 & #28 26 - * 27 - * - An integer division may give an incorrect result if started in 28 - * a delay slot of a taken branch or a jump: 29 - * "MIPS R4000PC/SC Errata, Processor Revision 2.2 and 3.0", 30 - * erratum #52 31 - */ 32 - #ifdef CONFIG_CPU_R4000_WORKAROUNDS 33 - #define R4000_WAR 1 34 - #else 35 - #define R4000_WAR 0 36 - #endif 37 - 38 - /* 39 - * Work around certain R4400 CPU errata (as implemented by GCC): 40 - * 41 - * - A double-word or a variable shift may give an incorrect result 42 - * if executed immediately after starting an integer division: 43 - * "MIPS R4400MC Errata, Processor Revision 1.0", erratum #10 44 - * "MIPS R4400MC Errata, Processor Revision 2.0 & 3.0", erratum #4 45 - */ 46 - #ifdef CONFIG_CPU_R4400_WORKAROUNDS 47 - #define R4400_WAR 1 48 - #else 49 - #define R4400_WAR 0 50 - #endif 51 - 52 - /* 53 - * Work around the "daddi" and "daddiu" CPU errata: 54 - * 55 - * - The `daddi' instruction fails to trap on overflow. 56 - * "MIPS R4000PC/SC Errata, Processor Revision 2.2 and 3.0", 57 - * erratum #23 58 - * 59 - * - The `daddiu' instruction can produce an incorrect result. 60 - * "MIPS R4000PC/SC Errata, Processor Revision 2.2 and 3.0", 61 - * erratum #41 62 - * "MIPS R4000MC Errata, Processor Revision 2.2 and 3.0", erratum 63 - * #15 64 - * "MIPS R4400PC/SC Errata, Processor Revision 1.0", erratum #7 65 - * "MIPS R4400MC Errata, Processor Revision 1.0", erratum #5 66 - */ 67 - #ifdef CONFIG_CPU_DADDI_WORKAROUNDS 68 - #define DADDI_WAR 1 69 - #else 70 - #define DADDI_WAR 0 71 - #endif 72 - 73 - #endif /* _ASM_WAR_H */
-1
arch/mips/kernel/entry.S
··· 17 17 #include <asm/stackframe.h> 18 18 #include <asm/isadep.h> 19 19 #include <asm/thread_info.h> 20 - #include <asm/war.h> 21 20 22 21 #ifndef CONFIG_PREEMPTION 23 22 #define resume_kernel restore_all
-1
arch/mips/kernel/genex.S
··· 19 19 #include <asm/mipsregs.h> 20 20 #include <asm/stackframe.h> 21 21 #include <asm/sync.h> 22 - #include <asm/war.h> 23 22 #include <asm/thread_info.h> 24 23 25 24 __INIT
+6 -3
arch/mips/kernel/r4k-bugs64.c
··· 163 163 } 164 164 165 165 pr_cont("no.\n"); 166 - panic(bug64hit, !R4000_WAR ? r4kwar : nowar); 166 + panic(bug64hit, 167 + IS_ENABLED(CONFIG_CPU_R4000_WORKAROUNDS) ? nowar : r4kwar); 167 168 } 168 169 169 170 static volatile int daddi_ov; ··· 240 239 } 241 240 242 241 pr_cont("no.\n"); 243 - panic(bug64hit, !DADDI_WAR ? daddiwar : nowar); 242 + panic(bug64hit, 243 + IS_ENABLED(CONFIG_CPU_DADDI_WORKAROUNDS) ? nowar : daddiwar); 244 244 } 245 245 246 246 int daddiu_bug = -1; ··· 309 307 } 310 308 311 309 pr_cont("no.\n"); 312 - panic(bug64hit, !DADDI_WAR ? daddiwar : nowar); 310 + panic(bug64hit, 311 + IS_ENABLED(CONFIG_CPU_DADDI_WORKAROUNDS) ? nowar : daddiwar); 313 312 } 314 313 315 314 void __init check_bugs64_early(void)
-1
arch/mips/kernel/scall32-o32.S
··· 19 19 #include <asm/sysmips.h> 20 20 #include <asm/thread_info.h> 21 21 #include <asm/unistd.h> 22 - #include <asm/war.h> 23 22 #include <asm/asm-offsets.h> 24 23 25 24 .align 5
-1
arch/mips/kernel/scall64-n64.S
··· 18 18 #include <asm/sysmips.h> 19 19 #include <asm/thread_info.h> 20 20 #include <asm/unistd.h> 21 - #include <asm/war.h> 22 21 23 22 #ifndef CONFIG_MIPS32_COMPAT 24 23 /* Neither O32 nor N32, so define handle_sys here */
-1
arch/mips/kernel/signal.c
··· 35 35 #include <asm/sim.h> 36 36 #include <asm/ucontext.h> 37 37 #include <asm/cpu-features.h> 38 - #include <asm/war.h> 39 38 #include <asm/dsp.h> 40 39 #include <asm/inst.h> 41 40 #include <asm/msa.h>
-1
arch/mips/kernel/signal_n32.c
··· 24 24 #include <asm/ucontext.h> 25 25 #include <asm/fpu.h> 26 26 #include <asm/cpu-features.h> 27 - #include <asm/war.h> 28 27 29 28 #include "signal-common.h" 30 29
-1
arch/mips/lib/delay.c
··· 16 16 17 17 #include <asm/asm.h> 18 18 #include <asm/compiler.h> 19 - #include <asm/war.h> 20 19 21 20 #ifndef CONFIG_CPU_DADDI_WORKAROUNDS 22 21 #define GCC_DADDI_IMM_ASM() "I"
-1
arch/mips/mm/c-octeon.c
··· 23 23 #include <asm/r4kcache.h> 24 24 #include <asm/traps.h> 25 25 #include <asm/mmu_context.h> 26 - #include <asm/war.h> 27 26 28 27 #include <asm/octeon/octeon.h> 29 28
-1
arch/mips/mm/c-r4k.c
··· 33 33 #include <asm/r4kcache.h> 34 34 #include <asm/sections.h> 35 35 #include <asm/mmu_context.h> 36 - #include <asm/war.h> 37 36 #include <asm/cacheflush.h> /* for run_uncached() */ 38 37 #include <asm/traps.h> 39 38 #include <asm/mips-cps.h>
+3 -2
arch/mips/mm/page.c
··· 25 25 #include <asm/mipsregs.h> 26 26 #include <asm/mmu_context.h> 27 27 #include <asm/cpu.h> 28 - #include <asm/war.h> 29 28 30 29 #ifdef CONFIG_SIBYTE_DMA_PAGEOPS 31 30 #include <asm/sibyte/sb1250.h> ··· 102 103 static inline void 103 104 pg_addiu(u32 **buf, unsigned int reg1, unsigned int reg2, unsigned int off) 104 105 { 105 - if (cpu_has_64bit_gp_regs && DADDI_WAR && r4k_daddiu_bug()) { 106 + if (cpu_has_64bit_gp_regs && 107 + IS_ENABLED(CONFIG_CPU_DADDI_WORKAROUNDS) && 108 + r4k_daddiu_bug()) { 106 109 if (off > 0x7fff) { 107 110 uasm_i_lui(buf, T9, uasm_rel_hi(off)); 108 111 uasm_i_addiu(buf, T9, T9, uasm_rel_lo(off));
-1
arch/mips/mm/tlbex.c
··· 33 33 #include <asm/cacheflush.h> 34 34 #include <asm/cpu-type.h> 35 35 #include <asm/mmu_context.h> 36 - #include <asm/war.h> 37 36 #include <asm/uasm.h> 38 37 #include <asm/setup.h> 39 38 #include <asm/tlbex.h>