Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4744imm; Thu, 27 Sep 2018 14:52:14 -0700 (PDT) X-Google-Smtp-Source: ACcGV63Ep96oStBHdCNCsWxuNeg60QdA9qy+XduWOVhyFin6E6tq65jph9AxDQf7FmVVewJib0Vb X-Received: by 2002:a63:2b4d:: with SMTP id r74-v6mr12143907pgr.406.1538085134679; Thu, 27 Sep 2018 14:52:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538085134; cv=none; d=google.com; s=arc-20160816; b=KdGz0Ivz8vGnJjgA5Y1rnaUJVa06ZgLEeKCKa0QO0tbZJGBGZn1T8vwsPEUa1WMJOn AH9ZCg8Lzbml3Lzhnkcrm+0hhsMoPTxBJaeJy1neheoxVDXfHex4pKHdfUL13i/GgVP/ wKaBJsqvJdpe8PUSM05t6ugdWTDm7kTuQE/q3XU1Q6+bTvmNJP7aVKsu42ZTBOvy8ilT ++aFgdGPq9W+/wk07l1lq9tPmFC7j8teUn8VPOm8/zwEfswRLVaITvlh1eozlwyWLHMo pLAf/fKoVBx1FiI9cWLpVciE2TrcCgnJZ+LqV4CMHy2ZtEbG4Mf8zu3YaUA9YXBGS01R A0/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=3k6XLF6nwOrTQZRDSROVZyypPfCVYCYcXubq3o9wG7w=; b=bZ8qWeK1u+Bxju421F88hrsB5junHxSQ335QW7pa6PvP3vlJ5Hqy0EJv+fJWwlCwT6 NPjqXBvvOW3DkNes+GJghjaRMeNxQZZ/946PH6J8+BBOUBV9nAtGYNGNDG9Eu/kGKTeS mLRts4eUNhhcTk0WyD5iC6HknbfgglHTqQs+wx3XOh59TuljKsho7TLABfLbiJrlCYn8 m9wsTl5njU6+WDwVJvIBJc/mlfE2X6th4pTUyD0UYRPu0NO7riaF0Cs+SK3+6wb47yrW CFKLohF5+di7GbXWs+xbM2zVMZnwR64uG2fYcMN4HSPw7h+hm4gGN0UlABZsDjV9rFjg KCYg== 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 w124-v6si2933944pgw.55.2018.09.27.14.51.57; Thu, 27 Sep 2018 14:52:14 -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 S1726132AbeI1EMJ (ORCPT + 99 others); Fri, 28 Sep 2018 00:12:09 -0400 Received: from mail.skyhub.de ([5.9.137.197]:42222 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725972AbeI1EMJ (ORCPT ); Fri, 28 Sep 2018 00:12:09 -0400 X-Virus-Scanned: Nedap ESD1 at mail.skyhub.de Received: from mail.skyhub.de ([127.0.0.1]) by localhost (blast.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id PBGDfYIejeeS; Thu, 27 Sep 2018 23:51:45 +0200 (CEST) Received: from zn.tnic (p200300EC2BC7FB00329C23FFFEA6A903.dip0.t-ipconnect.de [IPv6:2003:ec:2bc7:fb00:329c:23ff:fea6:a903]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 9B24A1EC07DB; Thu, 27 Sep 2018 23:51:45 +0200 (CEST) Date: Thu, 27 Sep 2018 23:51:48 +0200 From: Borislav Petkov To: ndesaulniers@google.com Cc: mingo@redhat.com, tglx@linutronix.de, "H. Peter Anvin" , x86@kernel.org, "Kirill A. Shutemov" , Masahiro Yamada , Greg Kroah-Hartman , Matthias Kaehlcke , Kees Cook , Cao jin , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] x86/boot: define CC_HAVE_ASM_GOTO Message-ID: <20180927215148.GE19687@zn.tnic> References: <20180927204800.32210-1-ndesaulniers@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180927204800.32210-1-ndesaulniers@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 27, 2018 at 01:47:58PM -0700, ndesaulniers@google.com wrote: > Early prototypes of Clang with asm goto support produce 6 instances of > the following warning: > > In file included from arch/x86/boot/compressed/misc.h:20: > In file included from ./include/linux/elf.h:5: > In file included from ./arch/x86/include/asm/elf.h:8: > In file included from ./include/linux/thread_info.h:38: > In file included from ./arch/x86/include/asm/thread_info.h:53: > ./arch/x86/include/asm/cpufeature.h:150:2: warning: "Compiler lacks > ASM_GOTO support. Add -D __BPF_TRACING__ to your compiler arguments" > [-W#warnings] > your compiler arguments" > ^ > > Since 6 files under arch/x86/boot/compressed/ include > arch/x86/boot/compressed/misc.h AND > arch/x86/boot/compressed/Makefile happens to redefine KBUILD_CFLAGS, > which set these variables in the top level MAKEFILE. > > Suggested-by: Borislav Petkov > Signed-off-by: Nick Desaulniers > --- > v1 -> v2: > Updated commit message to provide more context as per Borislav. > > arch/x86/boot/compressed/Makefile | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile > index 28764dacf018..158c0b4e178a 100644 > --- a/arch/x86/boot/compressed/Makefile > +++ b/arch/x86/boot/compressed/Makefile > @@ -56,6 +56,13 @@ KBUILD_LDFLAGS += $(shell $(LD) --help 2>&1 | grep -q "\-z noreloc-overflow" \ > endif > LDFLAGS_vmlinux := -T > > +# check for 'asm goto' > +ifeq ($(shell $(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 I would still like to know why can't we do the -D_SETUP thing here: https://lkml.kernel.org/r/20180926090841.GC5745@zn.tnic instead of polluting this Makefile with defines which are not really needed in the compressed kernel build, except to silence build warnings. I mean, we can perpetuate that ugly hack and do: #define __BPF_TRACING__ here in arch/x86/boot/compressed/misc.h which we could kill once clang can do asm goto... Hmm. -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.