Commit 11be3958 authored by Breno Leitao's avatar Breno Leitao Committed by Michael Ellerman

powerpc/tm: Print scratch value

Usually a TM Bad Thing exception is raised due to three different problems.
a) touching SPRs in an active transaction; b) using TM instruction with the
facility disabled and c) setting a wrong MSR/SRR1 at RFID.

The two initial cases are easy to identify by looking at the instructions.
The latter case is harder, because the MSR is masked after RFID, so, it is
very useful to look at the previous MSR (SRR1) before RFID as also the
current and masked MSR.

Since MSR is saved at paca just before RFID, this patch prints it if a TM
Bad thing happen, helping to understand what is the invalid TM transition
that is causing the exception.
Signed-off-by: default avatarBreno Leitao <leitao@debian.org>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 63a0d6b0
...@@ -1434,7 +1434,8 @@ void program_check_exception(struct pt_regs *regs) ...@@ -1434,7 +1434,8 @@ void program_check_exception(struct pt_regs *regs)
goto bail; goto bail;
} else { } else {
printk(KERN_EMERG "Unexpected TM Bad Thing exception " printk(KERN_EMERG "Unexpected TM Bad Thing exception "
"at %lx (msr 0x%lx)\n", regs->nip, regs->msr); "at %lx (msr 0x%lx) tm_scratch=%llx\n",
regs->nip, regs->msr, get_paca()->tm_scratch);
die("Unrecoverable exception", regs, SIGABRT); die("Unrecoverable exception", regs, SIGABRT);
} }
} }
......
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