From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 40111 invoked by alias); 28 Jul 2018 08:25:54 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 39935 invoked by uid 89); 28 Jul 2018 08:25:36 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:808, sk:unspecv, sk:UNSPECV X-HELO: mail-io0-f193.google.com Received: from mail-io0-f193.google.com (HELO mail-io0-f193.google.com) (209.85.223.193) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 28 Jul 2018 08:25:34 +0000 Received: by mail-io0-f193.google.com with SMTP id l7-v6so6035373ioj.1 for ; Sat, 28 Jul 2018 01:25:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=ik+fvSoUGTVcV8KwkHC0UqdeY8ABiHRZRtsSFSReJoE=; b=ngNRbOhfQrmFWRIvr8qf80vXbAyLxZpVFRcKpHJAEHEav2HX3q6J1MDmCxVgTTxZ8Q hPR4Nk920Kdto5+o+b0+7M9htiHxwV687mo7nyw4YvBQbUzLC3OZ+yvFBlNgzguAWout eR8tEE06F0EGDzeWuF1u8eoaZpSYpPLJj/oSsIkuP6PIBeXiQpczaCooamNMz5HrzN/R WyBkfBr2PCzHU1YeTxY+YDNZuUcnjEQScToKOl3eZAt8U9nLCJ5lamaie0u5Pr+YeT82 gdB5aHuajXFjLnKs/+gaGMbYVUHtkD429fH2g/iu9DrLwCXOAz9s5ZH8GFVmerhweRIp DpZQ== MIME-Version: 1.0 Received: by 2002:a02:9a06:0:0:0:0:0 with HTTP; Sat, 28 Jul 2018 01:25:25 -0700 (PDT) In-Reply-To: <1532684275-13041-11-git-send-email-Richard.Earnshaw@arm.com> References: <1531154299-28349-1-git-send-email-Richard.Earnshaw@arm.com> <1532684275-13041-1-git-send-email-Richard.Earnshaw@arm.com> <1532684275-13041-11-git-send-email-Richard.Earnshaw@arm.com> From: Uros Bizjak Date: Sat, 28 Jul 2018 08:25:00 -0000 Message-ID: Subject: Re: [PATCH 10/11] x86 - add speculation_barrier pattern To: Richard Earnshaw Cc: "gcc-patches@gcc.gnu.org" , Jan Hubicka , "H. J. Lu" Content-Type: text/plain; charset="UTF-8" X-SW-Source: 2018-07/txt/msg01775.txt.bz2 On Fri, Jul 27, 2018 at 11:37 AM, Richard Earnshaw wrote: > > This patch adds a speculation barrier for x86, based on my > understanding of the required mitigation for that CPU, which is to use > an lfence instruction. > > This patch needs some review by an x86 expert and if adjustments are > needed, I'd appreciate it if they could be picked up by the port > maintainer. This is supposed to serve as an example of how to deploy > the new __builtin_speculation_safe_value() intrinsic on this > architecture. > > * config/i386/i386.md (unspecv): Add UNSPECV_SPECULATION_BARRIER. > (speculation_barrier): New insn. The implementation is OK, but someone from Intel (CC'd) should clarify if lfence is the correct insn. Uros.