From owner-svn-src-head@FreeBSD.ORG Wed Apr 24 17:20:46 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3C8AE4AC; Wed, 24 Apr 2013 17:20:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2EE5E11B8; Wed, 24 Apr 2013 17:20:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3OHKkk8033280; Wed, 24 Apr 2013 17:20:46 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3OHKjxb033277; Wed, 24 Apr 2013 17:20:45 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201304241720.r3OHKjxb033277@svn.freebsd.org> From: Dimitry Andric Date: Wed, 24 Apr 2013 17:20:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249846 - in head/sys/boot: i386/btx/btx pc98/btx/btx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Apr 2013 17:20:46 -0000 Author: dim Date: Wed Apr 24 17:20:45 2013 New Revision: 249846 URL: http://svnweb.freebsd.org/changeset/base/249846 Log: When rebooting (exiting) from the BTX loader, make sure to restore the GDT from the correct segment, otherwise a triple fault would be caused. In some virtual environments (VMware, VirtualBox, etc) this could lead to a unhandled error or hang in the guest emulation software. Thanks to avg and jhb for a few hints in the right direction. Noticed by: Jeremy Chadwick (and many others) MFC after: 1 week Modified: head/sys/boot/i386/btx/btx/btx.S head/sys/boot/pc98/btx/btx/btx.S Modified: head/sys/boot/i386/btx/btx/btx.S ============================================================================== --- head/sys/boot/i386/btx/btx/btx.S Wed Apr 24 16:52:03 2013 (r249845) +++ head/sys/boot/i386/btx/btx/btx.S Wed Apr 24 17:20:45 2013 (r249846) @@ -248,7 +248,7 @@ exit: cli # Disable interrupts /* * Restore the GDT in case we caught a kernel trap. */ - lgdt gdtdesc # Set GDT + lgdt %cs:gdtdesc # Set GDT /* * To 16 bits. */ Modified: head/sys/boot/pc98/btx/btx/btx.S ============================================================================== --- head/sys/boot/pc98/btx/btx/btx.S Wed Apr 24 16:52:03 2013 (r249845) +++ head/sys/boot/pc98/btx/btx/btx.S Wed Apr 24 17:20:45 2013 (r249846) @@ -248,7 +248,7 @@ exit: cli # Disable interrupts /* * Restore the GDT in case we caught a kernel trap. */ - lgdt gdtdesc # Set GDT + lgdt %cs:gdtdesc # Set GDT /* * To 16 bits. */