From patchwork Sat Jun 18 04:03:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pranith Kumar X-Patchwork-Id: 9185403 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 610096075F for ; Sat, 18 Jun 2016 04:10:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 487A627BFF for ; Sat, 18 Jun 2016 04:10:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3D5462835B; Sat, 18 Jun 2016 04:10:19 +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 BF60127BFF for ; Sat, 18 Jun 2016 04:10:18 +0000 (UTC) Received: from localhost ([::1]:32982 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bE7aL-0008Ol-QV for patchwork-qemu-devel@patchwork.kernel.org; Sat, 18 Jun 2016 00:10:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46346) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bE7Vh-0003dw-S3 for qemu-devel@nongnu.org; Sat, 18 Jun 2016 00:05:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bE7Vg-0005LG-NF for qemu-devel@nongnu.org; Sat, 18 Jun 2016 00:05:29 -0400 Received: from mail-yw0-x241.google.com ([2607:f8b0:4002:c05::241]:33230) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bE7Vg-0005LB-IR for qemu-devel@nongnu.org; Sat, 18 Jun 2016 00:05:28 -0400 Received: by mail-yw0-x241.google.com with SMTP id d137so4907604ywe.0 for ; Fri, 17 Jun 2016 21:05:28 -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=ZSsj6nloBvnWyS1XRz7aZCIBtKn48k5HsWsyMwmJc0Y=; b=jAaLoMT1VXNHRIf2xa/O813wqEjOHA8PX8W86Ww3wYjf7HSS5ulCEf3W74UwvVqYnU VdKtyiYy/tPEA6ykqd59QOd143skbV3U15rVNHz+O6Wmc1dXWmihkCZ+dm5NHycQ2NSC UURNmsr8ILe/sOsGr3uocHFfZc2C7r+pRLfYTdyl5aepLY1U0XzYkWIgCrYD241NSt9z /k8WOrZF28hIIqKagOAkz1JUgciKVho9YjVl11ldJrB+9syA8jmwjgMU1q2/7ytyYLI7 iBW01LdChZwulbVlUTvjw4LDw4bBsYNDgbJbyQYeqSJ2wiKzYohTtrpJo38Jzy9r7X/m 26Iw== 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=ZSsj6nloBvnWyS1XRz7aZCIBtKn48k5HsWsyMwmJc0Y=; b=UPuOEXNs2lrC4Y3IgGNxyWMNL9Q5vLLb7ZpUvY546n3hGwv9jrb7DHBriFD4Ia+xBy jip/ukQxFwI79H1hiCzRvNVF+U8jBaHjn9LDCjqX9C/Gq3d114EAE5yLMbZoTVe0EQiC H9s4eoJBAZObZo5ptiskVzZ4BAT9cuZXJ3OzG1gSxVMr61FEl3+qLaX/sWxZP54f4tqo 4NAKvAGiTB+8CEtdTPcMYD8efY8QsBhRD/RYIaqCPPxRf3WGsEowfOIsXrZP/rvLnAfk IkbVuI7q/MUsxuo+BUGfiheANSG29aMiC0riIposLeGr8j5j+Ht0+GCYE8VwLfvqCazr Sq3w== X-Gm-Message-State: ALyK8tIhQjPx8zTtS99eIFfstFL4C18UN07oqRUgVL3fWVaSppPikFvT8+zPjRgKwVelcg== X-Received: by 10.129.77.5 with SMTP id a5mr3047413ywb.217.1466222728292; Fri, 17 Jun 2016 21:05:28 -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.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Jun 2016 21:05:27 -0700 (PDT) From: Pranith Kumar To: Alexander Graf , Richard Henderson , qemu-devel@nongnu.org (open list:All patches CC here) Date: Sat, 18 Jun 2016 00:03:37 -0400 Message-Id: <20160618040343.19517-9-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::241 Subject: [Qemu-devel] [RFC v3 PATCH 08/14] tcg/s390: 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 Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Cc: Alexander Graf Signed-off-by: Richard Henderson Signed-off-by: Pranith Kumar --- tcg/s390/tcg-target.inc.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tcg/s390/tcg-target.inc.c b/tcg/s390/tcg-target.inc.c index e0a60e6..b83b65b 100644 --- a/tcg/s390/tcg-target.inc.c +++ b/tcg/s390/tcg-target.inc.c @@ -343,6 +343,7 @@ static tcg_insn_unit *tb_ret_addr; #define FACILITY_EXT_IMM (1ULL << (63 - 21)) #define FACILITY_GEN_INST_EXT (1ULL << (63 - 34)) #define FACILITY_LOAD_ON_COND (1ULL << (63 - 45)) +#define FACILITY_FAST_BCR_SER FACILITY_LOAD_ON_COND static uint64_t facilities; @@ -2165,6 +2166,13 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode opc, tgen_deposit(s, args[0], args[2], args[3], args[4]); break; + case INDEX_op_mb: + /* The host memory model is quite strong, we simply need to + serialize the instruction stream. */ + tcg_out_insn(s, RR, BCR, + facilities & FACILITY_FAST_BCR_SER ? 14 : 15, 0); + break; + case INDEX_op_mov_i32: /* Always emitted via tcg_out_mov. */ case INDEX_op_mov_i64: case INDEX_op_movi_i32: /* Always emitted via tcg_out_movi. */ @@ -2286,6 +2294,7 @@ static const TCGTargetOpDef s390_op_defs[] = { { INDEX_op_movcond_i64, { "r", "r", "rC", "r", "0" } }, { INDEX_op_deposit_i64, { "r", "0", "r" } }, + { INDEX_op_mb, { } }, { -1 }, };