mirror of
https://github.com/fail0verflow/switch-linux.git
synced 2025-05-04 02:34:21 -04:00
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 <gleb@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
This commit is contained in:
parent
9d1b39a967
commit
f3bd64c68a
1 changed files with 4 additions and 7 deletions
|
@ -2790,14 +2790,13 @@ int emulator_task_switch(struct x86_emulate_ctxt *ctxt,
|
||||||
return (rc == X86EMUL_UNHANDLEABLE) ? EMULATION_FAILED : EMULATION_OK;
|
return (rc == X86EMUL_UNHANDLEABLE) ? EMULATION_FAILED : EMULATION_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void string_addr_inc(struct x86_emulate_ctxt *ctxt, unsigned seg,
|
static void string_addr_inc(struct x86_emulate_ctxt *ctxt, int reg,
|
||||||
int reg, struct operand *op)
|
struct operand *op)
|
||||||
{
|
{
|
||||||
int df = (ctxt->eflags & EFLG_DF) ? -1 : 1;
|
int df = (ctxt->eflags & EFLG_DF) ? -1 : 1;
|
||||||
|
|
||||||
register_address_increment(ctxt, reg_rmw(ctxt, reg), df * op->bytes);
|
register_address_increment(ctxt, reg_rmw(ctxt, reg), df * op->bytes);
|
||||||
op->addr.mem.ea = register_address(ctxt, reg_read(ctxt, reg));
|
op->addr.mem.ea = register_address(ctxt, reg_read(ctxt, reg));
|
||||||
op->addr.mem.seg = seg;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int em_das(struct x86_emulate_ctxt *ctxt)
|
static int em_das(struct x86_emulate_ctxt *ctxt)
|
||||||
|
@ -4570,12 +4569,10 @@ writeback:
|
||||||
ctxt->dst.type = saved_dst_type;
|
ctxt->dst.type = saved_dst_type;
|
||||||
|
|
||||||
if ((ctxt->d & SrcMask) == SrcSI)
|
if ((ctxt->d & SrcMask) == SrcSI)
|
||||||
string_addr_inc(ctxt, seg_override(ctxt),
|
string_addr_inc(ctxt, VCPU_REGS_RSI, &ctxt->src);
|
||||||
VCPU_REGS_RSI, &ctxt->src);
|
|
||||||
|
|
||||||
if ((ctxt->d & DstMask) == DstDI)
|
if ((ctxt->d & DstMask) == DstDI)
|
||||||
string_addr_inc(ctxt, VCPU_SREG_ES, VCPU_REGS_RDI,
|
string_addr_inc(ctxt, VCPU_REGS_RDI, &ctxt->dst);
|
||||||
&ctxt->dst);
|
|
||||||
|
|
||||||
if (ctxt->rep_prefix && (ctxt->d & String)) {
|
if (ctxt->rep_prefix && (ctxt->d & String)) {
|
||||||
struct read_cache *r = &ctxt->io_read;
|
struct read_cache *r = &ctxt->io_read;
|
||||||
|
|
Loading…
Add table
Reference in a new issue