Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1083825ybz; Sat, 25 Apr 2020 10:36:05 -0700 (PDT) X-Google-Smtp-Source: APiQypKYEmT/vzNPKYA0VxwwiC9RQzfh965pAmrzb9gC1cxxug2Z0b4nVWP0o9+ZTNq2s3Bu67YA X-Received: by 2002:a17:906:4903:: with SMTP id b3mr12072305ejq.80.1587836165695; Sat, 25 Apr 2020 10:36:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587836165; cv=none; d=google.com; s=arc-20160816; b=iFoUkXQ/gdEEz+IVOaN1FH1kO/yMZtkwnpOD1KMmGTVhFbYO4gY4UbrZdTi2iHuAsu JC2yeoGewFK2O+bP1+j4e7NKBzyOekPJD7InXIUH7tDljPzj2CWc1rS2vIXyYZrJq+go PTT5sd0THAEF2pTBbG/ZcW3t4rh+XoqQuVbPXXl2RwRkuSEW/m8WRe9TtA0Yxl8hRZEH A8vDNUh1Gxo5CL+8q+VUv1uKymuBj9ChTV4VLQQ4grh3IRkiwVQ8naVOcQQNlaFq9myE ytgWdT8wDJEbtQyuUXMA1XqTcqntNXZ14rU7gi/NLb9ExDj8EfWmgt9IEACLK3FTXx64 5mAw== 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=uFkXHVwwFH85jEcy4ns2EHqg9WJsW4QYuQw8r9bQI2U=; b=dpbIA8cMPTAn9qu/dRqn2Cbz6QBqilHDEZjdxwvmdXte/rNYgfypT27DvX+cRgv1P0 swrmAoXEK3T1GLGgy/lN/jT8h9/9507tCRj16NEd777x7oEy6CvY7iZFR50OArakUsMN yY9f3sZb5rPFPuKnIGldP/AQyCROhHP+4aL2FfbQF+FHFJYlSnCmwK7+zPQTaiDyoDqt aswHJoSygNbkjvBHQsBAnIoTZcHDNXadKsV2kz0D6gdOCgg4kK8Ct6UUvN7eZmAtRvmH cNM4aHNpjEyKUm+hc/8njRjCgcWGh+hmxPc/nsmvk3n+S/MxJDMI5gz/5jOzysFspQ2x KIMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=BTmQGxPN; 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 i20si5329107edx.314.2020.04.25.10.35.41; Sat, 25 Apr 2020 10:36: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=BTmQGxPN; 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 S1726336AbgDYRbu (ORCPT + 99 others); Sat, 25 Apr 2020 13:31:50 -0400 Received: from mail.skyhub.de ([5.9.137.197]:37688 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726145AbgDYRbu (ORCPT ); Sat, 25 Apr 2020 13:31:50 -0400 Received: from zn.tnic (p200300EC2F2A1100992835E22F06EF88.dip0.t-ipconnect.de [IPv6:2003:ec:2f2a:1100:9928:35e2:2f06:ef88]) (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 E661D1EC0CD6; Sat, 25 Apr 2020 19:31:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1587835909; 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=uFkXHVwwFH85jEcy4ns2EHqg9WJsW4QYuQw8r9bQI2U=; b=BTmQGxPNkg4Aex6qccxM+7l3usJmduwct1PjS327BGPnactFewmsBn0SUUBJN/bLHJm8uS bH1n7RXre+Ch0s1AD3P0KBwk5St68VwI+8uFYYn10XCufU/CWkI+iRdM03E3fujigj8wt4 mpPVdtWb+IP77M7zyMU6HTk4NzaAazQ= Date: Sat, 25 Apr 2020 19:31:40 +0200 From: Borislav Petkov To: Arvind Sankar Cc: Nick Desaulniers , Michael Matz , Jakub Jelinek , Sergei Trofimovich , LKML , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Andy Lutomirski , Peter Zijlstra , x86@kernel.org, clang-built-linux , Kees Cook , Martin =?utf-8?B?TGnFoWth?= , =?utf-8?Q?Fr=C3=A9d=C3=A9ric_Pierret_=28fepitre=29?= , boris.ostrovsky@oracle.com, jgross@suse.com, linuxppc-dev@lists.ozlabs.org, Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras Subject: Re: [PATCH] x86: Fix early boot crash on gcc-10, next try Message-ID: <20200425173140.GB24294@zn.tnic> References: <20200422192113.GG26846@zn.tnic> <20200422212605.GI26846@zn.tnic> <20200423125300.GC26021@zn.tnic> <20200423161126.GD26021@zn.tnic> <20200425014657.GA2191784@rani.riverdale.lan> <20200425085759.GA24294@zn.tnic> <20200425150440.GA470719@rani.riverdale.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200425150440.GA470719@rani.riverdale.lan> 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 Sat, Apr 25, 2020 at 11:04:40AM -0400, Arvind Sankar wrote: > I'd put the clause about stack protector being disabled and the > tail-call one together, to make clear that you still need the never > return and always inline bits. Done. > Also, this function is implemented by multiple arch's and they all > have similar comments -- might be better to consolidate the comment in > the generic (dummy) one in include/linux/stackprotector.h laying out > the restrictions that arch implementations should follow? I'm not sure gcc-10 does the same thing on other arches - I'd let gcc guys chime in here and other arch maintainers to decide what to do. > There's also the one in init/main.c which is used by multiple > architectures. On x86 at least, the call to arch_call_rest_init at the > end of start_kernel does not get tail-call optimized by gcc-10, but I > don't see anything that actually prevents that from happening. We should > add the asm("") there as well I think, unless the compiler guys see > something about this function that will always prevent the optimization? Hmm, that's what I was afraid of - having to sprinkle this around. Yah, let's wait for compiler guys to have a look here and then maybe I'll convert that thing to a macro called compiler_prevent_tail_call_opt() or so, so that it can be sprinkled around. ;-\ -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette