diff options
author | Nicholas Piggin <npiggin@gmail.com> | 2019-01-08 00:04:17 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.ibm.com> | 2019-02-12 15:08:17 +1100 |
commit | 9c58bbd720b73b9c9c3bf9e86797077f053a9eb3 (patch) | |
tree | 1b04f4adb8a4dc0b2ea7179624359346fd1b0ab0 /core/exceptions.c | |
parent | 9e075d75274c50da4135c55afccc9f6d24dd2cfe (diff) | |
download | skiboot-9c58bbd720b73b9c9c3bf9e86797077f053a9eb3.zip skiboot-9c58bbd720b73b9c9c3bf9e86797077f053a9eb3.tar.gz skiboot-9c58bbd720b73b9c9c3bf9e86797077f053a9eb3.tar.bz2 |
core/exceptions: save current MSR in exception frame
Save and print the MSR of the interrupt context. This can be derived
from the interrupt type, SRR1, and other system register settings. But
it can be useful to quickly verify what's happening.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'core/exceptions.c')
-rw-r--r-- | core/exceptions.c | 57 |
1 files changed, 31 insertions, 26 deletions
diff --git a/core/exceptions.c b/core/exceptions.c index 4880fa2..ed92edf 100644 --- a/core/exceptions.c +++ b/core/exceptions.c @@ -28,7 +28,7 @@ static void dump_regs(struct stack_frame *stack) { unsigned int i; - prerror("CFAR : "REG"\n", stack->cfar); + prerror("CFAR : "REG" MSR : "REG"\n", stack->cfar, stack->msr); prerror("SRR0 : "REG" SRR1 : "REG"\n", stack->srr0, stack->srr1); prerror("HSRR0: "REG" HSRR1: "REG"\n", stack->hsrr0, stack->hsrr1); prerror("DSISR: "REG32" DAR : "REG"\n", stack->dsisr, stack->dar); @@ -44,40 +44,45 @@ void exception_entry(struct stack_frame *stack) __noreturn; void exception_entry(struct stack_frame *stack) { + uint64_t nip; + uint64_t msr; const size_t max = 320; char buf[max]; size_t l; + switch (stack->type) { + case 0x500: + case 0x980: + case 0xe00: + case 0xe20: + case 0xe40: + case 0xe60: + case 0xe80: + case 0xea0: + case 0xf80: + nip = stack->hsrr0; + msr = stack->hsrr1; + break; + default: + nip = stack->srr0; + msr = stack->srr1; + break; + } + prerror("***********************************************\n"); + l = 0; if (stack->type == 0x200) { - l = 0; - l += snprintf(buf + l, max - l, "Fatal MCE at "REG" ", stack->srr0); - l += snprintf_symbol(buf + l, max - l, stack->srr0); - prerror("%s\n", buf); + l += snprintf(buf + l, max - l, + "Fatal MCE at "REG" ", nip); } else { - uint64_t nip; - switch (stack->type) { - case 0x500: - case 0x980: - case 0xe00: - case 0xe20: - case 0xe40: - case 0xe60: - case 0xe80: - case 0xea0: - case 0xf80: - nip = stack->hsrr0; - break; - default: - nip = stack->srr0; - break; - } - l = 0; - l += snprintf(buf + l, max - l, "Fatal Exception 0x%llx at "REG" ", stack->type, nip); - l += snprintf_symbol(buf + l, max - l, nip); - prerror("%s\n", buf); + l += snprintf(buf + l, max - l, + "Fatal Exception 0x%llx at "REG" ", stack->type, nip); } + l += snprintf_symbol(buf + l, max - l, nip); + l += snprintf(buf + l, max - l, " MSR "REG, msr); + prerror("%s\n", buf); dump_regs(stack); + abort(); } |