Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 172336
b: refs/heads/master
c: eb3c79e
h: refs/heads/master
v: v3
  • Loading branch information
Avi Kivity committed Dec 3, 2009
1 parent 41ba9cf commit c67fefc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d7b0b5eb3000c6fb902f08c619fcd673a23d8fab
refs/heads/master: eb3c79e64a70fb8f7473e30fa07e89c1ecc2c9bb
2 changes: 1 addition & 1 deletion trunk/arch/x86/include/asm/kvm_emulate.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ struct decode_cache {
u8 seg_override;
unsigned int d;
unsigned long regs[NR_VCPU_REGS];
unsigned long eip;
unsigned long eip, eip_orig;
/* modrm */
u8 modrm;
u8 modrm_mod;
Expand Down
5 changes: 4 additions & 1 deletion trunk/arch/x86/kvm/emulate.c
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,9 @@ static int do_insn_fetch(struct x86_emulate_ctxt *ctxt,
{
int rc = 0;

/* x86 instructions are limited to 15 bytes. */
if (eip + size - ctxt->decode.eip_orig > 15)
return X86EMUL_UNHANDLEABLE;
eip += ctxt->cs_base;
while (size--) {
rc = do_fetch_insn_byte(ctxt, ops, eip++, dest++);
Expand Down Expand Up @@ -880,7 +883,7 @@ x86_decode_insn(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops)
/* Shadow copy of register state. Committed on successful emulation. */

memset(c, 0, sizeof(struct decode_cache));
c->eip = kvm_rip_read(ctxt->vcpu);
c->eip = c->eip_orig = kvm_rip_read(ctxt->vcpu);
ctxt->cs_base = seg_base(ctxt, VCPU_SREG_CS);
memcpy(c->regs, ctxt->vcpu->arch.regs, sizeof c->regs);

Expand Down

0 comments on commit c67fefc

Please sign in to comment.