KVM: x86 emulator: restart string instruction without going back to a guest.
authorGleb Natapov <gleb@redhat.com>
Thu, 18 Mar 2010 13:20:26 +0000 (15:20 +0200)
committerAvi Kivity <avi@redhat.com>
Mon, 17 May 2010 09:16:29 +0000 (12:16 +0300)
commit5cd21917da245fbe98bd443de2c7f519b3df6814
tree0bb2d4ee197011a92002a5cc32d19758a1e87ed0
parentcb404fe0898779ec5fe5e06e90aaddcf40aefad8
KVM: x86 emulator: restart string instruction without going back to a guest.

Currently when string instruction is only partially complete we go back
to a guest mode, guest tries to reexecute instruction and exits again
and at this point emulation continues. Avoid all of this by restarting
instruction without going back to a guest mode, but return to a guest
mode each 1024 iterations to allow interrupt injection. Pending
exception causes immediate guest entry too.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
arch/x86/include/asm/kvm_emulate.h
arch/x86/kvm/emulate.c
arch/x86/kvm/x86.c