diff options
author | Maciej W. Rozycki <macro@linux-mips.org> | 2007-10-23 07:43:25 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2008-01-29 05:14:55 -0500 |
commit | 619b6e18fce20e4b2d0082cde989f37e1be7b3e1 (patch) | |
tree | b56120c0de584f6672aa7e4533163435613f5203 /arch/mips/kernel | |
parent | 20d60d9973c3b441902b0a3f4f6f7e7ade08f77d (diff) |
[MIPS] R4000/R4400 daddiu erratum workaround
This complements the generic R4000/R4400 errata workaround code and adds
bits for the daddiu problem. In most places it just modifies handwritten
assembly code so that the assembler is allowed to use a temporary register
as daddiu may now be treated as a macro that expands to a sequence of li
and daddu. It is the AT register or, where AT is unavailable or used
explicitly for another purpose, an explicitly-named register is selected,
using the .set at=<reg> feature added recently to gas. This feature is
only used if CONFIG_CPU_DADDI_WORKAROUNDS has been set, so if the
workaround remains disabled, the required version of binutils stays
unchanged.
Similarly, daddiu instructions put in branch delay slots in noreorder
fragments are now taken out of them and the assembler is allowed to
reorder them itself as possible (which it does making the whole idea of
scheduling them into delay slots manually questionable).
Also in the very few places where such a simple conversion was not
possible, a handcoded longer sequence is implemented.
Other than that there are changes to code responsible for building the
TLB fault and page clear/copy handlers to avoid daddiu as appropriate.
These are only effective if the erratum is verified to be present at the
run time.
Finally there is a trivial update to __delay(), because it uses daddiu in
a branch delay slot.
Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r-- | arch/mips/kernel/genex.S | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S index e76a76bf0b3d..c6ada98ee042 100644 --- a/arch/mips/kernel/genex.S +++ b/arch/mips/kernel/genex.S | |||
@@ -6,7 +6,7 @@ | |||
6 | * Copyright (C) 1994 - 2000, 2001, 2003 Ralf Baechle | 6 | * Copyright (C) 1994 - 2000, 2001, 2003 Ralf Baechle |
7 | * Copyright (C) 1999, 2000 Silicon Graphics, Inc. | 7 | * Copyright (C) 1999, 2000 Silicon Graphics, Inc. |
8 | * Copyright (C) 2001 MIPS Technologies, Inc. | 8 | * Copyright (C) 2001 MIPS Technologies, Inc. |
9 | * Copyright (C) 2002 Maciej W. Rozycki | 9 | * Copyright (C) 2002, 2007 Maciej W. Rozycki |
10 | */ | 10 | */ |
11 | #include <linux/init.h> | 11 | #include <linux/init.h> |
12 | 12 | ||
@@ -471,7 +471,13 @@ NESTED(nmi_handler, PT_SIZE, sp) | |||
471 | jr k0 | 471 | jr k0 |
472 | rfe | 472 | rfe |
473 | #else | 473 | #else |
474 | #ifndef CONFIG_CPU_DADDI_WORKAROUNDS | ||
474 | LONG_ADDIU k0, 4 /* stall on $k0 */ | 475 | LONG_ADDIU k0, 4 /* stall on $k0 */ |
476 | #else | ||
477 | .set at=v1 | ||
478 | LONG_ADDIU k0, 4 | ||
479 | .set noat | ||
480 | #endif | ||
475 | MTC0 k0, CP0_EPC | 481 | MTC0 k0, CP0_EPC |
476 | /* I hope three instructions between MTC0 and ERET are enough... */ | 482 | /* I hope three instructions between MTC0 and ERET are enough... */ |
477 | ori k1, _THREAD_MASK | 483 | ori k1, _THREAD_MASK |