KVM: Avoid instruction emulation when event delivery is pending
authorAvi Kivity <avi@qumranet.com>
Sat, 19 Jul 2008 05:57:05 +0000 (08:57 +0300)
committerAvi Kivity <avi@qumranet.com>
Sun, 27 Jul 2008 08:34:10 +0000 (11:34 +0300)
commit577bdc496614ced56d999bbb425e85adf2386490
treed4fea399ef6321075ec066963be2d37f961785a6
parent34198bf8426276a2ce1e97056a0f02d43637e5ae
KVM: Avoid instruction emulation when event delivery is pending

When an event (such as an interrupt) is injected, and the stack is
shadowed (and therefore write protected), the guest will exit.  The
current code will see that the stack is shadowed and emulate a few
instructions, each time postponing the injection.  Eventually the
injection may succeed, but at that time the guest may be unwilling
to accept the interrupt (for example, the TPR may have changed).

This occurs every once in a while during a Windows 2008 boot.

Fix by unshadowing the fault address if the fault was due to an event
injection.

Signed-off-by: Avi Kivity <avi@qumranet.com>
arch/x86/kvm/mmu.c
arch/x86/kvm/svm.c
arch/x86/kvm/vmx.c