Commit d4b4325f authored by Avi Kivity's avatar Avi Kivity

KVM: x86 emulator: switch lds/les/lss/lfs/lgs to direct decode

Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
parent c191a7a0
...@@ -1828,8 +1828,9 @@ static int em_ret_far(struct x86_emulate_ctxt *ctxt) ...@@ -1828,8 +1828,9 @@ static int em_ret_far(struct x86_emulate_ctxt *ctxt)
return rc; return rc;
} }
static int emulate_load_segment(struct x86_emulate_ctxt *ctxt, int seg) static int em_lseg(struct x86_emulate_ctxt *ctxt)
{ {
int seg = ctxt->src2.val;
unsigned short sel; unsigned short sel;
int rc; int rc;
...@@ -3193,8 +3194,8 @@ static struct opcode opcode_table[256] = { ...@@ -3193,8 +3194,8 @@ static struct opcode opcode_table[256] = {
D2bv(DstMem | SrcImmByte | ModRM), D2bv(DstMem | SrcImmByte | ModRM),
I(ImplicitOps | Stack | SrcImmU16, em_ret_near_imm), I(ImplicitOps | Stack | SrcImmU16, em_ret_near_imm),
I(ImplicitOps | Stack, em_ret), I(ImplicitOps | Stack, em_ret),
D(DstReg | SrcMemFAddr | ModRM | No64 | Src2ES), I(DstReg | SrcMemFAddr | ModRM | No64 | Src2ES, em_lseg),
D(DstReg | SrcMemFAddr | ModRM | No64 | Src2DS), I(DstReg | SrcMemFAddr | ModRM | No64 | Src2DS, em_lseg),
G(ByteOp, group11), G(0, group11), G(ByteOp, group11), G(0, group11),
/* 0xC8 - 0xCF */ /* 0xC8 - 0xCF */
N, N, N, I(ImplicitOps | Stack, em_ret_far), N, N, N, I(ImplicitOps | Stack, em_ret_far),
...@@ -3281,10 +3282,10 @@ static struct opcode twobyte_table[256] = { ...@@ -3281,10 +3282,10 @@ static struct opcode twobyte_table[256] = {
D(ModRM), I(DstReg | SrcMem | ModRM, em_imul), D(ModRM), I(DstReg | SrcMem | ModRM, em_imul),
/* 0xB0 - 0xB7 */ /* 0xB0 - 0xB7 */
D2bv(DstMem | SrcReg | ModRM | Lock), D2bv(DstMem | SrcReg | ModRM | Lock),
D(DstReg | SrcMemFAddr | ModRM | Src2SS), I(DstReg | SrcMemFAddr | ModRM | Src2SS, em_lseg),
D(DstMem | SrcReg | ModRM | BitOp | Lock), D(DstMem | SrcReg | ModRM | BitOp | Lock),
D(DstReg | SrcMemFAddr | ModRM | Src2FS), I(DstReg | SrcMemFAddr | ModRM | Src2FS, em_lseg),
D(DstReg | SrcMemFAddr | ModRM | Src2GS), I(DstReg | SrcMemFAddr | ModRM | Src2GS, em_lseg),
D(ByteOp | DstReg | SrcMem | ModRM | Mov), D(DstReg | SrcMem16 | ModRM | Mov), D(ByteOp | DstReg | SrcMem | ModRM | Mov), D(DstReg | SrcMem16 | ModRM | Mov),
/* 0xB8 - 0xBF */ /* 0xB8 - 0xBF */
N, N, N, N,
...@@ -3893,10 +3894,6 @@ int x86_emulate_insn(struct x86_emulate_ctxt *ctxt) ...@@ -3893,10 +3894,6 @@ int x86_emulate_insn(struct x86_emulate_ctxt *ctxt)
case 0xc0 ... 0xc1: case 0xc0 ... 0xc1:
rc = em_grp2(ctxt); rc = em_grp2(ctxt);
break; break;
case 0xc4: /* les */
case 0xc5: /* lds */
rc = emulate_load_segment(ctxt, ctxt->src2.val);
break;
case 0xcc: /* int3 */ case 0xcc: /* int3 */
rc = emulate_int(ctxt, 3); rc = emulate_int(ctxt, 3);
break; break;
...@@ -4146,11 +4143,6 @@ int x86_emulate_insn(struct x86_emulate_ctxt *ctxt) ...@@ -4146,11 +4143,6 @@ int x86_emulate_insn(struct x86_emulate_ctxt *ctxt)
ctxt->dst.addr.reg = (unsigned long *)&ctxt->regs[VCPU_REGS_RAX]; ctxt->dst.addr.reg = (unsigned long *)&ctxt->regs[VCPU_REGS_RAX];
} }
break; break;
case 0xb2: /* lss */
case 0xb4: /* lfs */
case 0xb5: /* lgs */
rc = emulate_load_segment(ctxt, ctxt->src2.val);
break;
case 0xb3: case 0xb3:
btr: /* btr */ btr: /* btr */
emulate_2op_SrcV_nobyte(ctxt, "btr"); emulate_2op_SrcV_nobyte(ctxt, "btr");
......
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