From owner-freebsd-i386@FreeBSD.ORG Thu Jun 16 00:23:21 2005 Return-Path: X-Original-To: freebsd-i386@freebsd.org Delivered-To: freebsd-i386@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 55F9016A41C for ; Thu, 16 Jun 2005 00:23:21 +0000 (GMT) (envelope-from emaste@phaedrus.sandvine.ca) Received: from mailserver.sandvine.com (sandvine.com [199.243.201.138]) by mx1.FreeBSD.org (Postfix) with ESMTP id 08D6A43D49 for ; Thu, 16 Jun 2005 00:23:20 +0000 (GMT) (envelope-from emaste@phaedrus.sandvine.ca) Received: from labgw2.phaedrus.sandvine.com ([192.168.3.11]) by mailserver.sandvine.com with Microsoft SMTPSVC(5.0.2195.6713); Wed, 15 Jun 2005 20:23:20 -0400 Received: by labgw2.phaedrus.sandvine.com (Postfix, from userid 12627) id E1A2813641; Wed, 15 Jun 2005 20:23:19 -0400 (EDT) Date: Wed, 15 Jun 2005 20:23:19 -0400 From: Ed Maste To: freebsd-i386@freebsd.org Message-ID: <20050616002319.GB39516@sandvine.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-OriginalArrivalTime: 16 Jun 2005 00:23:20.0094 (UTC) FILETIME=[993A63E0:01C57209] Subject: Hanging on reboot / alternative cpu_reset mechanism X-BeenThere: freebsd-i386@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: I386-specific issues for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2005 00:23:21 -0000 On some of the motherboards we use I've run into a hang on reboot. I've noticed messages describing similar symptoms on this list, but am not sure if there's any relationship. It seems cpu_reset_real tries to use the keyboard controller to perform a system reset using outb(0x64, 0xFE) and then falls back to (vm_machdep.c): /* Force a shutdown by unmapping entire address space. */ bzero((caddr_t)PTD, NBPTD); /* "good night, sweet prince .... " */ invltlb(); /* NOTREACHED */ while(1); The systems I've experienced the hang on (SuperMicro X6DHR) have the keyboard controller implemented in a Winbond W83627. I'm guessing that this controller somehow gets confused and doesn't accept the reset command. Then the system just hangs after the bzero(PTD) or ends up in in the double fault handler. I found two other reset methods from various web resources: bit 0 in register 0x92, and forcing a triple fault. I've confirmed that both methods work for me. Register 0x92 seems to have been introduced with the PS/2 ages ago. It's implemented in the Winbond controller; I imagine it's available with most chipsets. I think it might be used in QNX but I'm not sure about other OSes. The triple fault can be invoked with something like static long no_idt[2]; __asm __volatile("lidt %0" : "=m" (no_idt)); __asm __volatile("int3"); Both NetBSD and OpenBSD try the keyboard controller reset followed by the triple fault (implemented slightly differently). Is this something worth switching to? How is the current bzero() code supposed to ensure a reboot? -- Ed Maste, Sandvine Incorporated