aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/emulate.c
diff options
context:
space:
mode:
authorWei Yongjun <yjwei@cn.fujitsu.com>2010-08-05 23:46:12 -0400
committerAvi Kivity <avi@redhat.com>2010-10-24 04:51:09 -0400
commita13a63faa6237001ed80d4f4051fc028dace10d9 (patch)
tree7f9572628d07184dc0d17a14c421b418dd0022cc /arch/x86/kvm/emulate.c
parent41167be544603e077b866a2922737556dc2294e8 (diff)
KVM: x86 emulator: remove dup code of in/out instruction
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/emulate.c')
-rw-r--r--arch/x86/kvm/emulate.c24
1 files changed, 4 insertions, 20 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 8e12e1b11ff8..cffe7c2819ed 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -2923,28 +2923,12 @@ special_insn:
2923 break; 2923 break;
2924 case 0x6c: /* insb */ 2924 case 0x6c: /* insb */
2925 case 0x6d: /* insw/insd */ 2925 case 0x6d: /* insw/insd */
2926 c->dst.bytes = min(c->dst.bytes, 4u); 2926 c->src.val = c->regs[VCPU_REGS_RDX];
2927 if (!emulator_io_permited(ctxt, ops, c->regs[VCPU_REGS_RDX], 2927 goto do_io_in;
2928 c->dst.bytes)) {
2929 emulate_gp(ctxt, 0);
2930 goto done;
2931 }
2932 if (!pio_in_emulated(ctxt, ops, c->dst.bytes,
2933 c->regs[VCPU_REGS_RDX], &c->dst.val))
2934 goto done; /* IO is needed, skip writeback */
2935 break;
2936 case 0x6e: /* outsb */ 2928 case 0x6e: /* outsb */
2937 case 0x6f: /* outsw/outsd */ 2929 case 0x6f: /* outsw/outsd */
2938 c->src.bytes = min(c->src.bytes, 4u); 2930 c->dst.val = c->regs[VCPU_REGS_RDX];
2939 if (!emulator_io_permited(ctxt, ops, c->regs[VCPU_REGS_RDX], 2931 goto do_io_out;
2940 c->src.bytes)) {
2941 emulate_gp(ctxt, 0);
2942 goto done;
2943 }
2944 ops->pio_out_emulated(c->src.bytes, c->regs[VCPU_REGS_RDX],
2945 &c->src.val, 1, ctxt->vcpu);
2946
2947 c->dst.type = OP_NONE; /* nothing to writeback */
2948 break; 2932 break;
2949 case 0x70 ... 0x7f: /* jcc (short) */ 2933 case 0x70 ... 0x7f: /* jcc (short) */
2950 if (test_cc(c->b, ctxt->eflags)) 2934 if (test_cc(c->b, ctxt->eflags))