Commit 3b9be3bf authored by Takuya Yoshikawa's avatar Takuya Yoshikawa Committed by Avi Kivity

KVM: x86 emulator: Remove unused arg from emulate_pop()

The opt of emulate_grp1a() is also removed.
Signed-off-by: default avatarTakuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent adddcecf
...@@ -1402,7 +1402,6 @@ static int em_push(struct x86_emulate_ctxt *ctxt) ...@@ -1402,7 +1402,6 @@ static int em_push(struct x86_emulate_ctxt *ctxt)
} }
static int emulate_pop(struct x86_emulate_ctxt *ctxt, static int emulate_pop(struct x86_emulate_ctxt *ctxt,
struct x86_emulate_ops *ops,
void *dest, int len) void *dest, int len)
{ {
struct decode_cache *c = &ctxt->decode; struct decode_cache *c = &ctxt->decode;
...@@ -1423,7 +1422,7 @@ static int em_pop(struct x86_emulate_ctxt *ctxt) ...@@ -1423,7 +1422,7 @@ static int em_pop(struct x86_emulate_ctxt *ctxt)
{ {
struct decode_cache *c = &ctxt->decode; struct decode_cache *c = &ctxt->decode;
return emulate_pop(ctxt, ctxt->ops, &c->dst.val, c->op_bytes); return emulate_pop(ctxt, &c->dst.val, c->op_bytes);
} }
static int emulate_popf(struct x86_emulate_ctxt *ctxt, static int emulate_popf(struct x86_emulate_ctxt *ctxt,
...@@ -1435,7 +1434,7 @@ static int emulate_popf(struct x86_emulate_ctxt *ctxt, ...@@ -1435,7 +1434,7 @@ static int emulate_popf(struct x86_emulate_ctxt *ctxt,
int iopl = (ctxt->eflags & X86_EFLAGS_IOPL) >> IOPL_SHIFT; int iopl = (ctxt->eflags & X86_EFLAGS_IOPL) >> IOPL_SHIFT;
int cpl = ops->cpl(ctxt); int cpl = ops->cpl(ctxt);
rc = emulate_pop(ctxt, ops, &val, len); rc = emulate_pop(ctxt, &val, len);
if (rc != X86EMUL_CONTINUE) if (rc != X86EMUL_CONTINUE)
return rc; return rc;
...@@ -1494,7 +1493,7 @@ static int emulate_pop_sreg(struct x86_emulate_ctxt *ctxt, ...@@ -1494,7 +1493,7 @@ static int emulate_pop_sreg(struct x86_emulate_ctxt *ctxt,
unsigned long selector; unsigned long selector;
int rc; int rc;
rc = emulate_pop(ctxt, ops, &selector, c->op_bytes); rc = emulate_pop(ctxt, &selector, c->op_bytes);
if (rc != X86EMUL_CONTINUE) if (rc != X86EMUL_CONTINUE)
return rc; return rc;
...@@ -1544,7 +1543,7 @@ static int em_popa(struct x86_emulate_ctxt *ctxt) ...@@ -1544,7 +1543,7 @@ static int em_popa(struct x86_emulate_ctxt *ctxt)
--reg; --reg;
} }
rc = emulate_pop(ctxt, ctxt->ops, &c->regs[reg], c->op_bytes); rc = emulate_pop(ctxt, &c->regs[reg], c->op_bytes);
if (rc != X86EMUL_CONTINUE) if (rc != X86EMUL_CONTINUE)
break; break;
--reg; --reg;
...@@ -1633,7 +1632,7 @@ static int emulate_iret_real(struct x86_emulate_ctxt *ctxt, ...@@ -1633,7 +1632,7 @@ static int emulate_iret_real(struct x86_emulate_ctxt *ctxt,
/* TODO: Add stack limit check */ /* TODO: Add stack limit check */
rc = emulate_pop(ctxt, ops, &temp_eip, c->op_bytes); rc = emulate_pop(ctxt, &temp_eip, c->op_bytes);
if (rc != X86EMUL_CONTINUE) if (rc != X86EMUL_CONTINUE)
return rc; return rc;
...@@ -1641,12 +1640,12 @@ static int emulate_iret_real(struct x86_emulate_ctxt *ctxt, ...@@ -1641,12 +1640,12 @@ static int emulate_iret_real(struct x86_emulate_ctxt *ctxt,
if (temp_eip & ~0xffff) if (temp_eip & ~0xffff)
return emulate_gp(ctxt, 0); return emulate_gp(ctxt, 0);
rc = emulate_pop(ctxt, ops, &cs, c->op_bytes); rc = emulate_pop(ctxt, &cs, c->op_bytes);
if (rc != X86EMUL_CONTINUE) if (rc != X86EMUL_CONTINUE)
return rc; return rc;
rc = emulate_pop(ctxt, ops, &temp_eflags, c->op_bytes); rc = emulate_pop(ctxt, &temp_eflags, c->op_bytes);
if (rc != X86EMUL_CONTINUE) if (rc != X86EMUL_CONTINUE)
return rc; return rc;
...@@ -1688,12 +1687,11 @@ static inline int emulate_iret(struct x86_emulate_ctxt *ctxt, ...@@ -1688,12 +1687,11 @@ static inline int emulate_iret(struct x86_emulate_ctxt *ctxt,
} }
} }
static inline int emulate_grp1a(struct x86_emulate_ctxt *ctxt, static inline int emulate_grp1a(struct x86_emulate_ctxt *ctxt)
struct x86_emulate_ops *ops)
{ {
struct decode_cache *c = &ctxt->decode; struct decode_cache *c = &ctxt->decode;
return emulate_pop(ctxt, ops, &c->dst.val, c->dst.bytes); return emulate_pop(ctxt, &c->dst.val, c->dst.bytes);
} }
static inline void emulate_grp2(struct x86_emulate_ctxt *ctxt) static inline void emulate_grp2(struct x86_emulate_ctxt *ctxt)
...@@ -1822,12 +1820,12 @@ static int emulate_ret_far(struct x86_emulate_ctxt *ctxt, ...@@ -1822,12 +1820,12 @@ static int emulate_ret_far(struct x86_emulate_ctxt *ctxt,
int rc; int rc;
unsigned long cs; unsigned long cs;
rc = emulate_pop(ctxt, ops, &c->eip, c->op_bytes); rc = emulate_pop(ctxt, &c->eip, c->op_bytes);
if (rc != X86EMUL_CONTINUE) if (rc != X86EMUL_CONTINUE)
return rc; return rc;
if (c->op_bytes == 4) if (c->op_bytes == 4)
c->eip = (u32)c->eip; c->eip = (u32)c->eip;
rc = emulate_pop(ctxt, ops, &cs, c->op_bytes); rc = emulate_pop(ctxt, &cs, c->op_bytes);
if (rc != X86EMUL_CONTINUE) if (rc != X86EMUL_CONTINUE)
return rc; return rc;
rc = load_segment_descriptor(ctxt, ops, (u16)cs, VCPU_SREG_CS); rc = load_segment_descriptor(ctxt, ops, (u16)cs, VCPU_SREG_CS);
...@@ -2543,7 +2541,7 @@ static int em_ret_near_imm(struct x86_emulate_ctxt *ctxt) ...@@ -2543,7 +2541,7 @@ static int em_ret_near_imm(struct x86_emulate_ctxt *ctxt)
c->dst.type = OP_REG; c->dst.type = OP_REG;
c->dst.addr.reg = &c->eip; c->dst.addr.reg = &c->eip;
c->dst.bytes = c->op_bytes; c->dst.bytes = c->op_bytes;
rc = emulate_pop(ctxt, ctxt->ops, &c->dst.val, c->op_bytes); rc = emulate_pop(ctxt, &c->dst.val, c->op_bytes);
if (rc != X86EMUL_CONTINUE) if (rc != X86EMUL_CONTINUE)
return rc; return rc;
register_address_increment(c, &c->regs[VCPU_REGS_RSP], c->src.val); register_address_increment(c, &c->regs[VCPU_REGS_RSP], c->src.val);
...@@ -3918,7 +3916,7 @@ x86_emulate_insn(struct x86_emulate_ctxt *ctxt) ...@@ -3918,7 +3916,7 @@ x86_emulate_insn(struct x86_emulate_ctxt *ctxt)
break; break;
} }
case 0x8f: /* pop (sole member of Grp1a) */ case 0x8f: /* pop (sole member of Grp1a) */
rc = emulate_grp1a(ctxt, ops); rc = emulate_grp1a(ctxt);
break; break;
case 0x90 ... 0x97: /* nop / xchg reg, rax */ case 0x90 ... 0x97: /* nop / xchg reg, rax */
if (c->dst.addr.reg == &c->regs[VCPU_REGS_RAX]) if (c->dst.addr.reg == &c->regs[VCPU_REGS_RAX])
......
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