powerpc: Save DAR and DSISR in pt_regs on MCE
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Sun, 28 Apr 2013 09:37:26 +0000 (09:37 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 30 Apr 2013 05:59:42 +0000 (15:59 +1000)
We were not saving DAR and DSISR on MCE. Save then and also print the values
along with exception details in xmon.

Acked-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/kernel/exceptions-64s.S
arch/powerpc/xmon/xmon.c

index 80d56f094a0dee37c49d329a9693d5fddf381712..e6eba1bf61ad55de486cd19f725743493e64cd84 100644 (file)
@@ -693,9 +693,18 @@ slb_miss_user_pseries:
        .align  7
        .globl machine_check_common
 machine_check_common:
+
+       mfspr   r10,SPRN_DAR
+       std     r10,PACA_EXGEN+EX_DAR(r13)
+       mfspr   r10,SPRN_DSISR
+       stw     r10,PACA_EXGEN+EX_DSISR(r13)
        EXCEPTION_PROLOG_COMMON(0x200, PACA_EXMC)
        FINISH_NAP
        DISABLE_INTS
+       ld      r3,PACA_EXGEN+EX_DAR(r13)
+       lwz     r4,PACA_EXGEN+EX_DSISR(r13)
+       std     r3,_DAR(r1)
+       std     r4,_DSISR(r1)
        bl      .save_nvgprs
        addi    r3,r1,STACK_FRAME_OVERHEAD
        bl      .machine_check_exception
index 13f85defabed97a6cb7323c31b1272f50d6e29e5..51e237c4648f4b1b66df7a9c25e49ebbc251c336 100644 (file)
@@ -1430,7 +1430,7 @@ static void excprint(struct pt_regs *fp)
        printf("    sp: %lx\n", fp->gpr[1]);
        printf("   msr: %lx\n", fp->msr);
 
-       if (trap == 0x300 || trap == 0x380 || trap == 0x600) {
+       if (trap == 0x300 || trap == 0x380 || trap == 0x600 || trap == 0x200) {
                printf("   dar: %lx\n", fp->dar);
                if (trap != 0x380)
                        printf(" dsisr: %lx\n", fp->dsisr);