Subject: Re: reproducible kernel panic w/ 2.0RC4MP
To: Tim Kelly <hockey@dialectronics.com>
From: Matt Thomas <matt@3am-software.com>
List: port-macppc
Date: 12/03/2004 12:27:50
At 12:01 PM 12/3/2004, Tim Kelly wrote:
>At 10:26 AM -0800 12/3/04, Matt Thomas wrote:
> >which means this comes to
> >
> >     tmsr = emsr;
> >     if (ci->ci_cpuid == 0) {
> >         emsr |= PSL_EE;
>
>Matt's quite right, by the way, in that the entire effort can be reduced to
>two lines of code. Anyone familiar with the Idle() code in locore_subr.S
>could have noted this in seconds and fixed the problem. Since the fix is so
>simple I would think we can see it committed soon.

Actually, I propose a different fix.  Just enable PSL_EE before
calling lcsplx.

Index: locore_subr.S
===================================================================
RCS file: /cvsroot/src/sys/arch/powerpc/powerpc/locore_subr.S,v
retrieving revision 1.25
diff -u -r1.25 locore_subr.S
--- locore_subr.S       9 Jul 2004 22:00:46 -0000       1.25
+++ locore_subr.S       3 Dec 2004 20:25:39 -0000
@@ -164,10 +164,6 @@
         bl      _C_LABEL(sched_unlock_idle)
  #endif

-       li      %r3,0                   /* go IPL_SCHED to IPL_NONE */
-       bl      _C_LABEL(lcsplx)
-       mr      %r31,%r3                /* save returned IPL mask */
-
  #if defined(PPC_IBM4XX)
         wrteei  1                       /* reenable ints again */
  #else /* PPC_OEA */
@@ -177,6 +173,10 @@
         isync
  #endif

+       li      %r3,0                   /* go IPL_SCHED to IPL_NONE */
+       bl      _C_LABEL(lcsplx)
+       mr      %r31,%r3                /* save returned IPL mask */
+
  /*
   * At this point, other routines can be called (such as uvm_pageidlezero).
   */


-- 
Matt Thomas                     email: matt@3am-software.com
3am Software Foundry              www: http://3am-software.com/bio/matt/
Cupertino, CA              disclaimer: I avow all knowledge of this message.