> While adding MP support to ddb on sparc64 I notice that ddb was
> inserting breakpoints even if you only entered ddb and used continue
> again.  So I wonder if there is a cache synchronization issue of some
> sort and by adding those additional instructions you just manage to
> avoid it.

Locore is not consistent in its use of `isync' after disabling
exceptions. With the following diff, and without expanding the stmw
instructions, I can quit ddb without problems.

Index: locore.S
===================================================================
RCS file: /OpenBSD/src/sys/arch/macppc/macppc/locore.S,v
retrieving revision 1.50
diff -u -p -r1.50 locore.S
--- locore.S    29 Jul 2015 18:52:44 -0000      1.50
+++ locore.S    31 Oct 2015 08:20:16 -0000
@@ -175,6 +175,7 @@ switch_exited:
        mfmsr   %r30
        andi.   %r30,%r30,~PSL_EE@l
        mtmsr   %r30
+       isync
 
        stw     %r4,CI_CURPROC(%r5)     /* record new process */
 
@@ -223,6 +224,7 @@ _ENTRY(_C_LABEL(cpu_idle_enter))
        mfmsr   %r3
        andi.   %r3,%r3,~PSL_EE@l
        mtmsr   %r3
+       isync
 1:
        blr
 
@@ -890,6 +892,7 @@ trapexit:
        mfmsr   %r3
        andi.   %r3,%r3,~PSL_EE@l
        mtmsr   %r3
+       isync
 /* Test AST pending: */
        lwz     %r5,FRAME_SRR1+8(%r1)
        mtcr    %r5

Reply via email to