From owner-freebsd-bugs Mon Oct 29 8:10: 7 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 4C1AD37B403 for ; Mon, 29 Oct 2001 08:10:02 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f9TGA2w15878; Mon, 29 Oct 2001 08:10:02 -0800 (PST) (envelope-from gnats) Date: Mon, 29 Oct 2001 08:10:02 -0800 (PST) Message-Id: <200110291610.f9TGA2w15878@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Tor.Egge@fast.no Subject: Re: Re[2]: i386/31535: Can't reboot system: Tyan Thunder K7+ Dual AMD Athlon 1.2 MP / FreeBSD 4.4 STABLE or 4.3 RELEASE Reply-To: Tor.Egge@fast.no Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR i386/31535; it has been noted by GNATS. From: Tor.Egge@fast.no To: ilin@rinet.ru Cc: freebsd-gnats-submit@FreeBSD.org Subject: Re: Re[2]: i386/31535: Can't reboot system: Tyan Thunder K7+ Dual AMD Athlon 1.2 MP / FreeBSD 4.4 STABLE or 4.3 RELEASE Date: Mon, 29 Oct 2001 17:04:38 +0100 > Hello Tor, > > Monday, October 29, 2001, 6:51:11 AM, you wrote: > > > The shutdown routine uses memory based syncronization to let the BSP > > perform the real reset. Your problem looks like a livelock, which can > > be avoided by flushing the cache after setting the variable used for > > syncronization. > > Hmm... Problem not fixed. The AP probably managed to count to 10000000 before the BSP had completed printing the message about having grabbed the MP lock. Thus cpu_reset_proxy_active was not updated before the timeout had expired. The fix for that is to move the printf call to after the wbinvd() statement in cpu_reset_proxy(). Index: sys/i386/i386/vm_machdep.c =================================================================== RCS file: /home/ncvs/src/sys/i386/i386/vm_machdep.c,v retrieving revision 1.132.2.5 diff -u -r1.132.2.5 vm_machdep.c --- sys/i386/i386/vm_machdep.c 22 Sep 2001 09:21:48 -0000 1.132.2.5 +++ sys/i386/i386/vm_machdep.c 29 Oct 2001 15:55:23 -0000 @@ -406,12 +415,14 @@ u_int saved_mp_lock; cpu_reset_proxy_active = 1; + wbinvd(); while (cpu_reset_proxy_active == 1) ; /* Wait for other cpu to disable interupts */ saved_mp_lock = mp_lock; mp_lock = 1; - printf("cpu_reset_proxy: Grabbed mp lock for BSP\n"); cpu_reset_proxy_active = 3; + wbinvd(); + printf("cpu_reset_proxy: Grabbed mp lock for BSP\n"); while (cpu_reset_proxy_active == 3) ; /* Wait for other cpu to enable interrupts */ stop_cpus((1<