Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 80628
b: refs/heads/master
c: 1be3aa4
h: refs/heads/master
v: v3
  • Loading branch information
Laurent Vivier authored and Avi Kivity committed Jan 30, 2008
1 parent 5a5882b commit bcbfe99
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 15 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: 8b4caf6650808024c37ec4b29cf81b308af998b1
refs/heads/master: 1be3aa47182e94944e57b176a5c4ee4e74f1ce33
5 changes: 4 additions & 1 deletion trunk/drivers/kvm/kvm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1287,7 +1287,10 @@ int emulate_instruction(struct kvm_vcpu *vcpu,

vcpu->mmio_is_write = 0;
vcpu->pio.string = 0;
r = x86_emulate_memop(&emulate_ctxt, &emulate_ops);
r = x86_decode_insn(&emulate_ctxt, &emulate_ops);
if (r == 0)
r = x86_emulate_insn(&emulate_ctxt, &emulate_ops);

if (vcpu->pio.string)
return EMULATE_DO_MMIO;

Expand Down
8 changes: 2 additions & 6 deletions trunk/drivers/kvm/x86_emulate.c
Original file line number Diff line number Diff line change
Expand Up @@ -908,18 +908,14 @@ x86_decode_insn(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops)
}

int
x86_emulate_memop(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops)
x86_emulate_insn(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops)
{
unsigned long cr2 = ctxt->cr2;
int no_wb = 0;
u64 msr_data;
unsigned long _eflags = ctxt->eflags;
struct decode_cache *c = &ctxt->decode;
int rc;

rc = x86_decode_insn(ctxt, ops);
if (rc)
return rc;
int rc = 0;

if ((c->d & ModRM) && (c->modrm_mod != 3))
cr2 = c->modrm_ea;
Expand Down
11 changes: 4 additions & 7 deletions trunk/drivers/kvm/x86_emulate.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,9 @@ struct x86_emulate_ctxt {
#define X86EMUL_MODE_HOST X86EMUL_MODE_PROT64
#endif

/*
* x86_emulate_memop: Emulate an instruction that faulted attempting to
* read/write a 'special' memory area.
* Returns -1 on failure, 0 on success.
*/
int x86_emulate_memop(struct x86_emulate_ctxt *ctxt,
struct x86_emulate_ops *ops);
int x86_decode_insn(struct x86_emulate_ctxt *ctxt,
struct x86_emulate_ops *ops);
int x86_emulate_insn(struct x86_emulate_ctxt *ctxt,
struct x86_emulate_ops *ops);

#endif /* __X86_EMULATE_H__ */

0 comments on commit bcbfe99

Please sign in to comment.