Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp328658imm; Mon, 1 Oct 2018 10:32:52 -0700 (PDT) X-Google-Smtp-Source: ACcGV60OpJRPlqNjNqrzv7RN6nyjQiVfuwolIMwjhfVqT10FOPFsmTuE4h/6j6V/2WdHKhOMcGky X-Received: by 2002:a63:7506:: with SMTP id q6-v6mr10956504pgc.137.1538415172915; Mon, 01 Oct 2018 10:32:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538415172; cv=none; d=google.com; s=arc-20160816; b=f8289F5lSGSnCvqD2vK7i3S92yStCwDLCxQ4T+WfUko2FDumxgkPxYQzSNHrOJ2YeR dbsKNN4sI1e/qEOYmhGLersQA1bwS8wkfgOvKI6R4TRFkTxxcLdqMRtAPHHQE4r8c6eq gqHUskUwpTqo9+g3FLEXB8w2gc898LQeDx5Qo1NXiMJE3yobHu6O+iw5BixhQbjLXCzd qbr3+jkEwKeOsYztCsURteakBC41mkfzSpRtVuJ/IxBqzjZ8Qksz+PA/hbHU03iqev0B oiBiij21x9XFgY7zLqD8JEWrfmd1lJTfk2MY2H6/CZl0Jk8rDhRk3ApiEFnN61Cbl5fu /41A== 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=0KKLB/k9y3oxmXXZ9kOTEFvyYKDHuAA9AWnDqiuqyFo=; b=s9TlQCJRbj9T4FTRQdU+3wA8HVn+0k/YxkONeJ6U4ESPtrhsySppSaPBK4SOgZcBgi Ck0FP7sQn2K7g4cUBN1MVNTwBrYSNn3LVS4+/G1Su1S5RGLWMBTwU8+JSBhcBZwKikCm Fg7DYV6fqMQ5pcwLsHnLeT3MFn39nSo8PI7VB69HA4WeBqT3msQn6aPCnkCnD11563a3 akav4WZITRKd/T+aJ4h/U2dhTFE1Qn7/f2/nmcy35xb7n/aaW/Txd6KWn2yvCv6qS0aK fLkfpFi6kZ3UuP43iG8t1FYrbAwVFWr7DqQ71bFhqvurgDoqsXTg9YuwM8vWUAtgbaz9 Vz0A== 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 d186-v6si13346719pfg.23.2018.10.01.10.32.33; Mon, 01 Oct 2018 10:32:52 -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 S1726184AbeJBALR (ORCPT + 99 others); Mon, 1 Oct 2018 20:11:17 -0400 Received: from mail.skyhub.de ([5.9.137.197]:39098 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725958AbeJBALR (ORCPT ); Mon, 1 Oct 2018 20:11:17 -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 hr4X-WC6hq6l; Mon, 1 Oct 2018 19:32:26 +0200 (CEST) Received: from zn.tnic (p200300EC2BC64F00329C23FFFEA6A903.dip0.t-ipconnect.de [IPv6:2003:ec:2bc6:4f00: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 E1F4A1EC00B9; Mon, 1 Oct 2018 19:32:25 +0200 (CEST) Date: Mon, 1 Oct 2018 19:32:27 +0200 From: Borislav Petkov To: Nick Desaulniers Cc: mingo@redhat.com, Thomas Gleixner , hpa@zytor.com, x86@kernel.org, "Kirill A . Shutemov" , Masahiro Yamada , Greg KH , Matthias Kaehlcke , Kees Cook , Cao jin , LKML Subject: Re: [PATCH v2] x86/boot: define CC_HAVE_ASM_GOTO Message-ID: <20181001173227.GE7269@zn.tnic> References: <20180927204800.32210-1-ndesaulniers@google.com> <20180927215148.GE19687@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: 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 03:17:41PM -0700, Nick Desaulniers wrote: > That's another case that I look at and wonder "why does this exist?" > The _SETUP guard exists in only one place: > $ grep -rP 'ifdef\s+_SETUP' > arch/x86/boot/cpucheck.c:#ifdef _SETUP > > which is already under arch/x86/boot/. arch/x86/boot/Makefile > unconditionally sets -D_SETUP, so what/who are we guarding against? > Looks like a guard that's ALWAYS true (and thus could be removed). Looks like cpucheck.c was used somewhere else before and that guard was for when it is being built in arch/x86/boot/... Also, hpa says the override is because some 64-bit flags fail the 32-bit compile: https://lkml.kernel.org/r/56442061-7f55-878d-5b26-7cdd14e901d2@zytor.com > Or, or... we don't redefine KBUILD_CFLAGS in arch/x86/boot/Makefile > (or any Makefile other than the top level one), and simply filter out > the flags we DONT want, a la: > > drivers/firmware/efi/libstub/Makefile: > 16 cflags-$(CONFIG_ARM64) := $(subst -pg,,$(KBUILD_CFLAGS)) ... > > ie, using Make's subst function to copy KBUILD_CFLAGS, filter out > results, then use that for cflags-y. > https://www.gnu.org/software/make/manual/html_node/Text-Functions.html Hmm, definitely sounds like an interesting idea to try... > I'm curious to know Masahiro's thoughts on this? I can't help but > shake the feeling that reassigning KBUILD_CFLAGS should be considered > an anti-pattern and warned from checkpatch.pl. For the reasons > enumerated above AND in v1: > https://lore.kernel.org/lkml/CAKwvOdmLSVH7EVGY1ExU1Fh_hvL=FUzhq-80snDfZ+QhCT2FOA@mail.gmail.com/ > (though there may be additional context from hpa answering > https://lore.kernel.org/lkml/20180926090841.GC5745@zn.tnic/). > > Relying on the compiler's default/implicit C standard (which changed > in gcc 5) for parts of the kernel but not others I feel like should be > a big red flag. I sure see your point. But then there's also the opposing argument where having stuff leak from kernel proper into .../boot/ is simply breaking the build. But then we have headers including stuff from kernel proper so I guess *that* last fact kinda wants us to not redefine KBUILD_CFLAGS ... Oh boy. > Shall I prototype up what such a change might look like (not > reassigning KBUILD_CFLAGS in arch/x86/boot/Makefile)? Maybe it's > harder/uglier than I imagine? Sounds to me like a good thing to try. If anything, we'll know more whether it makes sense at all. Thx. -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.