Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp325981ybz; Fri, 17 Apr 2020 01:46:05 -0700 (PDT) X-Google-Smtp-Source: APiQypL0G/M/Qv39T3rk8g8aiWSvoRlj+XCEukudZ6hXcThe4eTT+q3OHOZFK7PoT3iiXtW27q/z X-Received: by 2002:a17:906:7d15:: with SMTP id u21mr1959012ejo.364.1587113165236; Fri, 17 Apr 2020 01:46:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587113165; cv=none; d=google.com; s=arc-20160816; b=H8M0+tXEfT67gxanWm6BBhpAA0pdV3xmR8tNoHSPgnyt0CgQB0F2Qz0m+1jQtRVsdM VVQEFKLwyQjguRIQhnzYiA9YBgmHXwfjII6ZlVj+zKmpMZ5vTyqO7v61vD7E8fFOHc/9 WSUlChiq0E7hdFzF9LHaSIVqk4k/KaSiSnur26CiNmZjPnDfe2IUzDgtnFXBoLR7ECKe L9tBZb4QC4WCS7Wz6MKfcQWZp9VhZkhXJgKMOhYku3GDZWE56DsvpPSYs/D3v0QKysYt H566apxgiGC/XPbgaeNSgONEuMAsoo+mNnsxgs+7dcVW433dX7i6KOHTBzABn7MrrTGc TBrg== 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:dkim-signature; bh=HpKmgFfZkprWvBMQTEBHQ+HqQrIoR6PYuFrabo8U0Yc=; b=VgTaqf3QYRJNFnyx7AM72sFTAXPY0TZof7EHeSmXt+xIxa7zLyBD2A9qXkFtBtY5Hi A7HzjlLrbJ6LUpV4Ywfmh3hq3TCIkeVAFyrkrx6fEuOSLrbZ3dBkYY2tgwcPstqJvPFv sFwPKs/y5S4DfcUj2cw3tVQ49jXjdD8JsO8kHflnDo/ESwI7Y+ItHlbDTWeRyzOTW+iX 8TF3f+FDrK9af4Z9kWSMwExCqIaGfKMY2IOAcDxjcbrREpNGC/KzN6S2ZEC4/QV6ex+W 2YRSf2sHJGRdEeLsLCiT/AKkw4NaC4w94iWPNLnc8R6z3ASLuAW+N0PnAEwLm/jLvAYG Y/AA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=OZrZ48BI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 5si14189202ejx.392.2020.04.17.01.45.41; Fri, 17 Apr 2020 01:46:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=OZrZ48BI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729856AbgDQIma (ORCPT + 99 others); Fri, 17 Apr 2020 04:42:30 -0400 Received: from mail.skyhub.de ([5.9.137.197]:57146 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729166AbgDQIm3 (ORCPT ); Fri, 17 Apr 2020 04:42:29 -0400 Received: from zn.tnic (p200300EC2F0DA8008DA98E92B4F5B53B.dip0.t-ipconnect.de [IPv6:2003:ec:2f0d:a800:8da9:8e92:b4f5:b53b]) (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 A24301EC0D33; Fri, 17 Apr 2020 10:42:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1587112948; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=HpKmgFfZkprWvBMQTEBHQ+HqQrIoR6PYuFrabo8U0Yc=; b=OZrZ48BIgwczXLH05Hga+F1Sauzh7avudhSxJLoODYgCXOozjmlN0sxAlEFVFSCm7Xw5mY BF2x6f9h9TP3K/XjBTf9Jxrs5RbgsoviXnn/EOBSWJQ83LIs92SNGRd6UKU+a3TG3b0tWR th5ZV1oNnqXyJ6Yzvr01jKDfdT1GGrc= Date: Fri, 17 Apr 2020 10:42:24 +0200 From: Borislav Petkov To: Jakub Jelinek Cc: Sergei Trofimovich , Michael Matz , linux-kernel@vger.kernel.org, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Andy Lutomirski , Peter Zijlstra , x86@kernel.org Subject: Re: [PATCH v2] x86: fix early boot crash on gcc-10 Message-ID: <20200417084224.GB7322@zn.tnic> References: <20200326223501.GK11398@zn.tnic> <20200328084858.421444-1-slyfox@gentoo.org> <20200413163540.GD3772@zn.tnic> <20200415074842.GA31016@zn.tnic> <20200415231930.19755bc7@sf> <20200417075739.GA7322@zn.tnic> <20200417080726.GS2424@tucnak> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200417080726.GS2424@tucnak> 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 Fri, Apr 17, 2020 at 10:07:26AM +0200, Jakub Jelinek wrote: > If you want minimal changes, you can as I said earlier either > mark cpu_startup_entry noreturn (in the declaration in some header so that > smpboot.c sees it), or you could add something after the cpu_startup_entry > call to ensure it is not tail call optimized (e.g. just > /* Prevent tail call to cpu_startup_entry because the stack > protector guard has been changed in the middle of this function > and must not be checked before tail calling another function. */ > asm (""); That sounds ok-ish to me too. I know you probably can't tell the future :) but what stops gcc from doing the tail-call optimization in the future? Or are optimization decisions behind an inline asm a no-no and will pretty much always stay that way? And I hope the clang folks don't come around and say, err, nope, we're much more aggressive here. However, if we do it with the explicit disabling with -fno-stack-protector for only this compilation unit, then it is 1. clear why we're doing this 2. no compiler would break it So I'm still gravitating a bit towards the explicit thing... Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette