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)
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to