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)
void
ProgramCheckException(struct pt_regs *regs)
{
if (debugger_fault_handler(regs))
return;
if (regs->msr & 0x100000) {
/* IEEE FP exception */
parse_fpe(regs);
......
......@@ -1443,7 +1443,17 @@ read_spr(int n)
store_inst(instrs+1);
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;
}
......@@ -1464,7 +1474,17 @@ write_spr(int n, unsigned long val)
store_inst(instrs+1);
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;
......
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