Commit 342fc630 authored by Avi Kivity's avatar Avi Kivity

KVM: x86 emulator: switch LEA to use SrcMem decoding

The NoAccess flag will prevent memory from being accessed.
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent 5a506b12
...@@ -2153,7 +2153,7 @@ static struct opcode opcode_table[256] = { ...@@ -2153,7 +2153,7 @@ static struct opcode opcode_table[256] = {
/* 0x88 - 0x8F */ /* 0x88 - 0x8F */
D(ByteOp | DstMem | SrcReg | ModRM | Mov), D(DstMem | SrcReg | ModRM | Mov), D(ByteOp | DstMem | SrcReg | ModRM | Mov), D(DstMem | SrcReg | ModRM | Mov),
D(ByteOp | DstReg | SrcMem | ModRM | Mov), D(DstReg | SrcMem | ModRM | Mov), D(ByteOp | DstReg | SrcMem | ModRM | Mov), D(DstReg | SrcMem | ModRM | Mov),
D(DstMem | SrcNone | ModRM | Mov), D(ModRM | DstReg), D(DstMem | SrcNone | ModRM | Mov), D(ModRM | SrcMem | NoAccess | DstReg),
D(ImplicitOps | SrcMem16 | ModRM), G(0, group1A), D(ImplicitOps | SrcMem16 | ModRM), G(0, group1A),
/* 0x90 - 0x97 */ /* 0x90 - 0x97 */
X8(D(SrcAcc | DstReg)), X8(D(SrcAcc | DstReg)),
...@@ -2895,7 +2895,7 @@ x86_emulate_insn(struct x86_emulate_ctxt *ctxt) ...@@ -2895,7 +2895,7 @@ x86_emulate_insn(struct x86_emulate_ctxt *ctxt)
c->dst.val = ops->get_segment_selector(c->modrm_reg, ctxt->vcpu); c->dst.val = ops->get_segment_selector(c->modrm_reg, ctxt->vcpu);
break; break;
case 0x8d: /* lea r16/r32, m */ case 0x8d: /* lea r16/r32, m */
c->dst.val = c->modrm_ea; c->dst.val = c->src.addr.mem;
break; break;
case 0x8e: { /* mov seg, r/m16 */ case 0x8e: { /* mov seg, r/m16 */
uint16_t sel; uint16_t sel;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment