From: Avi Kivity <avi.kivity@gmail.com>
To: Gleb Natapov <gleb@redhat.com>, Marcelo Tosatti <mtosatti@redhat.com>
Cc: kvm@vger.kernel.org
Subject: [PATCH v2 7/8] KVM: x86 emulator: rearrange fastop definitions
Date: Sat, 19 Jan 2013 19:51:56 +0200 [thread overview]
Message-ID: <1358617917-2076-8-git-send-email-avi.kivity@gmail.com> (raw)
In-Reply-To: <1358617917-2076-1-git-send-email-avi.kivity@gmail.com>
Make fastop opcodes usable in other emulations.
Signed-off-by: Avi Kivity <avi.kivity@gmail.com>
---
arch/x86/kvm/emulate.c | 70 +++++++++++++++++++++++++-------------------------
1 file changed, 35 insertions(+), 35 deletions(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 45ddec8..d06354d 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -972,6 +972,41 @@ static int read_descriptor(struct x86_emulate_ctxt *ctxt,
return rc;
}
+FASTOP2(add);
+FASTOP2(or);
+FASTOP2(adc);
+FASTOP2(sbb);
+FASTOP2(and);
+FASTOP2(sub);
+FASTOP2(xor);
+FASTOP2(cmp);
+FASTOP2(test);
+
+FASTOP3WCL(shld);
+FASTOP3WCL(shrd);
+
+FASTOP2W(imul);
+
+FASTOP1(not);
+FASTOP1(neg);
+FASTOP1(inc);
+FASTOP1(dec);
+
+FASTOP2CL(rol);
+FASTOP2CL(ror);
+FASTOP2CL(rcl);
+FASTOP2CL(rcr);
+FASTOP2CL(shl);
+FASTOP2CL(shr);
+FASTOP2CL(sar);
+
+FASTOP2W(bsf);
+FASTOP2W(bsr);
+FASTOP2W(bt);
+FASTOP2W(bts);
+FASTOP2W(btr);
+FASTOP2W(btc);
+
static u8 test_cc(unsigned int condition, unsigned long flags)
{
u8 rc;
@@ -2064,26 +2099,6 @@ static int em_jmp_far(struct x86_emulate_ctxt *ctxt)
return X86EMUL_CONTINUE;
}
-FASTOP1(not);
-FASTOP1(neg);
-FASTOP1(inc);
-FASTOP1(dec);
-
-FASTOP2CL(rol);
-FASTOP2CL(ror);
-FASTOP2CL(rcl);
-FASTOP2CL(rcr);
-FASTOP2CL(shl);
-FASTOP2CL(shr);
-FASTOP2CL(sar);
-
-FASTOP2W(bsf);
-FASTOP2W(bsr);
-FASTOP2W(bt);
-FASTOP2W(bts);
-FASTOP2W(btr);
-FASTOP2W(btc);
-
static int em_mul_ex(struct x86_emulate_ctxt *ctxt)
{
u8 ex = 0;
@@ -3040,21 +3055,6 @@ static int em_ret_near_imm(struct x86_emulate_ctxt *ctxt)
return X86EMUL_CONTINUE;
}
-FASTOP2(add);
-FASTOP2(or);
-FASTOP2(adc);
-FASTOP2(sbb);
-FASTOP2(and);
-FASTOP2(sub);
-FASTOP2(xor);
-FASTOP2(cmp);
-FASTOP2(test);
-
-FASTOP3WCL(shld);
-FASTOP3WCL(shrd);
-
-FASTOP2W(imul);
-
static int em_xchg(struct x86_emulate_ctxt *ctxt)
{
/* Write back the register source. */
--
1.8.0.2
next prev parent reply other threads:[~2013-01-19 17:52 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-19 17:51 [PATCH v2 0/8] More fastop patches Avi Kivity
2013-01-19 17:51 ` [PATCH v2 1/8] KVM: x86 emulator: Convert SHLD, SHRD to fastop Avi Kivity
2013-01-19 17:51 ` [PATCH v2 2/8] KVM: x86 emulator: convert shift/rotate instructions " Avi Kivity
2013-01-19 17:51 ` [PATCH v2 3/8] KVM: x86 emulator: covert SETCC " Avi Kivity
2013-01-19 17:51 ` [PATCH v2 4/8] KVM: x86 emulator: convert INC/DEC " Avi Kivity
2013-01-19 17:51 ` [PATCH v2 5/8] KVM: x86 emulator: convert BT/BTS/BTR/BTC/BSF/BSR " Avi Kivity
2013-01-19 17:51 ` [PATCH v2 6/8] KVM: x86 emulator: convert 2-operand IMUL " Avi Kivity
2013-01-19 17:51 ` Avi Kivity [this message]
2013-01-19 17:51 ` [PATCH v2 8/8] KVM: x86 emulator: convert a few freestanding emulations " Avi Kivity
2013-01-23 0:21 ` Marcelo Tosatti
2013-01-23 8:59 ` Avi Kivity
2013-01-20 10:56 ` [PATCH v2 0/8] More fastop patches Gleb Natapov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1358617917-2076-8-git-send-email-avi.kivity@gmail.com \
--to=avi.kivity@gmail.com \
--cc=gleb@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.