From owner-freebsd-sparc64@FreeBSD.ORG Thu Oct 7 13:13:59 2004 Return-Path: Delivered-To: freebsd-sparc64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DB68316A4CE; Thu, 7 Oct 2004 13:13:59 +0000 (GMT) Received: from electra.cse.Buffalo.EDU (electra.cse.Buffalo.EDU [128.205.32.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8404743D1D; Thu, 7 Oct 2004 13:13:59 +0000 (GMT) (envelope-from kensmith@cse.Buffalo.EDU) Received: from electra.cse.Buffalo.EDU (kensmith@localhost [127.0.0.1]) i97DDvIo018645; Thu, 7 Oct 2004 09:13:57 -0400 (EDT) Received: (from kensmith@localhost) by electra.cse.Buffalo.EDU (8.12.10/8.12.9/Submit) id i97DDv49018644; Thu, 7 Oct 2004 09:13:57 -0400 (EDT) Date: Thu, 7 Oct 2004 09:13:57 -0400 From: Ken Smith To: Andrew Belashov Message-ID: <20041007131357.GA17153@electra.cse.Buffalo.EDU> References: <41518130.3000704@orel.ru> <4152A383.3090901@orel.ru> <20041006031406.GB26037@electra.cse.Buffalo.EDU> <4164E87E.2080705@orel.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4164E87E.2080705@orel.ru> User-Agent: Mutt/1.4.1i cc: Ken Smith cc: freebsd-sparc64@freebsd.org cc: freebsd-threads@freebsd.org Subject: Re: Bug in kse_switchin()? X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2004 13:14:00 -0000 On Thu, Oct 07, 2004 at 10:55:58AM +0400, Andrew Belashov wrote: > Option -O does not solve a problem. > > But I have magic patch. It work with -O and -O2 options. Thanks for testing. I'm not sure what I'll do about the -O stuff yet. Given it seems to solve one problem that other people I respect couldn't explain I'll probably revert to -O for the 5.3-RELEASE and do some more testing to see how widespread a problem it is. > --- sys/sparc64/sparc64/machdep.c.orig Thu Aug 5 09:42:40 2004 > +++ sys/sparc64/sparc64/machdep.c Tue Sep 28 15:11:08 2004 > @@ -623,6 +623,11 @@ set_mcontext(struct thread *td, const mc > tf = td->td_frame; > pcb = td->td_pcb; > wstate = tf->tf_wstate; > + /* XXXKSE Make sure the windows are spilled. > + * This is needed for kse_switchin(2) for correct switching between > + * threads stacks. > + */ > + flushw(); > bcopy(mc, tf, sizeof(*tf)); > tf->tf_wstate = wstate; > if ((mc->mc_fprs & FPRS_FEF) != 0) { And thank you very much for that! I'm testing it now, and will commit it if nothing unexpected happens. -- Ken Smith - From there to here, from here to | kensmith@cse.buffalo.edu there, funny things are everywhere. | - Theodore Geisel |