Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Nov 2002 22:50:38 +0000
From:      Doug Rabson <dfr@nlsystems.com>
To:        Marcel Moolenaar <marcel@freebsd.org>, Perforce Change Reviews <perforce@freebsd.org>
Subject:   Re: PERFORCE change 21417 for review
Message-ID:  <200211232250.38412.dfr@nlsystems.com>
In-Reply-To: <200211232017.gANKHAAk090869@repoman.freebsd.org>
References:  <200211232017.gANKHAAk090869@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Saturday 23 November 2002 8:17 pm, Marcel Moolenaar wrote:
> http://perforce.freebsd.org/chv.cgi?CH=3D21417
>
> Change 21417 by marcel@marcel_nfs on 2002/11/23 12:17:09
>
> =09Raw, untested implementation of EPC syscalls.

This seems to be missing the bit after calling syscall() which checks=20
for a full exception_restore, e.g. after an execve and also the check=20
for calling ast(), e.g. after a signal.

On the subject of ast(), I'm sure that the current code in=20
exception_restore which tests for this is wrong. It needs to call ast()=20
very carefully to ensure that a call is not missed. The algorithm is=20
something like:

loop:
=09savepsr =3D psr;
=09disable_interrupts()
=09if (astpending || needresched) {
=09=09psr =3D savepsr();
=09=09ast();
=09=09goto loop;
=09}
=09/*
=09 * Note: interrupts are disabled here which prevents any
=09 * further ast's.
=09 */
=09... restore registers and back to user mode ...

The bundle which contains the call to ast() also contains the branch=20
instruction for the loop. This can't be right because the call will=20
return to the bundle *after* the one containing the loop branch.

It is very important interrupts are not re-enabled after testing=20
astpending and needresched until the rfi (or br.ret) to make this=20
section atomic. The same rule applies to do_syscall and epc_syscall.

One other thing after re-familiarising myself with exception.s. You have=20
added unwind records to all the kernel IVT entry points. This is quite=20
unhelpful when trying to debug kernel faults. The previous version=20
which manually unwound past the exception to the code which faulted was=20
extremely useful and saved me a lot of time in debugging. Can we have=20
it back please :-).

--=20
Doug Rabson=09=09=09=09Mail:  dfr@nlsystems.com
=09=09=09=09=09Phone: +44 20 8348 6160



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200211232250.38412.dfr>