From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 101608 invoked by alias); 14 Jan 2018 12:42:47 -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 101591 invoked by uid 89); 14 Jan 2018 12:42:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-6.0 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,KAM_LAZY_DOMAIN_SECURITY,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=H*i:sk:Q-tac4p, H*f:sk:Q-tac4p X-HELO: atrey.karlin.mff.cuni.cz Received: from atrey.karlin.mff.cuni.cz (HELO atrey.karlin.mff.cuni.cz) (195.113.26.193) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 14 Jan 2018 12:42:43 +0000 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 4018) id 3A5DD8017D; Sun, 14 Jan 2018 13:42:41 +0100 (CET) Date: Sun, 14 Jan 2018 12:52:00 -0000 From: Jan Hubicka To: Uros Bizjak Cc: Jan Hubicka , "Kumar, Venkataramanan" , "H.J. Lu" , "gcc-patches@gcc.gnu.org" , "Dharmakan, Rohit arul raj" , "Nagarajan, Muthu kumar raj" Subject: Re: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre Message-ID: <20180114124240.GG14673@atrey.karlin.mff.cuni.cz> References: <20180114033707.6297-1-hjl.tools@gmail.com> <20180114104020.GB62416@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes X-SW-Source: 2018-01/txt/msg01230.txt.bz2 > On Sun, Jan 14, 2018 at 11:40 AM, Jan Hubicka wrote: > >> Hi HJ, > >> > >> > -----Original Message----- > >> > From: gcc-patches-owner@gcc.gnu.org [mailto:gcc-patches- > >> > owner@gcc.gnu.org] On Behalf Of H.J. Lu > >> > Sent: Sunday, January 14, 2018 9:07 AM > >> > To: gcc-patches@gcc.gnu.org > >> > Subject: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre > >> > > >> > This set of patches for GCC 8 mitigates variant #2 of the speculative > >> > execution vulnerabilities on x86 processors identified by CVE-2017-5715, aka > >> > Spectre. They convert indirect branches and function returns to call and > >> > return thunks to avoid speculative execution via indirect call, jmp and ret. > >> > > >> > H.J. Lu (5): > >> > x86: Add -mindirect-branch= > >> > x86: Add -mfunction-return= > >> > x86: Add -mindirect-branch-register > >> > x86: Add 'V' register operand modifier > >> > x86: Disallow -mindirect-branch=/-mfunction-return= with > >> > -mcmodel=large > >> > >> Current set of patches don't seem to have any option to generate "lfence" as the loop filler in "retpoline", which is required by AMD. > >> Can you please clarify the plan. We would like to get this checked-in GCC 8. > > > > Since thunks are output as strings, it is easy to add the option > > on the top of patch #1 of the series. I do not fully understand > > the reason for choosing pause over lfence for Intel, but if we need > > to do both, we need to have command line option (and possibly attribute). > > What would be reasonable name for it? > > Looking at the kernel patch [1], the loop filler should be > "pause;lfence" sequence, and should be universally accepted for Intel > and AMD targets. > > [1] https://www.spinics.net/lists/kernel/msg2697507.html Yep, I would say we should go with pause;lfence now and see if we want to add argument eventually. HJ, does it sound OK? Honza > > Uros.