Date: Wed, 24 Apr 2013 17:20:45 +0000 (UTC) From: Dimitry Andric <dim@FreeBSD.org> 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 Message-ID: <201304241720.r3OHKjxb033277@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 <jdc@koitsu.org> (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. */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201304241720.r3OHKjxb033277>