From owner-freebsd-sparc64@FreeBSD.ORG Tue Sep 28 12:55:30 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 EF7DB16A4CE for ; Tue, 28 Sep 2004 12:55:30 +0000 (GMT) Received: from tts.orel.ru (tts.orel.ru [213.59.64.67]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2593B43D5F for ; Tue, 28 Sep 2004 12:55:28 +0000 (GMT) (envelope-from bel@orel.ru) Received: from orel.ru (lg.orel.ru [62.33.11.59]) by tts.orel.ru (8.12.10/8.12.10/bel) with ESMTP id i8SCtPBm015687 for ; Tue, 28 Sep 2004 16:55:26 +0400 Message-ID: <41595F3E.9080909@orel.ru> Date: Tue, 28 Sep 2004 16:55:26 +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: freebsd-sparc64@freebsd.org X-Enigmail-Version: 0.83.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------090709000205070904000502" X-Zombi-Check: on netra2.orel.ru Subject: libkse: One more bug in kernel? 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: Tue, 28 Sep 2004 12:55:31 -0000 This is a multi-part message in MIME format. --------------090709000205070904000502 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hi! I have found a bug in kernel. Here a patch with short explanation. See also my development set of patches for libkse: -- Best regards, Andrew Belashov. --------------090709000205070904000502 Content-Type: text/plain; name="machdep.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="machdep.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 pre-trap 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) { --------------090709000205070904000502--