diff options
author | Gleb Natapov <gleb@redhat.com> | 2012-09-03 08:24:28 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2012-09-06 11:07:01 -0400 |
commit | f3bd64c68a8f1245e3d037f70c6936cd7bb1196b (patch) | |
tree | fafa87b2442c51a422c2cbc153545b798105af13 /arch/x86/kvm | |
parent | 9d1b39a967871b7c69025dba7b7bdaee42871021 (diff) |
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>
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r-- | arch/x86/kvm/emulate.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 5fe06a8fbebc..415f903facd3 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c | |||
@@ -2790,14 +2790,13 @@ int emulator_task_switch(struct x86_emulate_ctxt *ctxt, | |||
2790 | return (rc == X86EMUL_UNHANDLEABLE) ? EMULATION_FAILED : EMULATION_OK; | 2790 | return (rc == X86EMUL_UNHANDLEABLE) ? EMULATION_FAILED : EMULATION_OK; |
2791 | } | 2791 | } |
2792 | 2792 | ||
2793 | static void string_addr_inc(struct x86_emulate_ctxt *ctxt, unsigned seg, | 2793 | static void string_addr_inc(struct x86_emulate_ctxt *ctxt, int reg, |
2794 | int reg, struct operand *op) | 2794 | struct operand *op) |
2795 | { | 2795 | { |
2796 | int df = (ctxt->eflags & EFLG_DF) ? -1 : 1; | 2796 | int df = (ctxt->eflags & EFLG_DF) ? -1 : 1; |
2797 | 2797 | ||
2798 | register_address_increment(ctxt, reg_rmw(ctxt, reg), df * op->bytes); | 2798 | register_address_increment(ctxt, reg_rmw(ctxt, reg), df * op->bytes); |
2799 | op->addr.mem.ea = register_address(ctxt, reg_read(ctxt, reg)); | 2799 | op->addr.mem.ea = register_address(ctxt, reg_read(ctxt, reg)); |
2800 | op->addr.mem.seg = seg; | ||
2801 | } | 2800 | } |
2802 | 2801 | ||
2803 | static int em_das(struct x86_emulate_ctxt *ctxt) | 2802 | static int em_das(struct x86_emulate_ctxt *ctxt) |
@@ -4570,12 +4569,10 @@ writeback: | |||
4570 | ctxt->dst.type = saved_dst_type; | 4569 | ctxt->dst.type = saved_dst_type; |
4571 | 4570 | ||
4572 | if ((ctxt->d & SrcMask) == SrcSI) | 4571 | if ((ctxt->d & SrcMask) == SrcSI) |
4573 | string_addr_inc(ctxt, seg_override(ctxt), | 4572 | string_addr_inc(ctxt, VCPU_REGS_RSI, &ctxt->src); |
4574 | VCPU_REGS_RSI, &ctxt->src); | ||
4575 | 4573 | ||
4576 | if ((ctxt->d & DstMask) == DstDI) | 4574 | if ((ctxt->d & DstMask) == DstDI) |
4577 | string_addr_inc(ctxt, VCPU_SREG_ES, VCPU_REGS_RDI, | 4575 | string_addr_inc(ctxt, VCPU_REGS_RDI, &ctxt->dst); |
4578 | &ctxt->dst); | ||
4579 | 4576 | ||
4580 | if (ctxt->rep_prefix && (ctxt->d & String)) { | 4577 | if (ctxt->rep_prefix && (ctxt->d & String)) { |
4581 | struct read_cache *r = &ctxt->io_read; | 4578 | struct read_cache *r = &ctxt->io_read; |