Date: Sun, 15 Dec 2013 18:07:25 +0000 (UTC) From: Justin Hibbits <jhibbits@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259421 - head/sys/powerpc/aim Message-ID: <201312151807.rBFI7PHw021202@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jhibbits Date: Sun Dec 15 18:07:25 2013 New Revision: 259421 URL: http://svnweb.freebsd.org/changeset/base/259421 Log: 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 Modified: head/sys/powerpc/aim/trap_subr32.S head/sys/powerpc/aim/trap_subr64.S Modified: head/sys/powerpc/aim/trap_subr32.S ============================================================================== --- head/sys/powerpc/aim/trap_subr32.S Sun Dec 15 18:05:04 2013 (r259420) +++ head/sys/powerpc/aim/trap_subr32.S Sun Dec 15 18:07:25 2013 (r259421) @@ -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 */ Modified: head/sys/powerpc/aim/trap_subr64.S ============================================================================== --- head/sys/powerpc/aim/trap_subr64.S Sun Dec 15 18:05:04 2013 (r259420) +++ head/sys/powerpc/aim/trap_subr64.S Sun Dec 15 18:07:25 2013 (r259421) @@ -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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201312151807.rBFI7PHw021202>