Skip to content

Commit f3bd64c

Browse files
Gleb Natapovavikivity
authored andcommitted
KVM: emulator: string_addr_inc() cleanup
Remove unneeded segment argument. Address structure already has correct segment which was put there during decode. Signed-off-by: Gleb Natapov <[email protected]> Signed-off-by: Avi Kivity <[email protected]>
1 parent 9d1b39a commit f3bd64c

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

arch/x86/kvm/emulate.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2790,14 +2790,13 @@ int emulator_task_switch(struct x86_emulate_ctxt *ctxt,
27902790
return (rc == X86EMUL_UNHANDLEABLE) ? EMULATION_FAILED : EMULATION_OK;
27912791
}
27922792

2793-
static void string_addr_inc(struct x86_emulate_ctxt *ctxt, unsigned seg,
2794-
int reg, struct operand *op)
2793+
static void string_addr_inc(struct x86_emulate_ctxt *ctxt, int reg,
2794+
struct operand *op)
27952795
{
27962796
int df = (ctxt->eflags & EFLG_DF) ? -1 : 1;
27972797

27982798
register_address_increment(ctxt, reg_rmw(ctxt, reg), df * op->bytes);
27992799
op->addr.mem.ea = register_address(ctxt, reg_read(ctxt, reg));
2800-
op->addr.mem.seg = seg;
28012800
}
28022801

28032802
static int em_das(struct x86_emulate_ctxt *ctxt)
@@ -4570,12 +4569,10 @@ int x86_emulate_insn(struct x86_emulate_ctxt *ctxt)
45704569
ctxt->dst.type = saved_dst_type;
45714570

45724571
if ((ctxt->d & SrcMask) == SrcSI)
4573-
string_addr_inc(ctxt, seg_override(ctxt),
4574-
VCPU_REGS_RSI, &ctxt->src);
4572+
string_addr_inc(ctxt, VCPU_REGS_RSI, &ctxt->src);
45754573

45764574
if ((ctxt->d & DstMask) == DstDI)
4577-
string_addr_inc(ctxt, VCPU_SREG_ES, VCPU_REGS_RDI,
4578-
&ctxt->dst);
4575+
string_addr_inc(ctxt, VCPU_REGS_RDI, &ctxt->dst);
45794576

45804577
if (ctxt->rep_prefix && (ctxt->d & String)) {
45814578
struct read_cache *r = &ctxt->io_read;

0 commit comments

Comments
 (0)