From patchwork Sat Jun 18 04:03:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pranith Kumar X-Patchwork-Id: 9185405 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C9A066075F for ; Sat, 18 Jun 2016 04:10:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B12DC27BFF for ; Sat, 18 Jun 2016 04:10:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A60222835B; Sat, 18 Jun 2016 04:10:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 27B3D27BFF for ; Sat, 18 Jun 2016 04:10:22 +0000 (UTC) Received: from localhost ([::1]:32983 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bE7aP-0008QM-AC for patchwork-qemu-devel@patchwork.kernel.org; Sat, 18 Jun 2016 00:10:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46419) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bE7Vn-0003ij-FX for qemu-devel@nongnu.org; Sat, 18 Jun 2016 00:05:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bE7Vj-0005MM-7T for qemu-devel@nongnu.org; Sat, 18 Jun 2016 00:05:34 -0400 Received: from mail-yw0-x243.google.com ([2607:f8b0:4002:c05::243]:34425) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bE7Vc-0005KH-ST; Sat, 18 Jun 2016 00:05:24 -0400 Received: by mail-yw0-x243.google.com with SMTP id b75so10799967ywe.1; Fri, 17 Jun 2016 21:05:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=pGBf5ilaOqbnU+GkG36mCjT8l5OD1mhtVmp+d4Se7J0=; b=wK9HLs1I7U5V64/iHwQhUK/Tzgqx3M8dub7aMhvKGMJbcTx6nJG9Z36sof2E3XbwEc Ck/R4ZdqGMUep50qPH8fiNAosoumMJ14kgME4KoCk8M3Tz1MewkGfgWbPX4wRrkh5tJb Tw9e/ycc6G352Vk4qL/AWlmyqg3qDpcPxyizeZ0bOEj1BKJKtM3u6koKtMom2R3Y+puj 1cMcOPe7vyBfxGw4URnhRgcBaf8HyS3QjBUc1cYg1vVZSmLWGJC9mhuw1gXty97I9WAU IXKty2QjyA5IyQ477byoZROKpa88V1D4kcdvsvQdFRJW0KPkaZSQEA0Fpd/CxLlexazZ 0wtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=pGBf5ilaOqbnU+GkG36mCjT8l5OD1mhtVmp+d4Se7J0=; b=RxRUQe6ZCThWJz0i3O3PhBv5A/aYLVMFi4ef+sAGbPxNhaUiiae2Uns799h4H02/qp Fbl9paqZ6poEDPEuw75X/y0/JbQQvAIzZwxuLAnyKC8aB0duBdbKKIVFZuMhluODmr0g H4OQCxu2u9/OvzKHKhwlBTry7sEHZ/kvUvLrJ7KVIpznWQUv0OkYf+shS1kz3sabBrQa +CK/ZOeJEPU2oGZOb+FiZberR8yyORhH/dBvz6S8jBQKtBwKIbMNi0DZlT3AHFpSdTIa vMYUNvM2DkiLqJr+r7V25Pe7y/vNUCos3xOCg3dfsEu6zUrkQV40l0cFXftBuYB3G/n7 qi1Q== X-Gm-Message-State: ALyK8tI2xZXh0sxstdtMhLdZpaDtTQGfE70dkrFHTzRmXuyqdZ23L27txdmDxAkI/Rtk7g== X-Received: by 10.129.71.3 with SMTP id u3mr3350017ywa.143.1466222724580; Fri, 17 Jun 2016 21:05:24 -0700 (PDT) Received: from evgadesktop.attlocal.net (108-232-152-155.lightspeed.tukrga.sbcglobal.net. [108.232.152.155]) by smtp.gmail.com with ESMTPSA id q7sm19517992ywg.16.2016.06.17.21.05.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Jun 2016 21:05:24 -0700 (PDT) From: Pranith Kumar To: Andrzej Zaborowski , Richard Henderson , qemu-arm@nongnu.org (open list:ARM target), qemu-devel@nongnu.org (open list:All patches CC here) Date: Sat, 18 Jun 2016 00:03:33 -0400 Message-Id: <20160618040343.19517-5-bobby.prani@gmail.com> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160618040343.19517-1-bobby.prani@gmail.com> References: <20160618040343.19517-1-bobby.prani@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4002:c05::243 Subject: [Qemu-devel] [RFC v3 PATCH 04/14] tcg/arm: Add support for fence X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: serge.fdrv@gmail.com, alex.bennee@linaro.org, Peter Maydell Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Cc: Andrzej Zaborowski Cc: Peter Maydell Signed-off-by: Pranith Kumar Signed-off-by: Richard Henderson --- tcg/arm/tcg-target.inc.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tcg/arm/tcg-target.inc.c b/tcg/arm/tcg-target.inc.c index f9f54c6..1447aa8 100644 --- a/tcg/arm/tcg-target.inc.c +++ b/tcg/arm/tcg-target.inc.c @@ -313,6 +313,10 @@ typedef enum { INSN_LDRD_REG = 0x000000d0, INSN_STRD_IMM = 0x004000f0, INSN_STRD_REG = 0x000000f0, + + INSN_DMB_ISH = 0x5bf07ff5, + INSN_DMB_MCR = 0xba0f07ee, + } ARMInsn; #define SHIFT_IMM_LSL(im) (((im) << 7) | 0x00) @@ -1066,6 +1070,15 @@ static inline void tcg_out_goto_label(TCGContext *s, int cond, TCGLabel *l) } } +static inline void tcg_out_mb(TCGContext *s, TCGArg a0) +{ + if (use_armv7_instructions) { + tcg_out32(s, INSN_DMB_ISH); + } else if (use_armv6_instructions) { + tcg_out32(s, INSN_DMB_MCR); + } +} + #ifdef CONFIG_SOFTMMU /* helper signature: helper_ret_ld_mmu(CPUState *env, target_ulong addr, * int mmu_idx, uintptr_t ra) @@ -1923,6 +1936,10 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode opc, tcg_out_udiv(s, COND_AL, args[0], args[1], args[2]); break; + case INDEX_op_mb: + tcg_out_mb(s, args[0]); + break; + case INDEX_op_mov_i32: /* Always emitted via tcg_out_mov. */ case INDEX_op_movi_i32: /* Always emitted via tcg_out_movi. */ case INDEX_op_call: /* Always emitted via tcg_out_call. */ @@ -1997,6 +2014,7 @@ static const TCGTargetOpDef arm_op_defs[] = { { INDEX_op_div_i32, { "r", "r", "r" } }, { INDEX_op_divu_i32, { "r", "r", "r" } }, + { INDEX_op_mb, { } }, { -1 }, };