From owner-freebsd-stable@FreeBSD.ORG Wed Feb 25 22:03:03 2009 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E1391065675 for ; Wed, 25 Feb 2009 22:03:03 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 4FE568FC14 for ; Wed, 25 Feb 2009 22:03:03 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net [98.109.39.197]) by cyrus.watson.org (Postfix) with ESMTPSA id BE28C46B7E for ; Wed, 25 Feb 2009 17:03:02 -0500 (EST) Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n1PM2ogs036100 for ; Wed, 25 Feb 2009 17:02:56 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: stable@freebsd.org Date: Wed, 25 Feb 2009 17:02:39 -0500 User-Agent: KMail/1.9.7 References: <200902242311.n1ONBFeF078757@svn.freebsd.org> In-Reply-To: <200902242311.n1ONBFeF078757@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902251702.39725.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Wed, 25 Feb 2009 17:02:57 -0500 (EST) X-Virus-Scanned: ClamAV 0.94.2/9047/Wed Feb 25 05:59:41 2009 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: Subject: Possible fix to BTX boot hangs in 6.4 and 7.1 X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Feb 2009 22:03:03 -0000 On Tuesday 24 February 2009 6:11:15 pm John Baldwin wrote: > Author: jhb > Date: Tue Feb 24 23:11:15 2009 > New Revision: 189017 > URL: http://svn.freebsd.org/changeset/base/189017 > > Log: > Fix some more issues with the real mode BTX. > > The old BTX passed the general purpose registers from the 32-bit client to > the routines called via virtual 86 mode. The new BTX did the same thing. > However, it turns out that some instructions behave differently in virtual 86 > mode and real mode (even though this is under-documented). For example, the > LEAVE instruction will cause an exception in real mode if any of the upper > 16-bits of %ebp are non-zero after it executes. In virtual 8086 mode the > upper 16-bits are simply ignored. This could cause faults in hardware > interrupt handlers that inherited an %ebp larger than 0xffff from the 32-bit > client (loader, boot2, etc.) while running in real mode. > > To fix, when executing hardware interrupt handlers provide an explicit clean > state where all the general purpose and segment registers are zero upon > entry to the interrupt handler. While here, I attempted to simplify the > control flow in the 'intusr' code that sets up the various stack frames > and exits protected mode to invoke the requested routine via real mode. > > A huge thanks to Tor Egge (tegge@) for debugging this issue. > > Submitted by: tegge > Reviewed by: tegge > Tested by: bz > MFC after: 1 week This has been confirmed to fix at least some of the boot hangs reported with the BTX changes in 6.4 and 7.1. If you had problems with the new boot code in 6.4 or 7.1 this fix is probably worth trying out. -- John Baldwin