Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1155598ybk; Thu, 14 May 2020 01:43:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJysg2Kxi848//uLXFMbH3c8YEWQcw5AO//BUluQPxiXNn7/WMHGlk3PIVk5H5iEgp4iEuvd X-Received: by 2002:a17:906:4111:: with SMTP id j17mr2921144ejk.242.1589445818412; Thu, 14 May 2020 01:43:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589445818; cv=none; d=google.com; s=arc-20160816; b=OGSUZfU80YLNel8fDZNM8DrMu/OSj0qvx6HNbhQHNAS1jFDIBzzc3ue251uWtudNWo GaDLp0e+a4rYVi9CLYDxVNXpVm1OiBfyy0J0Pl3h9kjReOKj8tUWuFAeOc/9Zsqf6UYG 1rajdFSK9NQSFaIJ+RWETu6xIGQCtSOWSsN6+HyA18zIHZFdcbHYTbwkIaoQyzbVmRaq N7T4QrYnOBeOlwis4t+9RM2j4S8gCBU6G6MYgBb7m0gIwgQqQtYNE5kV4r4u7NdC5Zo5 6MN1SQNQBu3PZLdSSGdr38tkdFirCu8SgRJEg7CBRx9u0Q9uHHXbfMcOQeK709dILig6 OCGQ== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=qhzXiMxx71KzFIkpt4U+XLHpjOXt1l74abchNTAqD6k=; b=ymt25AS0e366fPN6ctdVMk74ooNOBIUgVg2YJuDwFHfL026s4zCrmrcKBohHN1kklb 2K6UXPp8TmYGaBWQzE46hPxIm2yPQo6kpic6CHFuL/mTrPZaHO48hCr+Ks09FuqzTfjW zTRBFnXWvFyIqXfOKtL6TSFctGI2FRJmm2FzTFScIU9L/8QmlqBy6T6YebA9hB19UGJ5 of79KddCOuvGSctpouRd/kCg8Qn09GMcpuyH7mFD7J+DbiPJZU9j5bPJWLfbEHDCYe3x IgXJIgoaHZ4ZO5AKQxtsbac3oJZpFY0Nl6tKK1UaSS6l5zozNRvPrjcoHwwLf/BOMQLs XNrg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w8si1426361eji.466.2020.05.14.01.43.15; Thu, 14 May 2020 01:43:38 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726176AbgENIlF convert rfc822-to-8bit (ORCPT + 99 others); Thu, 14 May 2020 04:41:05 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:59793 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725925AbgENIlE (ORCPT ); Thu, 14 May 2020 04:41:04 -0400 Received: from mail-qt1-f175.google.com ([209.85.160.175]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPSA (Nemesis) id 1MBjA4-1jN5ft3hN6-00C8pc; Thu, 14 May 2020 10:41:02 +0200 Received: by mail-qt1-f175.google.com with SMTP id c24so2187935qtw.7; Thu, 14 May 2020 01:41:01 -0700 (PDT) X-Gm-Message-State: AOAM530fr7v+iKSyffKHRPC7yZsfG/Plt00n5G2TARXFsJBj5OIR20nJ KifMz6ePIxY74VG7iujxrYqwQMEsIe3skax+k+s= X-Received: by 2002:ac8:2bce:: with SMTP id n14mr3166722qtn.18.1589445660699; Thu, 14 May 2020 01:41:00 -0700 (PDT) MIME-Version: 1.0 References: <20200513214128.GB6733@zn.tnic> <20200513222038.GC6733@zn.tnic> <20200513233616.GD6733@zn.tnic> <20200514052234.GA1894416@rani.riverdale.lan> In-Reply-To: <20200514052234.GA1894416@rani.riverdale.lan> From: Arnd Bergmann Date: Thu, 14 May 2020 10:40:44 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: gcc-10: kernel stack is corrupted and fails to boot To: Arvind Sankar Cc: Linus Torvalds , Andy Lutomirski , Nick Desaulniers , Borislav Petkov , Kalle Valo , linux-wireless , "linux-kernel@vger.kernel.org" , "the arch/x86 maintainers" , Kees Cook , Thomas Gleixner Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Provags-ID: V03:K1:jnIzLBrM0jEQrCHlkxywVLSVaOZWWYcJv/R42h3em7OZYlF+nHl UAJzPzfI33NKpGKTgAd6YhVqLcAOdNE12Ord7Jy+2OYgl20Pn3NSknwpZdQxyUXSMQRcEtV hygOKa7mISMC4u0gk59ZnN20QwZJWglOQgw7G6QlOHIbZz5WN1SWZG/GIL6CM0eD1YWpJOk q5M9sM6xW/6o1X18ns3EA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:k/Fz5z3nB+E=:DGTbgR0BxrGmcoN73g2Jet LFczIlbQyDBbbQHNdj40gCjZWegupJBxqQnr9r3+C89LuXjOKMEoBilRq7BPsKDAE4RbZEroa uwGIY/lNIbs9sI2tD1aFbZVHmtWVq6c4WAq9Vnwem0SHNjlP2QVh00Y15mlvW860lBdIIwL7d Xgzez/yVwUYWdbHI6duW8YFt5lMVQH1AyPH9BHnStMQF5Bl1NCw7apjlm4xRQvzFZArXIW9w9 xuCw0RyZHQ5BBZVB36WiOh4T4R46fQ7T0IEzdnXsAKN1hdbfDFhzkfsxOcDAhmA4mQVgMxmdi XcTClGOgnT+I06HjxBGh+BMkPQOJPUZb4yKVdq93lPRv+RdlHLT7uLvs6miXn/yv3xHjJufek JxRT/IaDZ9+uacz//ER80VTXWoEgykIsMAHGhCip45mgWwui49vfr3hTbbNBby1M+aEE67S/X havj63hH6fTSbtkKZcqexRqUkqH9a0MYgVA0CmQLBQ3Ev/+8M81ZdPU0Ysj24ST12mvklJYyT PhZBapOQlh0TlHMNMLMucw/dlYACBzmaUXV7QYM52cuZOI0GQzPip9GJqWJLsPlmy/JZakbtn 7Aj9x2tNgPo8bWSiud0fDi2RNRXVt+GMSdnnJ9B2XCxtyqh2CeR3TaVUBC4sbJwMeejx+e4Vz u9nDHTaqKWjqSWWfp7kv8bKjhhdTm4NqzmYB1mdZyAbOI2Al/5B277gFICLvOlKUPVlmaN7yo gAIgdOLaWSpjq/n4RuyQakJYkcm46OSptnjfUT1nJnFtLQY8sLjckFO1yqvDQaHqaRQ/lgbg7 eW1J6pd+xijWbjB/S+d7pKrWPTeGVJUvybd4tlaWVDp0pglf5I= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 14, 2020 at 7:22 AM Arvind Sankar wrote: > On Wed, May 13, 2020 at 09:52:07PM -0700, Linus Torvalds wrote: > > On Wed, May 13, 2020, 20:50 Andy Lutomirski wrote: > The gcc docs [1,2] at least don't inspire much confidence that this will > continue working with plain asm("") though: > > "Note that GCC’s optimizers can move asm statements relative to other > code, including across jumps." > ... > "Note that the compiler can move even volatile asm instructions relative > to other code, including across jump instructions." > > Even if we don't include an instruction in it I think it should at least > have a memory clobber, to stop the compiler from deciding that it can be > moved before the call so it can do the tail-call optimization. I think LTO would still be able to notice that cpu_startup_entry() can be annotated __attribute__((noreturn)) and optimize the callers accordingly, which in turn would allow a tail call again after dead code elimination. Arnd