svn commit: r249846 - in head/sys/boot: i386/btx/btx pc98/btx/btx

Dimitry Andric dim at FreeBSD.org
Wed Apr 24 17:20:46 UTC 2013


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 at 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.
  */


More information about the svn-src-head mailing list