Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp298825ybz; Fri, 17 Apr 2020 01:09:42 -0700 (PDT) X-Google-Smtp-Source: APiQypJ0woZFZRnTgHe+mCrivjeDyJW9hWNdzGm1YwQxOPD+dTz4F0sRf2oPZRspMJEcp5ubFCt+ X-Received: by 2002:a05:6402:705:: with SMTP id w5mr1849609edx.379.1587110982399; Fri, 17 Apr 2020 01:09:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587110982; cv=none; d=google.com; s=arc-20160816; b=Ok9C9RFwnNEs2nqA0SuZ3KG4qxDAJG0QHZ7iXMZHnJN+SX7Y0nKQcCT6DYsB+9HGP3 Ogn8amoVnkfTKNGPqfUvwfZbyAmtUbRCPkx9KKHQMUrQsyGS4DrTjHEFiFElPJjZmjZA TQmaXrXcSIK48pBjDc1tfxh9hcaQIXxo+un35O+guGRKyj+hgoXGldiA9LTcpeJ86yrK VLXpuiFK8/50pTMxxpX0bN46+UEPcUbMAxi3t7C3GaZ2x/77BJ+Fo0MnMr6W8Ecz25uF y+U/vQXnt9JlCRRU3LUPFFHjJXbLOL0yZikaUMYaLjWfoU9/LfhmaLEbmQ4b8f4zx1mE ZA3A== 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:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=NccU6pdLlMoSxH6d3Hr9mUjUtMyNeVmxbtBZCQRRwy8=; b=dOgrdWbPFPj2/EO/yktA/8NsZy+6PMwxJYDaWsVgMstD+UosSSIZZqQHtgEPigzDD6 c++hQA7QWkO4VeBdWcLmCZuS6nG6negAa+VOl5FhpRZYxBWCdyNBmZPoiUSNR3N0Cg9+ yPCkZauT+VbXIxJXTHKZpzfBfVXeIKwdyyLY/d4hXG6SsfYmV98jfGLvCvkKB6n/bQgL PabPbvuzveviMk9OmCjS5CZ+SZA18LqZUR6L9ydaTNjvBznmgaCDoN0MSB0CkgLuySTP s7koIgXi66RHS7BX31NXPq+UhM/EFyoOCobJtO49pcaiHLwri+DEIZ0/X5Cm+hHXaRKq GE5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GOVWb49A; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o5si13491941ejr.501.2020.04.17.01.09.17; Fri, 17 Apr 2020 01:09:42 -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=@redhat.com header.s=mimecast20190719 header.b=GOVWb49A; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729657AbgDQIHo (ORCPT + 99 others); Fri, 17 Apr 2020 04:07:44 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:20799 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729176AbgDQIHo (ORCPT ); Fri, 17 Apr 2020 04:07:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587110863; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=NccU6pdLlMoSxH6d3Hr9mUjUtMyNeVmxbtBZCQRRwy8=; b=GOVWb49AHhiCqAwLlh5xSsXDvBDAlRl9SCAIJzYuU5yeggMN+gh/AtiStBV5Sdna6BoAKk TZ07O4gYDJqALsoX/hRNp+3XUNljYvFwy64bwaaipOiAlrglarI3p+bYzundPdFsrLiP9z D5U71PLjsa9nBeZ8uBMAPL2KpRIl/U4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-495-aan4zgP_MUezxqVGX3NAHw-1; Fri, 17 Apr 2020 04:07:39 -0400 X-MC-Unique: aan4zgP_MUezxqVGX3NAHw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2FF2D18C35A2; Fri, 17 Apr 2020 08:07:37 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-112-104.ams2.redhat.com [10.36.112.104]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 676BB1001B3F; Fri, 17 Apr 2020 08:07:36 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id 03H87XoG004216; Fri, 17 Apr 2020 10:07:33 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id 03H87QGB004215; Fri, 17 Apr 2020 10:07:26 +0200 Date: Fri, 17 Apr 2020 10:07:26 +0200 From: Jakub Jelinek To: Borislav Petkov 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: <20200417080726.GS2424@tucnak> Reply-To: Jakub Jelinek 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200417075739.GA7322@zn.tnic> User-Agent: Mutt/1.11.3 (2019-02-01) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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 09:57:39AM +0200, Borislav Petkov wrote: > On Wed, Apr 15, 2020 at 11:19:30PM +0100, Sergei Trofimovich wrote: > > Ah, that makes sense. Borislav, should I send a fix forward against > > x86 tree to move -fno-stack-protector as it was in v1 patch? > > Or you'll revert v2 and apply v1 ~as is? Or should I send those myself? > > Yeah, Peter and I have been discussing something like the below > yesterday. I don't like the additional exports too much but would > disable stack protector only for the one function... 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 (""); would do, or for (;;); , or combine both, mark cpu_startup_entry noreturn and add asm (""); (which most GCC versions will optimize away as unreachable). Jakub