From patchwork Sat Jan 19 17:51:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 2007131 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id C3D103FE1F for ; Sat, 19 Jan 2013 17:52:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752177Ab3ASRwR (ORCPT ); Sat, 19 Jan 2013 12:52:17 -0500 Received: from mail-wi0-f178.google.com ([209.85.212.178]:56764 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752164Ab3ASRwP (ORCPT ); Sat, 19 Jan 2013 12:52:15 -0500 Received: by mail-wi0-f178.google.com with SMTP id hn3so3851891wib.11 for ; Sat, 19 Jan 2013 09:52:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=ChTzubcjg2FETgx97uIHJeVvEJbHvhTmMtandJ5A9XE=; b=m6KBf9EXESvl/Rr/63Vn2g9rL+LMt1Br6/VaiDh+u6asC0FXEUJaax+f6uZXnXc2r3 NwcPPoulqmq2/5jIJ3VQfFrQbCVtxkL4ZmJehufj/jztLztWFMUMeiIPJtBBGL/X45Yv xJkYYPwDwLVTZMA6S0YnEL53Ca+OtVVGk/NHI2dIq2F2DSBNUuulAwbS9fvxjyHK46oN XxbltFKQhhpsBlPxNP7V/wSco4nAtNGqoaXkbL5eTQiy0n6rnMyamghXijLNGOKaqUhp dkIqUB/Z88XTF7HR//CsgKeA4IK/FzoqYn+ksd2Lo4VSZm9G37y67eiRPK1upOdSH127 5zMA== X-Received: by 10.180.99.72 with SMTP id eo8mr8724236wib.34.1358617934527; Sat, 19 Jan 2013 09:52:14 -0800 (PST) Received: from localhost.localdomain (109-186-95-4.bb.netvision.net.il. [109.186.95.4]) by mx.google.com with ESMTPS id s16sm12871677wii.0.2013.01.19.09.52.13 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 19 Jan 2013 09:52:14 -0800 (PST) From: Avi Kivity To: Gleb Natapov , Marcelo Tosatti 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 Message-Id: <1358617917-2076-8-git-send-email-avi.kivity@gmail.com> X-Mailer: git-send-email 1.8.0.2 In-Reply-To: <1358617917-2076-1-git-send-email-avi.kivity@gmail.com> References: <1358617917-2076-1-git-send-email-avi.kivity@gmail.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Make fastop opcodes usable in other emulations. Signed-off-by: Avi Kivity --- 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. */