diff options
author | Josh Boyer <jwboyer@linux.vnet.ibm.com> | 2009-09-22 23:51:04 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-09-24 01:31:49 -0400 |
commit | daf8f40391b2a1978ea2071c20959d91fade6b1a (patch) | |
tree | 6c0cd6e6ee27b2453edc4039bb6a26688db82c14 /arch | |
parent | f32af63ed1327451cb91e3816fa043b6c2c52db1 (diff) |
powerpc/4xx: Fix erroneous xmon warning on PowerPC 4xx
The xmon code relies on MSR_RI being non-zero to indicate that an exception
is recoverable. If it is not, it prints a warning message. However, the
PowerPC 4xx cores do not have an MSR_RI bit and this warning is produced for
every xmon event.
This introduces an unrecoverable_excp function to determine if an exception
is recoverable or not. This gets rid of the erroneous warnings on 4xx.
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/xmon/xmon.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index 0e09a45ac79..c6f0a71b405 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c | |||
@@ -335,6 +335,16 @@ int cpus_are_in_xmon(void) | |||
335 | } | 335 | } |
336 | #endif | 336 | #endif |
337 | 337 | ||
338 | static inline int unrecoverable_excp(struct pt_regs *regs) | ||
339 | { | ||
340 | #ifdef CONFIG_4xx | ||
341 | /* We have no MSR_RI bit on 4xx, so we simply return false */ | ||
342 | return 0; | ||
343 | #else | ||
344 | return ((regs->msr & MSR_RI) == 0); | ||
345 | #endif | ||
346 | } | ||
347 | |||
338 | static int xmon_core(struct pt_regs *regs, int fromipi) | 348 | static int xmon_core(struct pt_regs *regs, int fromipi) |
339 | { | 349 | { |
340 | int cmd = 0; | 350 | int cmd = 0; |
@@ -388,7 +398,7 @@ static int xmon_core(struct pt_regs *regs, int fromipi) | |||
388 | bp = NULL; | 398 | bp = NULL; |
389 | if ((regs->msr & (MSR_IR|MSR_PR|MSR_SF)) == (MSR_IR|MSR_SF)) | 399 | if ((regs->msr & (MSR_IR|MSR_PR|MSR_SF)) == (MSR_IR|MSR_SF)) |
390 | bp = at_breakpoint(regs->nip); | 400 | bp = at_breakpoint(regs->nip); |
391 | if (bp || (regs->msr & MSR_RI) == 0) | 401 | if (bp || unrecoverable_excp(regs)) |
392 | fromipi = 0; | 402 | fromipi = 0; |
393 | 403 | ||
394 | if (!fromipi) { | 404 | if (!fromipi) { |
@@ -399,7 +409,7 @@ static int xmon_core(struct pt_regs *regs, int fromipi) | |||
399 | cpu, BP_NUM(bp)); | 409 | cpu, BP_NUM(bp)); |
400 | xmon_print_symbol(regs->nip, " ", ")\n"); | 410 | xmon_print_symbol(regs->nip, " ", ")\n"); |
401 | } | 411 | } |
402 | if ((regs->msr & MSR_RI) == 0) | 412 | if (unrecoverable_excp(regs)) |
403 | printf("WARNING: exception is not recoverable, " | 413 | printf("WARNING: exception is not recoverable, " |
404 | "can't continue\n"); | 414 | "can't continue\n"); |
405 | release_output_lock(); | 415 | release_output_lock(); |
@@ -490,7 +500,7 @@ static int xmon_core(struct pt_regs *regs, int fromipi) | |||
490 | printf("Stopped at breakpoint %x (", BP_NUM(bp)); | 500 | printf("Stopped at breakpoint %x (", BP_NUM(bp)); |
491 | xmon_print_symbol(regs->nip, " ", ")\n"); | 501 | xmon_print_symbol(regs->nip, " ", ")\n"); |
492 | } | 502 | } |
493 | if ((regs->msr & MSR_RI) == 0) | 503 | if (unrecoverable_excp(regs)) |
494 | printf("WARNING: exception is not recoverable, " | 504 | printf("WARNING: exception is not recoverable, " |
495 | "can't continue\n"); | 505 | "can't continue\n"); |
496 | remove_bpts(); | 506 | remove_bpts(); |