diff options
author | Gleb Natapov <gleb@redhat.com> | 2010-03-18 09:20:25 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-05-17 05:16:28 -0400 |
commit | cb404fe0898779ec5fe5e06e90aaddcf40aefad8 (patch) | |
tree | 4ad6b092713780681a74d91113cfcda1919ba739 /arch/x86/kvm | |
parent | 7972995b0c346de76fe260ce0fd6bcc8ffab724a (diff) |
KVM: x86 emulator: remove saved_eip
c->eip is never written back in case of emulation failure, so no need to
set it to old value.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r-- | arch/x86/kvm/emulate.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 2c66e097d916..0579d9dd9aac 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c | |||
@@ -2424,7 +2424,6 @@ int | |||
2424 | x86_emulate_insn(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops) | 2424 | x86_emulate_insn(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops) |
2425 | { | 2425 | { |
2426 | u64 msr_data; | 2426 | u64 msr_data; |
2427 | unsigned long saved_eip = 0; | ||
2428 | struct decode_cache *c = &ctxt->decode; | 2427 | struct decode_cache *c = &ctxt->decode; |
2429 | int rc = X86EMUL_CONTINUE; | 2428 | int rc = X86EMUL_CONTINUE; |
2430 | 2429 | ||
@@ -2436,7 +2435,6 @@ x86_emulate_insn(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops) | |||
2436 | */ | 2435 | */ |
2437 | 2436 | ||
2438 | memcpy(c->regs, ctxt->vcpu->arch.regs, sizeof c->regs); | 2437 | memcpy(c->regs, ctxt->vcpu->arch.regs, sizeof c->regs); |
2439 | saved_eip = c->eip; | ||
2440 | 2438 | ||
2441 | if (ctxt->mode == X86EMUL_MODE_PROT64 && (c->d & No64)) { | 2439 | if (ctxt->mode == X86EMUL_MODE_PROT64 && (c->d & No64)) { |
2442 | kvm_queue_exception(ctxt->vcpu, UD_VECTOR); | 2440 | kvm_queue_exception(ctxt->vcpu, UD_VECTOR); |
@@ -2928,11 +2926,7 @@ writeback: | |||
2928 | kvm_rip_write(ctxt->vcpu, c->eip); | 2926 | kvm_rip_write(ctxt->vcpu, c->eip); |
2929 | 2927 | ||
2930 | done: | 2928 | done: |
2931 | if (rc == X86EMUL_UNHANDLEABLE) { | 2929 | return (rc == X86EMUL_UNHANDLEABLE) ? -1 : 0; |
2932 | c->eip = saved_eip; | ||
2933 | return -1; | ||
2934 | } | ||
2935 | return 0; | ||
2936 | 2930 | ||
2937 | twobyte_insn: | 2931 | twobyte_insn: |
2938 | switch (c->b) { | 2932 | switch (c->b) { |
@@ -3209,6 +3203,5 @@ twobyte_insn: | |||
3209 | 3203 | ||
3210 | cannot_emulate: | 3204 | cannot_emulate: |
3211 | DPRINTF("Cannot emulate %02x\n", c->b); | 3205 | DPRINTF("Cannot emulate %02x\n", c->b); |
3212 | c->eip = saved_eip; | ||
3213 | return -1; | 3206 | return -1; |
3214 | } | 3207 | } |