From patchwork Fri May 27 01:00:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 9137533 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 8560E6075A for ; Fri, 27 May 2016 01:06:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7814B2807E for ; Fri, 27 May 2016 01:06:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6C345282E2; Fri, 27 May 2016 01:06:01 +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_SIGNED, 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 69BBB2807E for ; Fri, 27 May 2016 01:06:00 +0000 (UTC) Received: from localhost ([::1]:41175 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b66Dv-0004FS-Hd for patchwork-qemu-devel@patchwork.kernel.org; Thu, 26 May 2016 21:05:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40558) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6699-00009j-CQ for qemu-devel@nongnu.org; Thu, 26 May 2016 21:01:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b6698-0004Cj-Dt for qemu-devel@nongnu.org; Thu, 26 May 2016 21:01:03 -0400 Received: from mail-qk0-x241.google.com ([2607:f8b0:400d:c09::241]:33802) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6698-0004Ce-9t for qemu-devel@nongnu.org; Thu, 26 May 2016 21:01:02 -0400 Received: by mail-qk0-x241.google.com with SMTP id i7so3841361qkd.1 for ; Thu, 26 May 2016 18:01:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=bNnExyDJ8HysqlOJqUSzAQbXJKbd7jPS+MTZZZkeerE=; b=UmcUP1lqYHL0OiVZPZUbqIcR/XKCAGGJMP9OEzSR9xVd1mrtw2M5P8m65Ssrk9eKK7 2BnkJi01Z76tHT3sck363vqo8/1DCZaKo6/FLKQ6fv5mdZAtSMf2J9sIQBwt8lnGgoMA ED4C9LjdWU/YN+IS1ygx64xYZuRBx1DWsyBigY4hcLVqW3XYjn2hd+YIAz6C7xG/Lgnp T7DMhrfZrL9rhZOUcYIpnTKQWYZsrNCroUuaRfrmZHWkLt2ugeqiUXZYPfJlBsD0k9dv Dk4qujTsV38mNWC78+97nDh9xJQr8GGcn+ndn9Iud7e3NlHWMQAwaKQ7Ezl8auAT9Mvt VI6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=bNnExyDJ8HysqlOJqUSzAQbXJKbd7jPS+MTZZZkeerE=; b=kphCNoC8/Rp+bZUcGM5n2B4O6QMcK4rfSRxvryDRR8iDmKbiWveqThxRiomcDBUUA8 rizLWaRe5NNYhyRRPLKdgKfwuwwXG3/ZztCmcnQ/dxuS1Pc6y3y1/CuiGZzAs/DcG1cF qhHajKYGcaj9tcrO/kQXB8iA5HUGMYloJcRQQE2kVTx0MbYRout50PlzbihfpQtMN0NG lNd1K8MLzI4gZvyd4RVHJfimHRz5yNq46FLX4gTvRwzuX+bsvUlFUjZRQHW4uYqtrsXY omWqU2PciWAHulyVWXNL6d2wLr4jOs+bXpQ4lN1r458NZSpRiHH7pVr0kH3Xp5LtzZnM xCBA== X-Gm-Message-State: ALyK8tL9+wP1w7q+vYwuTGBfA8lVBGkTAA4VRF9c+3fMLvhjFxR/pIdKP15oxSyRwajCCA== X-Received: by 10.55.8.12 with SMTP id 12mr11275702qki.200.1464310861863; Thu, 26 May 2016 18:01:01 -0700 (PDT) Received: from bigtime.com ([172.56.17.0]) by smtp.gmail.com with ESMTPSA id 77sm1872030qgn.29.2016.05.26.18.01.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 May 2016 18:01:01 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 26 May 2016 18:00:11 -0700 Message-Id: <1464310815-13554-9-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1464310815-13554-1-git-send-email-rth@twiddle.net> References: <1464310815-13554-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400d:c09::241 Subject: [Qemu-devel] [PATCH v2 08/12] 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: bobby.prani@gmail.com, Alexander Graf 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 --- 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..4c63621 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_fence: + /* 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_fence, { } }, { -1 }, };