From owner-p4-projects Sat Nov 23 14:50:45 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 91D9337B404; Sat, 23 Nov 2002 14:50:42 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 288ED37B401; Sat, 23 Nov 2002 14:50:42 -0800 (PST) Received: from herring.nlsystems.com (mailgate.nlsystems.com [62.49.251.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id 37D7543E3B; Sat, 23 Nov 2002 14:50:41 -0800 (PST) (envelope-from dfr@nlsystems.com) Received: from herring.nlsystems.com (herring.nlsystems.com [10.0.0.2]) by herring.nlsystems.com (8.12.6/8.12.6) with ESMTP id gANMocqb069351; Sat, 23 Nov 2002 22:50:38 GMT (envelope-from dfr@nlsystems.com) Content-Type: text/plain; charset="iso-8859-1" From: Doug Rabson To: Marcel Moolenaar , Perforce Change Reviews Subject: Re: PERFORCE change 21417 for review Date: Sat, 23 Nov 2002 22:50:38 +0000 User-Agent: KMail/1.4.3 References: <200211232017.gANKHAAk090869@repoman.freebsd.org> In-Reply-To: <200211232017.gANKHAAk090869@repoman.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200211232250.38412.dfr@nlsystems.com> X-Spam-Status: No, hits=-4.2 required=5.0 tests=IN_REP_TO,REFERENCES,SPAM_PHRASE_00_01,USER_AGENT, USER_AGENT_KMAIL version=2.41 Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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