From patchwork Sat Dec 22 12:26:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 1905711 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 77CA7DFB79 for ; Sat, 22 Dec 2012 12:35:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751363Ab2LVMfL (ORCPT ); Sat, 22 Dec 2012 07:35:11 -0500 Received: from mail-wi0-f172.google.com ([209.85.212.172]:35298 "EHLO mail-wi0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751059Ab2LVMfK (ORCPT ); Sat, 22 Dec 2012 07:35:10 -0500 Received: by mail-wi0-f172.google.com with SMTP id o1so5573732wic.17 for ; Sat, 22 Dec 2012 04:35:09 -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=nVn9/oTULiEGLhgtpkTvBW4/Hi7hFmgb1QzbdeHxK5E=; b=lMr6HdmVihvaHB/ULyOzLqGaVheuo/JF7f3Kmd/B4Gcaply8clo/rlr5K9i/0Xb+Uc AMUbwxGDimP0TFQCEiZEGFz0/qDFCwlek/OYDcXvIugpOa2nfDNAstjt9RWWKPl3Kn1T zdVgwonq5yJns5R24vHaGaDIc5fuZ0wdnHwWFVDoGMMPlOwnwX8WmqlER06k+Y910fOB SjDiqEk33DsxvnQzn3K4Wj0rLka736kCISwH6DRYphYpFo7KObcCEQP4jfkV/Z2pZBex gJxUVSb5hPMjo9MI4z0DbAJ/jin1cVrdf6JkBXgIMNLnjkIyEkqL16qVL9wDk9rBB28C jGSg== X-Received: by 10.180.107.129 with SMTP id hc1mr20380031wib.34.1356179233428; Sat, 22 Dec 2012 04:27:13 -0800 (PST) Received: from localhost.localdomain (93-172-35-137.bb.netvision.net.il. [93.172.35.137]) by mx.google.com with ESMTPS id bd7sm22998357wib.8.2012.12.22.04.27.11 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 22 Dec 2012 04:27:12 -0800 (PST) From: Avi Kivity To: Marcelo Tosatti , Gleb Natapov Cc: kvm@vger.kernel.org Subject: [PATCH 6/7] KVM: x86 emulator: add macros for defining 2-operand fastop emulation Date: Sat, 22 Dec 2012 14:26:56 +0200 Message-Id: <1356179217-5526-7-git-send-email-avi.kivity@gmail.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1356179217-5526-1-git-send-email-avi.kivity@gmail.com> References: <1356179217-5526-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 Signed-off-by: Avi Kivity --- arch/x86/kvm/emulate.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 88579fa..8f650d7 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -458,6 +458,17 @@ static void invalidate_registers(struct x86_emulate_ctxt *ctxt) ON64(FOP1E(op##q, rax)) \ FOP_END +#define FOP2E(op, dst, src) \ + FOP_ALIGN #op " %" #dst ", %" #src " \n\t" FOP_RET + +#define FASTOP2(op) \ + FOP_START(op) \ + FOP2E(op##b, al, bl) \ + FOP2E(op##w, ax, bx) \ + FOP2E(op##l, eax, ebx) \ + ON64(FOP2E(op##q, rax, rbx)) \ + FOP_END + #define __emulate_1op_rax_rdx(ctxt, _op, _suffix, _ex) \ do { \ unsigned long _tmp; \ @@ -3646,6 +3657,7 @@ static int check_perm_out(struct x86_emulate_ctxt *ctxt) #define D2bv(_f) D((_f) | ByteOp), D(_f) #define D2bvIP(_f, _i, _p) DIP((_f) | ByteOp, _i, _p), DIP(_f, _i, _p) #define I2bv(_f, _e) I((_f) | ByteOp, _e), I(_f, _e) +#define F2bv(_f, _e) F((_f) | ByteOp, _e), F(_f, _e) #define I2bvIP(_f, _e, _i, _p) \ IIP((_f) | ByteOp, _e, _i, _p), IIP(_f, _e, _i, _p)