projects
/
platform
/
adaptation
/
renesas_rcar
/
renesas_kernel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
02b849f
)
MIPS: Avoid overoptimization by GCC.
author
Ralf Baechle
<ralf@linux-mips.org>
Thu, 14 Mar 2013 17:49:26 +0000
(18:49 +0100)
committer
Ralf Baechle
<ralf@linux-mips.org>
Thu, 11 Apr 2013 13:39:51 +0000
(15:39 +0200)
Without this, it's possible that LTO will discard the calls to
set_except_vector() in the probe for the DADDI overflow bug resulting in a
kernel crash like this:
[...]
Mount-cache hash table entries: 256
Checking for the daddi bug... Integer overflow[#1]:
Cpu 0
$ 0 :
0000000000000000
0000000010008ce1
0000000000000001
0000000000000000
$ 4 :
7fffffffffffedcd
ffffffff81410000
0000000000000030
000000000000003f
[...]
There are other similar places in the kernel so we've just been lucky
that GCC's been tolerant.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/kernel/traps.c
patch
|
blob
|
history
diff --git
a/arch/mips/kernel/traps.c
b/arch/mips/kernel/traps.c
index
165b4f0
..
feb42c0
100644
(file)
--- a/
arch/mips/kernel/traps.c
+++ b/
arch/mips/kernel/traps.c
@@
-1390,9
+1390,8
@@
unsigned long vi_handlers[64];
void __init *set_except_vector(int n, void *addr)
{
unsigned long handler = (unsigned long) addr;
- unsigned long old_handler =
exception_handlers[n]
;
+ unsigned long old_handler =
xchg(&exception_handlers[n], handler)
;
- exception_handlers[n] = handler;
if (n == 0 && cpu_has_divec) {
unsigned long jump_mask = ~((1 << 28) - 1);
u32 *buf = (u32 *)(ebase + 0x200);