Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp2622745ybh; Mon, 16 Mar 2020 06:45:15 -0700 (PDT) X-Google-Smtp-Source: ADFU+vs2J9kEObVm/pPHtRUywxn7kBMtdqSnZFo6bQtPkPvJg6Vjru3KeE1PDqKPySA3EyEbsVeu X-Received: by 2002:a05:6830:1251:: with SMTP id s17mr11850180otp.75.1584366315477; Mon, 16 Mar 2020 06:45:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584366315; cv=none; d=google.com; s=arc-20160816; b=etMZz9t0ciNfOCfbGOlooKb2ZOCFCHzu7mxYqPbyPVqdys/ATHp6ZiI74pOcGT7K1B 9fk9A5c0BSuhe+GUD/yJ6Kj47mnB5m6nbcRmFdpJQiQbfNvqfqQRlbJhHmQxMq/MGteW 8HHltI2JdwjS1PiyangqTldygjb1I20zV+ICFaTBc/bSBOSlOVfjmd9gb+BoQFT/Ltyb uQoLkTfZBzBPPq8ecrpWGETVWDAvOCAmbzsEnBmDQnIxCLkJ9COSrB1GL8nZVZRFm0RB YkXynpKXKhhEon27eq4oT0rKjlPbKl3ZAKI/KvLkkTavhNuHis6IrwDVvJrGNQNtvRB0 sEqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=hXk6G8BC2OZrv5EeXODBUkPYq1TPsurqTNGDI/u77MU=; b=S/iUlBIyIkTHbUccfBpkALROl9kWjhFdUv3vbxnbC1xPxSbGj1wPLyqarA0XU0HX+E 82rsoBsPfLmME8/fxhHseJZ18ran7xra1nhLwnNML+/vL0l6ff9WncmhKlf+hhAPjOXT L+vZ5kL/zXAxJl4OEw/YjHDnEi2ndvx7ubIG8J9AylkzTz1KyLl0uBXlmCckyuHGCfXE SGC4YwMJR/AzZx2iyRwFAFXNtLhi0416AS18L8zJKjW2bLD6oog8xonbhk2dur6Iwpvy I7xwxPlU2xsy1U2+Z5ScMklfYa6F5jTIW1xzomHdqqGw5Zonmx8dao9qePS9Q6ecvLAZ NgPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b="Ijc/0a4B"; 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 z126si10878oia.187.2020.03.16.06.44.40; Mon, 16 Mar 2020 06:45:15 -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; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b="Ijc/0a4B"; 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 S1731422AbgCPNmu (ORCPT + 99 others); Mon, 16 Mar 2020 09:42:50 -0400 Received: from merlin.infradead.org ([205.233.59.134]:52002 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731330AbgCPNmu (ORCPT ); Mon, 16 Mar 2020 09:42:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=hXk6G8BC2OZrv5EeXODBUkPYq1TPsurqTNGDI/u77MU=; b=Ijc/0a4BODhTmhO9Zs5kmfH6PW SpeJGCxFhND9WzDCk3PPVAPKpQRuX5XYbxo+1rCL2kb91ndgtieH0svBOJWrYnMG8Yn+iIA45Qk1k zBevBEqBDj+9JG3nXYNJlRnu9JYRhY3AI7PGlR7kNM60BXsy2KtcdUTW59RXJ1ECyPwrU3ZnXG6AU v7XtEwjzQhhH0iO4iCwq2qMXDEeWDuu4vxD35o0+J7MpPlzmiciFE+NWQwWxCMafN6KMc/YcwsQbC OXitI9PPMHlgar5XXJsulE+rLHI9D4vPurqg8x2Yzeg/3RA8ESy0dCWE3Dilb6ZMS7KyBj/hvvkEM l5aqiNcQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jDq0q-0006k8-EX; Mon, 16 Mar 2020 13:42:36 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 183E63012C3; Mon, 16 Mar 2020 14:42:35 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id ECBE020B16472; Mon, 16 Mar 2020 14:42:34 +0100 (CET) Date: Mon, 16 Mar 2020 14:42:34 +0100 From: Peter Zijlstra To: Jakub Jelinek Cc: Sergei Trofimovich , linux-kernel@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Andy Lutomirski , x86@kernel.org Subject: Re: [PATCH] x86: fix early boot crash on gcc-10 Message-ID: <20200316134234.GE12561@hirez.programming.kicks-ass.net> References: <20200314164451.346497-1-slyfox@gentoo.org> <20200316130414.GC12561@hirez.programming.kicks-ass.net> <20200316132648.GM2156@tucnak> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200316132648.GM2156@tucnak> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 16, 2020 at 02:26:48PM +0100, Jakub Jelinek wrote: > On Mon, Mar 16, 2020 at 02:04:14PM +0100, Peter Zijlstra wrote: > > > diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile > > > index 9b294c13809a..da9f4ea9bf4c 100644 > > > --- a/arch/x86/kernel/Makefile > > > +++ b/arch/x86/kernel/Makefile > > > @@ -11,6 +11,12 @@ extra-y += vmlinux.lds > > > > > > CPPFLAGS_vmlinux.lds += -U$(UTS_MACHINE) > > > > > > +# smpboot's init_secondary initializes stack canary. > > > +# Make sure we don't emit stack checks before it's > > > +# initialized. > > > +nostackp := $(call cc-option, -fno-stack-protector) > > > +CFLAGS_smpboot.o := $(nostackp) > > > > What makes GCC10 insert this while GCC9 does not. Also, I would much > > My bet is different inlining decisions. > If somebody hands me over the preprocessed source + gcc command line, I can > have a look in detail (which exact change and why). > > > rather GCC10 add a function attrbute to kill this: > > > > __attribute__((no_stack_protect)) > > There is no such attribute, Right I know, I looked for it recently :/ But since this is new in 10 and 10 isn't released yet, I figured someone can add the attribute before it does get released. > only __attribute__((stack_protect)) which is > meant mainly for -fstack-protector-explicit and does the opposite, or > __attribute__((optimize ("no-stack-protector"))) (which will work only > in GCC7+, since https://gcc.gnu.org/PR71585 changes). Cute.. > Or of course you could add noinline attribute to whatever got inlined > and contains some array or addressable variable that whatever > -fstack-protector* mode kernel uses triggers it. With -fstack-protector-all > it would never work even in the past I believe. I don't think the kernel supports -fstack-protector-all, but I could be mistaken.