Save r3 before using it for the trap check, else we end up saving the new r3,

containing the trap instruction encoding (0x7c810808), and restoring it back
with the frame on return.  This caused it to panic on my ppc32 machine, but
somehow my ppc64 machine overlooked it, because I was using such a simple
dtrace probe.

X-MFC-with:	r259245
MFC after:	2 weeks
This commit is contained in:
Justin Hibbits 2013-12-15 18:07:25 +00:00
parent d2a94a7764
commit ac01bc33c9
2 changed files with 8 additions and 4 deletions

View File

@ -897,11 +897,13 @@ CNAME(dblow):
#ifdef KDTRACE_HOOKS
/* Privileged, so drop to KDB */
mfsrr0 %r1
lwz %r4,0(%r1)
mtsprg3 %r3
lwz %r1,0(%r1)
/* Check if it's a DTrace trap. */
li %r3,0x0808
addis %r3,%r3,0x7c81
cmplw %cr0,%r3,%r4
cmplw %cr0,%r3,%r1
mfsprg3 %r3
beq %cr0,1b
#endif
/* Privileged, so drop to KDB */

View File

@ -804,11 +804,13 @@ CNAME(dblow):
#ifdef KDTRACE_HOOKS
/* Privileged, so drop to KDB */
mfsrr0 %r1
lwz %r4,0(%r1)
mtsprg3 %r3
lwz %r1,0(%r1)
/* Check if it's a DTrace trap. */
li %r3,0x0808
addis %r3,%r3,0x7c81
cmplw %cr0,%r3,%r4
cmplw %cr0,%r3,%r1
mfsprg3 %r3
beq %cr0,1b
#endif
GET_CPUINFO(%r1)