Received: by 10.213.65.68 with SMTP id h4csp266159imn; Tue, 20 Mar 2018 03:02:36 -0700 (PDT) X-Google-Smtp-Source: AG47ELsxdjlaAw0hOJN4oJXTUu0btzOlfqIskIxXiXLg50831erNIpEsnJd83CyqtphJKnRquLmL X-Received: by 10.167.128.2 with SMTP id j2mr13191454pfi.179.1521540156464; Tue, 20 Mar 2018 03:02:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521540156; cv=none; d=google.com; s=arc-20160816; b=qwkcwkmOoaUYPHtH+6OuJff7fx1S5pG+NIdzi3mfH5UaU8yRUGVyLXZV/8esxGc8DZ FitbgKhcos6udBPB2ihL6rqvJUPqTiqcgCbQZa6BnOfSUfhNrE55mKKv9gFw1WMvyAG7 V9CxyDrDK0jFxiOololPWyS8NWPamhZ2Ela6Wl5FT72GyVhI65aJ9pGt9A1/JueLXF3F RVvLkGWHI2eRon0vLc1h1dxWwQ50Y4dROmMiyT39nFA8502ifKqGFGQ9mne/LLitRuWF BfGn6MDxIs/Zt76eaEU6QsVm+25ZME0JQO+twqRxnh85YS0ezVFmehx/yJ2pdzr3Pphk oABA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=nWTcpeC8tpBHBRK17Q9etA7s66/tx5M8YCbrdTSjTyw=; b=jk78tksFFd3lgaH2fp6pLmzFcd6ehjaYvWYR3StmrmQarTb3CKzEwQeidn5RfrVix2 yuGO61Kj60vCALs9k9GzxXDpQBqmY3KhmDj1xb8IsfddjqRH9e2yFFhNOSPxzpqZYWqt Ctr2AHbOAjoVa17dKCWayO8SPqXbotfNrImL90aZ0+OghUwXzHDuH/AoVSmZR4ZvS2vC qKvmLqQanS/me3zYC9D6H71X3D757mw08DslHl12w/LTP/ocmEdWASGQ1uga2tzEjR4A fnkuxOR+PYtPowPmg6NTlQXkKNVupKiBQ+G8hnyKT0G4PJbZreZXlvw6LQZjet+f+mQ4 pXhA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 15-v6si1168071pla.342.2018.03.20.03.02.22; Tue, 20 Mar 2018 03:02:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752560AbeCTKBT (ORCPT + 99 others); Tue, 20 Mar 2018 06:01:19 -0400 Received: from terminus.zytor.com ([198.137.202.136]:58127 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752270AbeCTKBQ (ORCPT ); Tue, 20 Mar 2018 06:01:16 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTP id w2KA0mAF021660; Tue, 20 Mar 2018 03:00:48 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w2KA0lAS021656; Tue, 20 Mar 2018 03:00:47 -0700 Date: Tue, 20 Mar 2018 03:00:47 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Peter Zijlstra Message-ID: Cc: hpa@zytor.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, peterz@infradead.org, mingo@kernel.org Reply-To: mingo@kernel.org, tglx@linutronix.de, peterz@infradead.org, linux-kernel@vger.kernel.org, hpa@zytor.com In-Reply-To: <20180319201327.GJ4043@hirez.programming.kicks-ass.net> References: <20180319201327.GJ4043@hirez.programming.kicks-ass.net> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/build] x86: Force asm-goto Git-Commit-ID: e501ce957a786ecd076ea0cfb10b114e6e4d0f40 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: e501ce957a786ecd076ea0cfb10b114e6e4d0f40 Gitweb: https://git.kernel.org/tip/e501ce957a786ecd076ea0cfb10b114e6e4d0f40 Author: Peter Zijlstra AuthorDate: Wed, 17 Jan 2018 11:42:07 +0100 Committer: Thomas Gleixner CommitDate: Tue, 20 Mar 2018 10:58:02 +0100 x86: Force asm-goto We want to start using asm-goto to guarantee the absence of dynamic branches (and thus speculation). A primary prerequisite for this is of course that the compiler supports asm-goto. This effecively lifts the minimum GCC version to build an x86 kernel to gcc-4.5. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Cc: torvalds@linux-foundation.org Link: https://lkml.kernel.org/r/20180319201327.GJ4043@hirez.programming.kicks-ass.net --- Makefile | 13 +++++++------ arch/x86/Makefile | 4 ++++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index d65e2e229017..6fb6fd28a124 100644 --- a/Makefile +++ b/Makefile @@ -494,6 +494,13 @@ RETPOLINE_CFLAGS_CLANG := -mretpoline-external-thunk RETPOLINE_CFLAGS := $(call cc-option,$(RETPOLINE_CFLAGS_GCC),$(call cc-option,$(RETPOLINE_CFLAGS_CLANG))) export RETPOLINE_CFLAGS +# check for 'asm goto' +ifeq ($(call shell-cached,$(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC) $(KBUILD_CFLAGS)), y) + CC_HAVE_ASM_GOTO := 1 + KBUILD_CFLAGS += -DCC_HAVE_ASM_GOTO + KBUILD_AFLAGS += -DCC_HAVE_ASM_GOTO +endif + ifeq ($(config-targets),1) # =========================================================================== # *config targets only - make sure prerequisites are updated, and descend @@ -658,12 +665,6 @@ KBUILD_CFLAGS += $(call cc-ifversion, -lt, 0409, \ # Tell gcc to never replace conditional load with a non-conditional one KBUILD_CFLAGS += $(call cc-option,--param=allow-store-data-races=0) -# check for 'asm goto' -ifeq ($(call shell-cached,$(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC) $(KBUILD_CFLAGS)), y) - KBUILD_CFLAGS += -DCC_HAVE_ASM_GOTO - KBUILD_AFLAGS += -DCC_HAVE_ASM_GOTO -endif - include scripts/Makefile.kcov include scripts/Makefile.gcc-plugins diff --git a/arch/x86/Makefile b/arch/x86/Makefile index 498c1b812300..d798e36d103c 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile @@ -181,6 +181,10 @@ ifdef CONFIG_FUNCTION_GRAPH_TRACER endif endif +ifndef CC_HAVE_ASM_GOTO + $(error Compiler lacks asm-goto support.) +endif + # # Jump labels need '-maccumulate-outgoing-args' for gcc < 4.5.2 to prevent a # GCC bug (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46226). There's no way