1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-19 15:33:56 +00:00

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
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=133050

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);
}