Commit dfc7d109 authored by Anton Blanchard's avatar Anton Blanchard Committed by Linus Torvalds

[PATCH] ppc64: catch bad xmon read/write SPR commands

Protect the read/write SPR xmon commands.
Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent efab4134
...@@ -480,6 +480,9 @@ check_bug_trap(struct pt_regs *regs) ...@@ -480,6 +480,9 @@ check_bug_trap(struct pt_regs *regs)
void void
ProgramCheckException(struct pt_regs *regs) ProgramCheckException(struct pt_regs *regs)
{ {
if (debugger_fault_handler(regs))
return;
if (regs->msr & 0x100000) { if (regs->msr & 0x100000) {
/* IEEE FP exception */ /* IEEE FP exception */
parse_fpe(regs); parse_fpe(regs);
......
...@@ -1443,7 +1443,17 @@ read_spr(int n) ...@@ -1443,7 +1443,17 @@ read_spr(int n)
store_inst(instrs+1); store_inst(instrs+1);
code = (unsigned long (*)(void)) opd; code = (unsigned long (*)(void)) opd;
ret = code(); if (setjmp(bus_error_jmp) == 0) {
catch_memory_errors = 1;
sync();
ret = code();
sync();
/* wait a little while to see if we get a machine check */
__delay(200);
n = size;
}
return ret; return ret;
} }
...@@ -1464,7 +1474,17 @@ write_spr(int n, unsigned long val) ...@@ -1464,7 +1474,17 @@ write_spr(int n, unsigned long val)
store_inst(instrs+1); store_inst(instrs+1);
code = (unsigned long (*)(unsigned long)) opd; code = (unsigned long (*)(unsigned long)) opd;
code(val); if (setjmp(bus_error_jmp) == 0) {
catch_memory_errors = 1;
sync();
code(val);
sync();
/* wait a little while to see if we get a machine check */
__delay(200);
n = size;
}
} }
static unsigned long regno; static unsigned long regno;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment