c9807908ae
The old BTX passed the general purpose registers from the 32-bit client to the routines called via virtual 86 mode. The new BTX did the same thing. However, it turns out that some instructions behave differently in virtual 86 mode and real mode (even though this is under-documented). For example, the LEAVE instruction will cause an exception in real mode if any of the upper 16-bits of %ebp are non-zero after it executes. In virtual 8086 mode the upper 16-bits are simply ignored. This could cause faults in hardware interrupt handlers that inherited an %ebp larger than 0xffff from the 32-bit client (loader, boot2, etc.) while running in real mode. To fix, when executing hardware interrupt handlers provide an explicit clean state where all the general purpose and segment registers are zero upon entry to the interrupt handler. While here, I attempted to simplify the control flow in the 'intusr' code that sets up the various stack frames and exits protected mode to invoke the requested routine via real mode. A huge thanks to Tor Egge (tegge@) for debugging this issue. Submitted by: tegge Reviewed by: tegge Tested by: bz MFC after: 1 week |
||
---|---|---|
.. | ||
boot0 | ||
boot0ext | ||
boot0sio | ||
boot2 | ||
btx | ||
cdboot | ||
gptboot | ||
gptzfsboot | ||
kgzldr | ||
libfirewire | ||
libi386 | ||
loader | ||
mbr | ||
pmbr | ||
pxeldr | ||
zfsboot | ||
Makefile | ||
Makefile.inc |