mirror of
https://github.com/xcat2/xNBA.git
synced 2024-11-25 19:08:35 +00:00
xCAT Network Boot Agent
5a08b63cb7
On an Intel CPU supporting VMX, KVM will emulate instructions while the CPU state remains "invalid". In real mode, the CPU state is defined to be "invalid" if any segment register has a base which is not equal to (sreg<<4) or a limit which is not equal to 64kB. We don't actually use the base stored in the REAL_DS descriptor for any significant purpose. Change the base stored in this descriptor to be equal to (REAL_DS<<4). A segment register loaded with REAL_DS is then automatically valid in both real and protected modes. This allows KVM to stop emulating instructions much sooner. The only use of REAL_DS for memory accesses currently occurs in the indirect ljmp within prot_to_real. Change this to a direct ljmp, storing rm_cs in .text16 as part of the ljmp instruction. This removes the only memory access via REAL_DS (thereby allowing for the above descriptor base address hack), and also simplifies the ljmp instruction (which will still have to be emulated). Load the real-mode interrupt descriptor table register before switching to real mode, since this avoids triggering an EXCEPTION_NMI and corresponding VM exit. This reduces the time taken by prot_to_real under KVM by around 65%. Signed-off-by: Michael Brown <mcb30@ipxe.org> |
||
---|---|---|
contrib | ||
src | ||
COPYING | ||
COPYRIGHTS | ||
README |
iPXE README File Quick start guide: cd src make For any more detailed instructions, see http://ipxe.org