aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAvi Kivity <avi.kivity@gmail.com>2013-02-09 04:31:47 -0500
committerGleb Natapov <gleb@redhat.com>2013-05-21 08:43:19 -0400
commit017da7b604cf1982c35162c29895fba842282e11 (patch)
tree685218ed0edea0b7c8ad71bc400c7441086dbb88 /arch
parentab2c5ce66661e07c315a53bef9b507cf766d7905 (diff)
KVM: x86 emulator: Switch fastop src operand to RDX
This makes OpAccHi useful. Signed-off-by: Avi Kivity <avi.kivity@gmail.com> Signed-off-by: Gleb Natapov <gleb@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kvm/emulate.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index b9fb89b4ee26..b899d2418c19 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -179,8 +179,8 @@
179/* 179/*
180 * fastop functions have a special calling convention: 180 * fastop functions have a special calling convention:
181 * 181 *
182 * dst: [rdx]:rax (in/out) 182 * dst: rax (in/out)
183 * src: rbx (in/out) 183 * src: rdx (in/out)
184 * src2: rcx (in) 184 * src2: rcx (in)
185 * flags: rflags (in/out) 185 * flags: rflags (in/out)
186 * 186 *
@@ -485,19 +485,19 @@ static int fastop(struct x86_emulate_ctxt *ctxt, void (*fop)(struct fastop *));
485 485
486#define FASTOP2(op) \ 486#define FASTOP2(op) \
487 FOP_START(op) \ 487 FOP_START(op) \
488 FOP2E(op##b, al, bl) \ 488 FOP2E(op##b, al, dl) \
489 FOP2E(op##w, ax, bx) \ 489 FOP2E(op##w, ax, dx) \
490 FOP2E(op##l, eax, ebx) \ 490 FOP2E(op##l, eax, edx) \
491 ON64(FOP2E(op##q, rax, rbx)) \ 491 ON64(FOP2E(op##q, rax, rdx)) \
492 FOP_END 492 FOP_END
493 493
494/* 2 operand, word only */ 494/* 2 operand, word only */
495#define FASTOP2W(op) \ 495#define FASTOP2W(op) \
496 FOP_START(op) \ 496 FOP_START(op) \
497 FOPNOP() \ 497 FOPNOP() \
498 FOP2E(op##w, ax, bx) \ 498 FOP2E(op##w, ax, dx) \
499 FOP2E(op##l, eax, ebx) \ 499 FOP2E(op##l, eax, edx) \
500 ON64(FOP2E(op##q, rax, rbx)) \ 500 ON64(FOP2E(op##q, rax, rdx)) \
501 FOP_END 501 FOP_END
502 502
503/* 2 operand, src is CL */ 503/* 2 operand, src is CL */
@@ -516,9 +516,9 @@ static int fastop(struct x86_emulate_ctxt *ctxt, void (*fop)(struct fastop *));
516#define FASTOP3WCL(op) \ 516#define FASTOP3WCL(op) \
517 FOP_START(op) \ 517 FOP_START(op) \
518 FOPNOP() \ 518 FOPNOP() \
519 FOP3E(op##w, ax, bx, cl) \ 519 FOP3E(op##w, ax, dx, cl) \
520 FOP3E(op##l, eax, ebx, cl) \ 520 FOP3E(op##l, eax, edx, cl) \
521 ON64(FOP3E(op##q, rax, rbx, cl)) \ 521 ON64(FOP3E(op##q, rax, rdx, cl)) \
522 FOP_END 522 FOP_END
523 523
524/* Special case for SETcc - 1 instruction per cc */ 524/* Special case for SETcc - 1 instruction per cc */
@@ -4574,7 +4574,7 @@ static int fastop(struct x86_emulate_ctxt *ctxt, void (*fop)(struct fastop *))
4574 ulong flags = (ctxt->eflags & EFLAGS_MASK) | X86_EFLAGS_IF; 4574 ulong flags = (ctxt->eflags & EFLAGS_MASK) | X86_EFLAGS_IF;
4575 fop += __ffs(ctxt->dst.bytes) * FASTOP_SIZE; 4575 fop += __ffs(ctxt->dst.bytes) * FASTOP_SIZE;
4576 asm("push %[flags]; popf; call *%[fastop]; pushf; pop %[flags]\n" 4576 asm("push %[flags]; popf; call *%[fastop]; pushf; pop %[flags]\n"
4577 : "+a"(ctxt->dst.val), "+b"(ctxt->src.val), [flags]"+D"(flags) 4577 : "+a"(ctxt->dst.val), "+d"(ctxt->src.val), [flags]"+D"(flags)
4578 : "c"(ctxt->src2.val), [fastop]"S"(fop)); 4578 : "c"(ctxt->src2.val), [fastop]"S"(fop));
4579 ctxt->eflags = (ctxt->eflags & ~EFLAGS_MASK) | (flags & EFLAGS_MASK); 4579 ctxt->eflags = (ctxt->eflags & ~EFLAGS_MASK) | (flags & EFLAGS_MASK);
4580 return X86EMUL_CONTINUE; 4580 return X86EMUL_CONTINUE;