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
This commit is contained in:
Dimitry Andric 2013-04-24 17:20:45 +00:00
parent ffae621edd
commit dbfc29017c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=249846
2 changed files with 2 additions and 2 deletions

View File

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

View File

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