summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2009-04-12 13:36:57 +0300
committerAvi Kivity <avi@redhat.com>2009-06-10 11:48:42 +0300
commitba8afb6b0a2c7e06da760ffe5d078245058619b5 (patch)
treecfa06923a20919ad95e1202cfaab78d80b85998f /arch/x86/kvm
parente637b8238ad1783ebdd113bd34cd6982dec1006d (diff)
downloadop-kernel-dev-ba8afb6b0a2c7e06da760ffe5d078245058619b5.zip
op-kernel-dev-ba8afb6b0a2c7e06da760ffe5d078245058619b5.tar.gz
KVM: x86 emulator: Add new mode of instruction emulation: skip
In the new mode instruction is decoded, but not executed. The EIP is moved to point after the instruction. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r--arch/x86/kvm/x86.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index b5ac1b7..8beccaa 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -2413,6 +2413,11 @@ int emulate_instruction(struct kvm_vcpu *vcpu,
}
}
+ if (emulation_type & EMULTYPE_SKIP) {
+ kvm_rip_write(vcpu, vcpu->arch.emulate_ctxt.decode.eip);
+ return EMULATE_DONE;
+ }
+
r = x86_emulate_insn(&vcpu->arch.emulate_ctxt, &emulate_ops);
if (vcpu->arch.pio.string)
OpenPOWER on IntegriCloud