Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp904629ybz; Fri, 17 Apr 2020 12:08:47 -0700 (PDT) X-Google-Smtp-Source: APiQypLwT0aTpxgfxOCnWTGTjWteiGXG3TLJj0+NClW1uGASwT0Mgb+P6Kh9FOK6KKfISwYbCQHL X-Received: by 2002:a17:906:cd1:: with SMTP id l17mr4347975ejh.319.1587150526968; Fri, 17 Apr 2020 12:08:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587150526; cv=none; d=google.com; s=arc-20160816; b=SW06VGWMsek4odQHy+CSWloCtJwVZuAW6E1QYi1Lb4pxWui3SmWC/6RoMDBxckvc9i l3Ndq9Rw3rJUTRtH5GdQ6Hr88MR5uGEAqHKWGQxpEIqTilgA48zAyKFFJM8APj8nhZPC +FTxl34s0qUY4CTcQg6v9aKs+GwQIXlklhZUD8nUxZraHVQvbmH7YspjvjwRZ69iaRJt 2twCBjpdKi1S7G3x+d4tNGA+uPZCDAbUWzO0WNXBqXD6MnVikU4Ich7azImsRhikmuAP O1U7nsJJqVksI99kJOdgyF+4l9P3ISNP7ZWHcPYtSC3tOU/V8hj3MFA4xgxQP1O9TVQY 8P1Q== 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=l7NhxqPBgZKRGKonQi6tXhellcY9V1W8AoTLk+/o7jk=; b=qlb2UEqSkyRSYpJYiUJ0v4sYCuag4OfpFYTpoVNonU9AdpwiA605fCzL6xIDEKaK9R Fz42BBvMeMgYQIUoUUnHyIxp0l/JXw263G4ZsiuwTpsUtSTTj+fb8IghCR4JUOoMrXie VhQIa0K6/hrc1AcwP9wIkx0Omg9n6MqrdDl5VKAyciyeCDnpUkxV4QwsJAyq1H14vGW4 A8WhqiK8aayAN2IYfJCY+PsPk774o42kpwAXT2YVLMHvR8bmB0rjjCVn8sLk1EA2hEIs cRBlc79HLWJSoVVq2ma3wSE7fSv59vzww6gr6d35b+eFVX6ws/3MeD3Xznk1JIRbcWkW QhGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AhxeHMIZ; 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 t20si11293092edq.412.2020.04.17.12.08.23; Fri, 17 Apr 2020 12:08:46 -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=AhxeHMIZ; 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 S1729623AbgDQTGY (ORCPT + 99 others); Fri, 17 Apr 2020 15:06:24 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:40077 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729287AbgDQTGX (ORCPT ); Fri, 17 Apr 2020 15:06:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587150382; 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=l7NhxqPBgZKRGKonQi6tXhellcY9V1W8AoTLk+/o7jk=; b=AhxeHMIZqqfumAhEEcGpEJT0vbq+K9osCYcm/FPh6HGkN2ruGA1677b0yV8yDVVmcZbaiY RBYMKRnhW94QgDmwdjV/eBJTtaxBbI1X88SQB/k9MQzExmQNJHD1AazJ5AwOeRXtBfe28M r0uEf22j0Nkqu8PTimCRWGUr97N948w= 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-68-ETcNWG3XNDSFn1nDcYYgJg-1; Fri, 17 Apr 2020 15:06:20 -0400 X-MC-Unique: ETcNWG3XNDSFn1nDcYYgJg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E5842107ACC7; Fri, 17 Apr 2020 19:06:18 +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 1C485D7664; Fri, 17 Apr 2020 19:06:17 +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 03HJ6EnA028978; Fri, 17 Apr 2020 21:06:14 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id 03HJ6785028977; Fri, 17 Apr 2020 21:06:07 +0200 Date: Fri, 17 Apr 2020 21:06:07 +0200 From: Jakub Jelinek To: Nick Desaulniers Cc: Borislav Petkov , Sergei Trofimovich , Michael Matz , LKML , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Andy Lutomirski , Peter Zijlstra , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , clang-built-linux Subject: Re: [PATCH v2] x86: fix early boot crash on gcc-10 Message-ID: <20200417190607.GY2424@tucnak> Reply-To: Jakub Jelinek References: <20200415074842.GA31016@zn.tnic> <20200415231930.19755bc7@sf> <20200417075739.GA7322@zn.tnic> <20200417080726.GS2424@tucnak> <20200417084224.GB7322@zn.tnic> <20200417085859.GU2424@tucnak> <20200417090909.GC7322@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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 11:22:25AM -0700, Nick Desaulniers wrote: > > Sorry, I don't quite follow. The idea is that an empty asm statement > > in foo() should prevent foo() from being inlined into bar()? > > s/inlined/tail called/ Yeah. The thing is, the caller changes the stack protector guard base value, so at the start of the function it saves a different value then it compares at the end. But, the function that it calls at the end actually doesn't return, so this isn't a problem. If it is tail called though, the stack protector guard checking is done before the tail call and it crashes. If the called function is marked with noreturn attribute or _Noreturn, at least GCC will also not tail call it and all is fine, but not sure what LLVM does in that case. Jakub