From patchwork Sat Jun 18 04:03:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pranith Kumar X-Patchwork-Id: 9185417 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 4871E6075F for ; Sat, 18 Jun 2016 04:19:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2B3BE2656B for ; Sat, 18 Jun 2016 04:19:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1B7D82835B; Sat, 18 Jun 2016 04:19:34 +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 B69352656B for ; Sat, 18 Jun 2016 04:19:33 +0000 (UTC) Received: from localhost ([::1]:33035 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bE7jI-0001ev-Ts for patchwork-qemu-devel@patchwork.kernel.org; Sat, 18 Jun 2016 00:19:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46481) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bE7Vv-0003rV-8V for qemu-devel@nongnu.org; Sat, 18 Jun 2016 00:05:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bE7Vm-0005NC-46 for qemu-devel@nongnu.org; Sat, 18 Jun 2016 00:05:43 -0400 Received: from mail-yw0-x243.google.com ([2607:f8b0:4002:c05::243]:34430) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bE7Vl-0005N6-MW for qemu-devel@nongnu.org; Sat, 18 Jun 2016 00:05:33 -0400 Received: by mail-yw0-x243.google.com with SMTP id b75so10800182ywe.1 for ; Fri, 17 Jun 2016 21:05:33 -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=+rt8jJV0BH7j8J8j/tPNbSJGN44z2hJYfvJX8uSORZA=; b=1D1JtOFeW01dETpC6TYibi5zNellLX5GftANpZcttIeg19f9+ZkZ67ZW54eHjDj2yo IOJFPARdhriSPUQnF4Alx8hFPtMczOHSrA3gFmPstntCvb4FwEvTn6Pvc/LkGTbGh4T5 jgNfobQaOHhMyWtx87N4MZcG6xZfitXkHBn1heH0KAmpZOxFgcgPBPoJe0JRo7A7QWz5 seoGnLo9YIYa+nqkuXmpUBAHaHDgymao06LMLdnVPqN97lp//CrMPD4wKJNSePs7Ni3/ tioJIFqf4P/YNpEpwZKVOzUrBzyT953jJI+ZBFA5eyrIwxRZmEc4mvn5gpWcHUeGyuW/ s0eQ== 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=+rt8jJV0BH7j8J8j/tPNbSJGN44z2hJYfvJX8uSORZA=; b=EBZ3WUedHynXUoKUzPaVL8fJJH1VcLnNZ6hmzqNCIhZKyMTouOPs56VDUbOcheM+NL hHgBxy5HL5O4mxPy6BpC0mMX7jhi4e0+TC06xIknAsvP7TKR5ZkpkSqK1fSzCZonL694 IzSPydle7N+NXK1acse0iEzD0yEvz+ed6VH5JH4Cp3V57cCx8vbMD8OqTXnOlBPH27h1 I499FUg63hSgtW/P9x9glFwp57tExVXI7fDHxnuMwIsYASw4t0GorqBL/kWWaVzj5kt3 ++vB5LoZMhtfl7YXD2X3Xm+kDuZBuxmmG3X1EtRte7K1ytorfcManX8onELfad5/SCdS Li9w== X-Gm-Message-State: ALyK8tI73X4iUVAmKACf0+ji97k2Yw5r7OBeY108eCVdIEB+gKcuTIKpG1YbRYVvnDUl0Q== X-Received: by 10.37.87.11 with SMTP id l11mr2996411ybb.31.1466222733445; Fri, 17 Jun 2016 21:05:33 -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.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Jun 2016 21:05:33 -0700 (PDT) From: Pranith Kumar To: Paolo Bonzini , Richard Henderson , Eduardo Habkost , qemu-devel@nongnu.org (open list:All patches CC here) Date: Sat, 18 Jun 2016 00:03:43 -0400 Message-Id: <20160618040343.19517-15-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 14/14] target-i386: Generate fences for x86 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 Signed-off-by: Pranith Kumar --- target-i386/translate.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target-i386/translate.c b/target-i386/translate.c index bf33e6b..32b0f5c 100644 --- a/target-i386/translate.c +++ b/target-i386/translate.c @@ -8012,13 +8012,17 @@ static target_ulong disas_insn(CPUX86State *env, DisasContext *s, || (prefixes & PREFIX_LOCK)) { goto illegal_op; } + tcg_gen_mb(TCG_MO_ST_ST | TCG_BAR_SC); break; case 0xe8 ... 0xef: /* lfence */ + tcg_gen_mb(TCG_MO_LD_LD | TCG_BAR_SC); + break; case 0xf0 ... 0xf7: /* mfence */ if (!(s->cpuid_features & CPUID_SSE2) || (prefixes & PREFIX_LOCK)) { goto illegal_op; } + tcg_gen_mb(TCG_MO_ALL | TCG_BAR_SC); break; default: