Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1189632imm; Fri, 28 Sep 2018 13:43:13 -0700 (PDT) X-Google-Smtp-Source: ACcGV63m4FiC8tHKt1BQd0wlhJFyZobAlGN0C++/Aj+neqVtyYh1Wt8Q9cnDEVkzvyAUKG4AOyXJ X-Received: by 2002:a17:902:261:: with SMTP id 88-v6mr239887plc.331.1538167393504; Fri, 28 Sep 2018 13:43:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538167393; cv=none; d=google.com; s=arc-20160816; b=sQoaS3gclOgcOCYihqq07ueSMhuCFTAVejsK6Wcq8i3AFTgwS6cbFPOqyviO24jukO H/+cR/CMjGfT7CxtNyGeVNMBjC/GWFAqIt3J7Skb7rEQ++9+wdfz2WhxBCEAwO5spXT5 cJMoOxoIh/NH0xHj6jG0ZV5Fp/xLwdjgukVhffF37maoMI0pssWnJKO8pJwLABuOOa5y 2LVZT2gjoqfWjJm5rKKRe/lWKPbxtq4uymGcWY9eaXM+VD2MaCyYkIXKvxT0pezYCeCc 11c7dawkfl6/SiXKx49JxrZGvykDAtN/AFqIFwhg5HzLaloeaTDyCfD5LlcswlGp1dcQ Sj0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=FDQoqjj65PjaIHRAh7NJTWvtFl3MvZtmv/kBIQ4RTvQ=; b=kyj4wfLnMALlYrbIGdqCz3Zy8NsnWFv51NJavyWSiwtIuOZ0wBj68peLxPjIHzW66t fHBfPSdIyu3/eCulTAjDJKF1Hu4oA7ZrsohO0WZBeQH2Aly/zQZVagU+P5EbAHF9xsXw Wuxvi5y6vXCAZcqoreFjHbpu/I3Wde1eREl1kSlWka1XPjwzOuhurkiHTI7zkzq+eZjd h0NQdhIXIU/1Bca1JynE6aUhKajI2iGUohe766FBKuaPl5xalYNafac/vseUCmHa9Zqa RapeX2GTe9pHra0y/mB7I0IYbkxPjOU0GNXKCsQYtNiFyobO9XWwyBhHIsBV1kEstod3 BHqg== 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 m11-v6si5900081pla.45.2018.09.28.13.42.58; Fri, 28 Sep 2018 13:43:13 -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 S1727248AbeI2DHh (ORCPT + 99 others); Fri, 28 Sep 2018 23:07:37 -0400 Received: from terminus.zytor.com ([198.137.202.136]:60311 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727221AbeI2DHg (ORCPT ); Fri, 28 Sep 2018 23:07:36 -0400 Received: from hanvin-mobl2.amr.corp.intel.com (fmdmzpr04-ext.fm.intel.com [192.55.54.39]) (authenticated bits=0) by mail.zytor.com (8.15.2/8.15.2) with ESMTPSA id w8SKfpn4555004 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Fri, 28 Sep 2018 13:41:52 -0700 Subject: Re: [PATCH] x86/boot: define CC_HAVE_ASM_GOTO To: Borislav Petkov , Nick Desaulniers Cc: Thomas Gleixner , mingo@redhat.com, x86@kernel.org, "Kirill A . Shutemov" , Masahiro Yamada , Matthias Kaehlcke , Kees Cook , Cao jin , LKML References: <20180907202618.258569-1-ndesaulniers@google.com> <20180925190829.GC15464@zn.tnic> <20180926090841.GC5745@zn.tnic> From: "H. Peter Anvin" Message-ID: <56442061-7f55-878d-5b26-7cdd14e901d2@zytor.com> Date: Fri, 28 Sep 2018 13:41:46 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180926090841.GC5745@zn.tnic> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/26/18 02:08, Borislav Petkov wrote: > On Tue, Sep 25, 2018 at 02:13:16PM -0700, Nick Desaulniers wrote: >> Orthogonally, do you know *why* this Makefile overwrites >> KBUILD_CFLAGS? We take great care to set various compiler flags in >> the top level Makefile, so to reset them lower in the tree seems >> troublesome on first glance. Take for instance the fact that GCC >> changed the default C standard from gnu89 to gnu11 in GCC 5. So a >> kernel dev with gcc 5+ is now building a kernel with some translation >> units built as gnu89, and some as gnu11. > > Right, so I'd defer to hpa for a definitive answer here but AFAICT, the > reasoning is that because this is the special relocatable compressed > kernel and as such, it is redefining build flags completely so that > nothing leaks from kernel proper. > > Which is funny because what happens is, that something *does* leak, > and what you're trying to fix is one incarnation. Because we do use > facilities from include/linux/. And looking at your error: > > #warning "Compiler lacks ASM_GOTO support. Add -D __BPF_TRACING__ to your compiler arguments" > > I don't think it does matter to the compressed kernel whether the > compiler has asm goto or not. > > And looking at arch/x86/boot/Makefile, it does: > > KBUILD_CFLAGS := $(REALMODE_CFLAGS) -D_SETUP > > and that _SETUP guard is kinda used to separate that early boot code > from kernel proper. > > And I wonder if adding such guard to arch/x86/boot/compressed/Makefile > and then protect the asm goto check in arch/x86/include/asm/cpufeature.h > with it, would be more in line with how this whole machinery should > work... > It overrides CFLAGS because it is by necessity a 32-bit compile (16 bits, really, but that's done at the assembly level only.) Some 64-bit flags cause the 32-bit compile to error out. -hpa