Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 215660
b: refs/heads/master
c: 09ee57c
h: refs/heads/master
v: v3
  • Loading branch information
Avi Kivity committed Oct 24, 2010
1 parent 7278542 commit c9d1c15
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 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: dbe7758482a870f30a86bdeefebf4fc260afef11
refs/heads/master: 09ee57cdae3156aa3b74f378a0c57ef657c90f38
1 change: 1 addition & 0 deletions trunk/arch/x86/include/asm/kvm_emulate.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ struct decode_cache {
u8 modrm_mod;
u8 modrm_reg;
u8 modrm_rm;
u8 modrm_seg;
u8 use_modrm_ea;
bool rip_relative;
unsigned long modrm_ea;
Expand Down
10 changes: 6 additions & 4 deletions trunk/arch/x86/kvm/emulate.c
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,7 @@ static int decode_modrm(struct x86_emulate_ctxt *ctxt,
c->modrm_rm |= (c->modrm & 0x07);
c->modrm_ea = 0;
c->use_modrm_ea = 1;
c->modrm_seg = VCPU_SREG_DS;

if (c->modrm_mod == 3) {
c->modrm_ptr = decode_register(c->modrm_rm,
Expand Down Expand Up @@ -649,8 +650,7 @@ static int decode_modrm(struct x86_emulate_ctxt *ctxt,
}
if (c->modrm_rm == 2 || c->modrm_rm == 3 ||
(c->modrm_rm == 6 && c->modrm_mod != 0))
if (!c->has_seg_override)
set_seg_override(c, VCPU_SREG_SS);
c->modrm_seg = VCPU_SREG_SS;
c->modrm_ea = (u16)c->modrm_ea;
} else {
/* 32/64-bit ModR/M decode. */
Expand Down Expand Up @@ -2405,9 +2405,11 @@ x86_decode_insn(struct x86_emulate_ctxt *ctxt)
c->op_bytes = 8;

/* ModRM and SIB bytes. */
if (c->d & ModRM)
if (c->d & ModRM) {
rc = decode_modrm(ctxt, ops);
else if (c->d & MemAbs)
if (!c->has_seg_override)
set_seg_override(c, c->modrm_seg);
} else if (c->d & MemAbs)
rc = decode_abs(ctxt, ops);
if (rc != X86EMUL_CONTINUE)
goto done;
Expand Down

0 comments on commit c9d1c15

Please sign in to comment.