From owner-p4-projects@FreeBSD.ORG Fri Jan 4 18:17:26 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E560A16A468; Fri, 4 Jan 2008 18:17:25 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A819216A41B; Fri, 4 Jan 2008 18:17:25 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail.speedfactory.net [66.23.216.219]) by mx1.freebsd.org (Postfix) with ESMTP id 41C5313C43E; Fri, 4 Jan 2008 18:17:24 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.8q) with ESMTP id 227295698-1834499 for multiple; Fri, 04 Jan 2008 13:15:33 -0500 Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.8/8.13.8) with ESMTP id m04IHLIh040985; Fri, 4 Jan 2008 13:17:21 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Warner Losh Date: Fri, 4 Jan 2008 13:14:36 -0500 User-Agent: KMail/1.9.6 References: <200801032108.m03L8GQA029462@repoman.freebsd.org> In-Reply-To: <200801032108.m03L8GQA029462@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200801041314.36713.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Fri, 04 Jan 2008 13:17:21 -0500 (EST) X-Virus-Scanned: ClamAV 0.91.2/5363/Fri Jan 4 08:37:27 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: Perforce Change Reviews Subject: Re: PERFORCE change 132425 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jan 2008 18:17:26 -0000 On Thursday 03 January 2008 04:08:16 pm Warner Losh wrote: > http://perforce.freebsd.org/chv.cgi?CH=132425 > > Change 132425 by imp@imp_paco-paco on 2008/01/03 21:08:04 > > Trap compiles now. not 100% sure of the changes, so we should have > many eyes look here... > > Affected files ... > > .. //depot/projects/mips2-jnpr/src/sys/mips/mips/trap.c#5 edit > > Differences ... > > ==== //depot/projects/mips2-jnpr/src/sys/mips/mips/trap.c#5 (text+ko) ==== > > @@ -824,7 +811,7 @@ > STOPEVENT(p, S_SCX, code); > > PTRACESTOP_SC(p, td, S_PT_SCX); > - > +#ifdef GONE_IN_7 > WITNESS_WARN(WARN_PANIC, NULL, "System call %s returning", > (code >= 0 && code < SYS_MAXSYSCALL) ? > syscallnames[code] : "???"); The witness warn should still be around in 7, but it is a bit earlier after the system call returns just before calling userret(). > @@ -833,7 +820,7 @@ > if (curthread->td_flags & (TDF_ASTPENDING|TDF_NEEDRESCHED)) { > ast(trapframe); > } > - > +#endif ast() is also still relevant in 7 as well. What normally happens is that you have the following in assembly: trap_entry: setup regs call trap jmp exittrap syscall_entry: setup regs call syscall jmp exittrap exittrap: get ready to return from trap disable interrupts if returning to kernel jmp kernel asts: if no ASTs are pending jmp kernel enable interrupts call ast disable interrupts jmp asts kernel: restore registers reti or some such. You could do it in C if you wanted, but the idea is you want to only return to userland once you've verified you have no ASTs with interrupts disabled. If you get any AST's while returning to userland it's due to SMP and you will get an IPI that will post with 'reti' finishes. -- John Baldwin