From owner-freebsd-threads@FreeBSD.ORG Thu Oct 7 06:56:15 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5486416A4CE; Thu, 7 Oct 2004 06:56:15 +0000 (GMT) Received: from tts.orel.ru (tts.orel.ru [213.59.64.67]) by mx1.FreeBSD.org (Postfix) with ESMTP id 893B043D45; Thu, 7 Oct 2004 06:56:14 +0000 (GMT) (envelope-from bel@orel.ru) Received: from orel.ru (pf1.net.orel.ru [213.59.64.75]) by tts.orel.ru (8.12.10/8.12.10/bel) with ESMTP id i976u6Bm031759; Thu, 7 Oct 2004 10:56:07 +0400 Message-ID: <4164E87E.2080705@orel.ru> Date: Thu, 07 Oct 2004 10:55:58 +0400 From: Andrew Belashov Organization: ORIS User-Agent: Mozilla/5.0 (X11; U; FreeBSD sparc64; en-US; rv:1.6) Gecko/20040407 X-Accept-Language: ru, en-us, en MIME-Version: 1.0 To: Ken Smith References: <41518130.3000704@orel.ru> <4152A383.3090901@orel.ru> <20041006031406.GB26037@electra.cse.Buffalo.EDU> In-Reply-To: <20041006031406.GB26037@electra.cse.Buffalo.EDU> X-Enigmail-Version: 0.83.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------060401020702050502030009" X-Zombi-Check: on netra2.orel.ru cc: freebsd-sparc64@freebsd.org cc: freebsd-threads@freebsd.org Subject: Re: Bug in kse_switchin()? X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2004 06:56:15 -0000 This is a multi-part message in MIME format. --------------060401020702050502030009 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Ken Smith wrote: > On Thu, Sep 23, 2004 at 02:20:51PM +0400, Andrew Belashov wrote: > > >>Where bug? >>- In sparc64 specific core? >>- In kern/kern_kse.c and kern/kern_thr.c code? > > > Can you humor me and test this patch please? > > Index: sys/conf/kern.pre.mk > =================================================================== > RCS file: /home/ncvs/src/sys/conf/kern.pre.mk,v > retrieving revision 1.57 > diff -u -r1.57 kern.pre.mk > --- sys/conf/kern.pre.mk 23 Sep 2004 22:53:22 -0000 1.57 > +++ sys/conf/kern.pre.mk 6 Oct 2004 03:09:09 -0000 > @@ -24,7 +24,7 @@ > . elif ${MACHINE_ARCH} == "ia64" > COPTFLAGS?=-O2 -pipe > . elif ${MACHINE_ARCH} == "sparc64" > -COPTFLAGS?=-O2 -pipe > +COPTFLAGS?=-O -pipe > . elif ${MACHINE_ARCH} == "arm" > COPTFLAGS?=-O2 -pipe > . else > > You'll need to go through a complete kernel build cycle after applying > it (starting with 'config'). Option -O does not solve a problem. But I have magic patch. It work with -O and -O2 options. -- Best regards, Andrew Belashov. --------------060401020702050502030009 Content-Type: text/plain; name="set_mcontext.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="set_mcontext.patch" --- 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) { --------------060401020702050502030009--