aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2013-05-01 18:06:53 +0000
committerDimitry Andric <dim@FreeBSD.org>2013-05-01 18:06:53 +0000
commite7e0d629feba547d66eda57dbad931350a124b39 (patch)
tree1ade7ee7503bce6fdb50be977d2f47a004f5f56f
parent7ab3942b6d086762d36339cc7d31cf5770f212f3 (diff)
downloadsrc-e7e0d629feba547d66eda57dbad931350a124b39.tar.gz
src-e7e0d629feba547d66eda57dbad931350a124b39.zip
MFC r249846:
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)
Notes
Notes: svn path=/stable/6/; revision=250151
-rw-r--r--sys/boot/i386/btx/btx/btx.S2
-rw-r--r--sys/boot/pc98/btx/btx/btx.S2
2 files changed, 2 insertions, 2 deletions
diff --git a/sys/boot/i386/btx/btx/btx.S b/sys/boot/i386/btx/btx/btx.S
index e762e4baab56..903df2ec9eab 100644
--- a/sys/boot/i386/btx/btx/btx.S
+++ b/sys/boot/i386/btx/btx/btx.S
@@ -246,7 +246,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.
*/
diff --git a/sys/boot/pc98/btx/btx/btx.S b/sys/boot/pc98/btx/btx/btx.S
index 95788d4f8fae..92f25b814e2b 100644
--- a/sys/boot/pc98/btx/btx/btx.S
+++ b/sys/boot/pc98/btx/btx/btx.S
@@ -246,7 +246,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.
*/