Date: Thu, 07 Oct 2004 10:55:58 +0400 From: Andrew Belashov <bel@orel.ru> To: Ken Smith <kensmith@cse.Buffalo.EDU> Cc: freebsd-threads@freebsd.org Subject: Re: Bug in kse_switchin()? Message-ID: <4164E87E.2080705@orel.ru> In-Reply-To: <20041006031406.GB26037@electra.cse.Buffalo.EDU> References: <Pine.GSO.4.43.0409220743460.857-100000@sea.ntplx.net> <41518130.3000704@orel.ru> <4152A383.3090901@orel.ru> <20041006031406.GB26037@electra.cse.Buffalo.EDU>
next in thread | previous in thread | raw e-mail | index | archive | help
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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4164E87E.2080705>
