Date: Tue, 26 Jan 2010 02:26:04 +0000 (UTC) From: Neel Natu <neel@FreeBSD.org> To: cvs-src-old@freebsd.org Subject: cvs commit: src/sys/mips/include cpuregs.h src/sys/mips/mips exception.S swtch.S Message-ID: <201001260226.o0Q2QQfx065400@repoman.freebsd.org>
index | next in thread | raw e-mail
neel 2010-01-26 02:26:04 UTC
FreeBSD src repository
Modified files:
sys/mips/include cpuregs.h
sys/mips/mips exception.S swtch.S
Log:
SVN rev 202996 on 2010-01-26 02:26:04Z by neel
Fix a problem seen when a new process was returning to userland
through fork_trampoline.
This was caused because we were clearing the SR_INT_IE and setting
SR_EXL bits of the status register at the same time. This meant
that if an interrupt happened while this MTC0 was making its way
through the pipeline the exception processing would see the
status register with SR_EXL bit set. This in turn would mean that
the COP_0_EXC_PC would not be updated so the return from exception
would be to an incorrect address.
It is easy to verify this fix by a program that forks in a loop
and the child just exits:
while (1) {
pid_t pid = vfork();
if (pid == 0)
_exit(0);
if (pid != -1)
waitpid(pid, NULL, 0);
}
Also remove two instances where we set SR_EXL bit gratuitously in exception.S.
Approved by: imp (mentor)
Revision Changes Path
1.3 +5 -1 src/sys/mips/include/cpuregs.h
1.5 +0 -6 src/sys/mips/mips/exception.S
1.4 +1 -5 src/sys/mips/mips/swtch.S
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001260226.o0Q2QQfx065400>
