Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp3067066ybh; Mon, 16 Mar 2020 15:13:36 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsLkFokM+ZDkwISg4WuBE5gC4IDeaVms/jxYhtOe4ZggSPZJGTKA8Rv7UbAitXLezCWMNKv X-Received: by 2002:aca:fc0f:: with SMTP id a15mr1310136oii.68.1584396816669; Mon, 16 Mar 2020 15:13:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584396816; cv=none; d=google.com; s=arc-20160816; b=0Bx6SdqkO+a5xDhRoYfX8uqeZBJp5BfwsExNWxHPKbAXeoXh5hO7HC9wEKJNAmf5rU C3kY2jFQi/IgXQUqZl7hrqICSHsA6qktAT5WHzgllAT4IkF0et9M/w7QPhLcMQECVWrt wuQJnNPVXhPdj9n1INIBLFsu1v8nUYkqcM6CskapQXY0f/ddxzepf7pj459Qy2O9O2fW i1MNt4+Q/RiC1jLJbIMyar7srGNBGOsLSDp/Ht+VCjtDQYBrbZh9R8KcF/uGoKPqwLJy VF0rRT3ivk/J242YPaFNJqzQ8Sq7diZ7riVcNwfk7zS3hpiHLjas4Ye0Fh6KynMf/Bbv 4Zfw== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=xjDik7jIKh2GTSGbOyUeVb+Zxn6xx8mwN9r09zQb2a4=; b=JFdCjgFnS4YzWfpR7hlGE1N7kRp5YZcoabUiMpmSzQGMr4vYvAnUHBnvH4hcyXYEvF 2CISMPr27odUXwCSSOyrtvAqW12j+vOfwUYRzO5DDg+bc3HoZd+zy0v1RmG0At+Pv9+K PiyOTpQOFAEwBwKzsI1YCueqIsEcLKB59mJ9XqdfeSw1aNJr7VJe7+/HYeIiPHU9ISCy vsO8xckIZKzDXEumgdwITVacFh+Qb8aQD5L3tQq2+Ez0fBuYnx3H6RPIwore/6HsikUb emgPKtULgAvJrTAaVe7MJD+h4C0gSVh33Z7SMIFGyR1aAkyel/dvkqfTQ1gnAsoESJ1O EZ2g== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gentoo.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l16si615560oti.106.2020.03.16.15.13.23; Mon, 16 Mar 2020 15:13:36 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gentoo.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732743AbgCPWM5 (ORCPT + 99 others); Mon, 16 Mar 2020 18:12:57 -0400 Received: from smtp.gentoo.org ([140.211.166.183]:37232 "EHLO smtp.gentoo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732652AbgCPWM4 (ORCPT ); Mon, 16 Mar 2020 18:12:56 -0400 Received: from sf (tunnel547699-pt.tunnel.tserv1.lon2.ipv6.he.net [IPv6:2001:470:1f1c:3e6::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: slyfox) by smtp.gentoo.org (Postfix) with ESMTPSA id 4547834F19C; Mon, 16 Mar 2020 22:12:54 +0000 (UTC) Date: Mon, 16 Mar 2020 22:12:51 +0000 From: Sergei Trofimovich To: Jakub Jelinek Cc: Peter Zijlstra , 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: <20200316221251.7b4f5801@sf> In-Reply-To: <20200316132648.GM2156@tucnak> References: <20200314164451.346497-1-slyfox@gentoo.org> <20200316130414.GC12561@hirez.programming.kicks-ass.net> <20200316132648.GM2156@tucnak> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 16 Mar 2020 14:26:48 +0100 Jakub Jelinek wrote: > > > +# 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). In case you are still interested in preprocessed files and results I've collected all the bits in a single tarball: https://dev.gentoo.org/~slyfox/bugs/linux-gcc-10-boot-2020-03-14.tar.gz Same available in separate files in: https://dev.gentoo.org/~slyfox/bugs/linux-gcc-10-boot-2020-03-14/ Specifically: - gcc-v.gcc-{9,10}: gcc-v output of both compilers. Note --enable-default-pie --enable-default-ssp. - config.gcc-{9,10}: note, they are not identical as Kbuild does not recognize gcc-10's plugin support. I don't use it though. - boot-crash-gcc-10.jpg: picture of a full boot crash - command.gcc-{9,10} called to generate .s files (it's almost the same when building .o files) - arch-x86-kernel-smpboot.s-gcc-{9,10}: asm files, gennerated with 'make arch/x86/kernel/smpboot.s V=1' - arch-x86-kernel-smpboot.c.c-gcc-{9,10}: preprocessed files, generated from command by changing -S to -E. Another observation: kernel built by gcc-10 boots as-is in qemu without patches. I wonder if the following boot line right before the crash has something to do wit it: "random: get_random_bgtes called from start_secondary+0x105/0x1a0 with crng_init=0" I hope it's not a race of async canary initialization and canary use. Only one CPU is booted at that time, yes? -- Sergei