Remove race condition between reading of MSR, setting md_savecrit,

and setting MSR. This was most evident with the idle proc running
with interrupts disabled and causing a lockup. Switch over to the
i386 style which does things in the right order.

debug assisted by:  gallatin, and the invaluable KTR option.
This commit is contained in:
Peter Grehan 2004-08-03 04:14:55 +00:00
parent e10ecdea88
commit e796443d47

View File

@ -58,12 +58,8 @@ void cpu_critical_fork_exit(void);
static __inline void
cpu_critical_enter(struct thread *td)
{
u_int msr;
msr = mfmsr();
td->td_md.md_savecrit = msr;
msr &= ~PSL_EE;
mtmsr(msr);
td->td_md.md_savecrit = intr_disable();
}
/*
@ -77,7 +73,7 @@ static __inline void
cpu_critical_exit(struct thread *td)
{
mtmsr(td->td_md.md_savecrit);
intr_restore(td->td_md.md_savecrit);
}