From owner-freebsd-bugs Mon May 11 14:33:29 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id OAA24984 for freebsd-bugs-outgoing; Mon, 11 May 1998 14:33:29 -0700 (PDT) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id OAA24972 for ; Mon, 11 May 1998 14:33:25 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id OAA26024; Mon, 11 May 1998 14:30:01 -0700 (PDT) Date: Mon, 11 May 1998 14:30:01 -0700 (PDT) Message-Id: <199805112130.OAA26024@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.ORG From: Tor Egge Subject: Re: kern/6587: SMP idle cpl breaks signal forwarding Reply-To: Tor Egge Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR kern/6587; it has been noted by GNATS. From: Tor Egge To: will@iki.fi Cc: freebsd-gnats-submit@FreeBSD.ORG Subject: Re: kern/6587: SMP idle cpl breaks signal forwarding Date: Mon, 11 May 1998 23:27:46 +0200 Having a shared AST flag in an SMP configuration is wrong. This is one of the bad side effects. Appended is an attempt at a workaround. Consider it my submission to a kludge stacking contest. - Tor Egge Index: swtch.s =================================================================== RCS file: /home/ncvs/src/sys/i386/i386/swtch.s,v retrieving revision 1.71 diff -u -r1.71 swtch.s --- swtch.s 1998/04/06 15:44:31 1.71 +++ swtch.s 1998/05/11 20:46:13 @@ -49,6 +49,8 @@ #include #include #include /** GRAB_LOPRIO */ +#include +#include #endif /* SMP */ #include "assym.s" @@ -308,6 +310,10 @@ * * XXX: we had damn well better be sure we had it before doing this! */ + CPL_LOCK + andl $~SWI_AST_MASK, _ipending + movl $0, _cpl /* Allow ASTs on other CPU */ + CPL_UNLOCK movl $FREE_LOCK, %eax movl %eax, _mp_lock @@ -357,16 +363,20 @@ jmp idle_loop 3: -#ifdef SMP movl $LOPRIO_LEVEL, lapic_tpr /* arbitrate for INTs */ -#endif call _get_mplock + CPL_LOCK + movl $SWI_AST_MASK, _cpl /* Disallow ASTs on other CPU */ + CPL_UNLOCK cmpl $0,_whichrtqs /* real-time queue */ CROSSJUMP(jne, sw1a, je) cmpl $0,_whichqs /* normal queue */ CROSSJUMP(jne, nortqr, je) cmpl $0,_whichidqs /* 'idle' queue */ CROSSJUMP(jne, idqr, je) + CPL_LOCK + movl $0, _cpl /* Allow ASTs on other CPU */ + CPL_UNLOCK call _rel_mplock jmp idle_loop To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message