Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp497378imm; Wed, 26 Sep 2018 02:09:09 -0700 (PDT) X-Google-Smtp-Source: ACcGV610shibELunlrVJOiZyxG0nnucdSdPz9rhZCnXHBYgipshvO5kpSXCvr0N5H7gM2e8bcnDR X-Received: by 2002:a17:902:464:: with SMTP id 91-v6mr5172503ple.125.1537952949072; Wed, 26 Sep 2018 02:09:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537952949; cv=none; d=google.com; s=arc-20160816; b=CGUdnhjNHD5evFC6I4IflORbYz10eSickf/V6lk9heVr6cMqjpHz1Du/tSevfzf9eV CL7kfpx6sA+VizLtLQZk0K6kRMG2hE07upuOE06vGBI9J+kj/zisXdLX7IjMdOJez72z BMnM9P9UWmIJlNSm+2FJ4T88sLidRSOUnlV9nleEJ0wmQDBHVp9lN0OAaqOxlox6H2I+ Q6DsQqd9io2tIZMA6Iue9u7WRvQguM8FIJ75oiHq5IpaJ4t28bDacGUfkdMUl12gQbzZ +EYEYWiI2vJm81hT1J2sUjIAAJ1enTA/zQMbgLIgkQ+nvJTZ/l2wEOs5pDuSifSPC1/u +S0Q== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=6ra1DPFWqI5rR6U5iGt4AMUIeVAoblvx6N7w7EL5fog=; b=QNYuwkXZHamsAVRtpuixlFd/Kgpa7vmwoTMjjInSx9X2pjIGZyd8TjeeUUSHS5LhYc n0Z5X2o288e2uB2Qa5Rbvu40t5TnMZHsavE5ARtNRdVqLwYusv+KyBwzKHcOqWuCSr9t x1HMKaVE/qYet4F2AiDlwP8XrcAji9DZT4vMPJZzXZjoOO58tv8TeaeOELpN9C47adxI 8DRDyeB1K8Q0Vg18VqPH2vQtd0mBnK4lajTqceoXTt3xqDJ+qU01szsLDP2q2RwMi4At 3QR+WbNXLVd5jYA3yCA4EYhYSY86zz32EOrupXGhSDAXIGQ9PDMzHmiTqCAF9bczm/gQ 0UFg== 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 r194-v6si4830469pfr.100.2018.09.26.02.08.53; Wed, 26 Sep 2018 02:09:09 -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 S1728142AbeIZPUi (ORCPT + 99 others); Wed, 26 Sep 2018 11:20:38 -0400 Received: from mx2.suse.de ([195.135.220.15]:42302 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727189AbeIZPUh (ORCPT ); Wed, 26 Sep 2018 11:20:37 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id CF1C6AEB4; Wed, 26 Sep 2018 09:08:38 +0000 (UTC) Date: Wed, 26 Sep 2018 11:08:41 +0200 From: Borislav Petkov To: Nick Desaulniers , "H. Peter Anvin" Cc: Thomas Gleixner , mingo@redhat.com, hpa@zytor.com, x86@kernel.org, "Kirill A . Shutemov" , Masahiro Yamada , Matthias Kaehlcke , Kees Cook , Cao jin , LKML Subject: Re: [PATCH] x86/boot: define CC_HAVE_ASM_GOTO Message-ID: <20180926090841.GC5745@zn.tnic> References: <20180907202618.258569-1-ndesaulniers@google.com> <20180925190829.GC15464@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit 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 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... hpa? -- Regards/Gruss, Boris. SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) --