]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[librm] Speed up real-to-protected mode transition under KVM
authorMichael Brown <mcb30@ipxe.org>
Fri, 2 May 2014 12:18:55 +0000 (13:18 +0100)
committerMichael Brown <mcb30@ipxe.org>
Fri, 2 May 2014 14:23:21 +0000 (15:23 +0100)
commitc64747db5040d860c9c77f2673c4cce287249bbd
tree1c9ddbd0516a5240916bcd79eae9ca4652c13ffa
parent5a08b63cb7fe3e0c03245c55d955e45226e08bc3
[librm] Speed up real-to-protected mode transition under KVM

Ensure that all segment registers have zero in the low two bits before
transitioning to protected mode.  This allows the CPU state to
immediately be deemed to be "valid", and eliminates the need for any
further emulated instructions.

Load the protected-mode interrupt descriptor table after switching to
protected mode, since this avoids triggering an EXCEPTION_NMI and
corresponding VM exit.

This reduces the time taken by real_to_prot under KVM by around 50%.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/arch/i386/prefix/libprefix.S
src/arch/i386/transitions/librm.S
src/arch/i386/transitions/librm_mgmt.c