Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp446rwl; Thu, 6 Apr 2023 13:42:53 -0700 (PDT) X-Google-Smtp-Source: AKy350ZMhhQNs8sPa2eXv6Cm1bNHAc/Be7pR2pliCtQ6rQoYu6T2f0QpTtJTfFZE2PxitAnkKi6M X-Received: by 2002:a17:902:fb05:b0:19a:9610:b234 with SMTP id le5-20020a170902fb0500b0019a9610b234mr6795407plb.1.1680813772754; Thu, 06 Apr 2023 13:42:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680813772; cv=none; d=google.com; s=arc-20160816; b=Q9SXiGQ4/yclHvLZCo7sBAx+S/9eGdcHRFJw9dRchpD59JgmGbZYneirmI/6kjtTD6 p7oGkFjna4dNKyA+TTOoOcOnCG7emDdEcpXnRwD/AEt5qa3k9oA1/emattw5Ks8lMYzu Ck8+nPAUP6MCJPjeSR2bBgh1cnFpSEdg9r2cVz69+hCFl1Qt+xGHrM1j+Fjdi1fVZPu3 lasZmgpn8e2xiM/8fndp5KBXW/WM6pRyHzesrRju5cDt0N3rPp+UmWyHH3ajDD0Kj615 SI73odc7oSESreInNm6J/5q2GMvW3+kccV0Q2c6b0HlGXxRhWvfBvJn+MJ7Ql3fFdBOo 0K9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=mWCYh+aHqMQPGU92cJY3RsdVCoOL6xggKE9AswxAjjI=; b=EfUlBhJ8tx794GB1wL3Hlm56uTUlIynSdPsObUCRs1aqYX3kvlXJTKNuBu9Z7WvusV EpTzpdJV7l8+H8uiqKhIRu9q7DqsVN+5Uf1wMIquGXFbwj3sX3WtmSSq5BGW7fPh5i9P ztg7+xRFNetKY+LyFzlTTiiT6OJspXDGcZTafirRTEAtYAjaqP0NPqZlCKn1+VbXRxfs +nLI1Rfa7b+YHZznM95TOlad4+fJbx74kK/dfv2phaAaL2yphN+y8h0wykchvDthCgoK e6j2AH6Ot24r5p2r5RBX0V1LWiBMDyGn1aUqUk4nurynDlLpVdLzYLMK2umAYzGdezg0 w4qQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=FVfGvile; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b15-20020a170903228f00b001a1f9f47eebsi918194plh.575.2023.04.06.13.42.24; Thu, 06 Apr 2023 13:42:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=FVfGvile; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240425AbjDFUmJ (ORCPT + 99 others); Thu, 6 Apr 2023 16:42:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239554AbjDFUlc (ORCPT ); Thu, 6 Apr 2023 16:41:32 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87C0A7AB9; Thu, 6 Apr 2023 13:38:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=mWCYh+aHqMQPGU92cJY3RsdVCoOL6xggKE9AswxAjjI=; b=FVfGvilevbgchwqZb52BXeY8SA yM4/PlPBCQF19uANo8phcXNg55OCv069MBl+d8kfOQ5fzChyQXwG8hcFBV26OSUTZK3K1MfiWWUTP 32vXXFNGdIMRTR5weNKpSj9tpJQJ08tYy7FODzQZIricHNb+7nLm/NlEmcEHUZUat4+aVvWRzkbiz ZruHBv84ED5dthnKaC9V4SqK0Yq3SlaeD80X0P16qTbl5RgzuVxK7Xp1Z9JmtdzlZpwNiqopTQUez SR04HbpaphOyaR+GDCdQeqjdy2CICbldb2Fzsbp+GTvV1FLr5ojiF1w7bxi5Fvgja+sPSUoHU2akV mOqncIzg==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1pkWMX-0009V8-4F; Thu, 06 Apr 2023 20:37:41 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id B0750300274; Thu, 6 Apr 2023 22:37:39 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 190072625036A; Thu, 6 Apr 2023 22:37:39 +0200 (CEST) Date: Thu, 6 Apr 2023 22:37:38 +0200 From: Peter Zijlstra To: Lai Jiangshan Cc: linux-kernel@vger.kernel.org, Lai Jiangshan , "H. Peter Anvin" , Andi Kleen , Andrew Cooper , Andy Lutomirski , Asit Mallick , Cfir Cohen , Dan Williams , Dave Hansen , David Kaplan , David Rientjes , Dirk Hohndel , Erdem Aktas , Jan Kiszka , Jiri Slaby , Joerg Roedel , Juergen Gross , Kees Cook , Kirill Shutemov , Kuppuswamy Sathyanarayanan , Linus Torvalds , Mike Stunes , Raj Ashok , Sean Christopherson , Thomas Gleixner , Tom Lendacky , Tony Luck , kvm@vger.kernel.org, linux-coco@lists.linux.dev, x86@kernel.org, Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" Subject: Re: [RFC PATCH 1/7] x86/entry: Move PUSH_AND_CLEAR_REGS out of paranoid_entry Message-ID: <20230406203738.GE405948@hirez.programming.kicks-ass.net> References: <20230403140605.540512-1-jiangshanlai@gmail.com> <20230403140605.540512-2-jiangshanlai@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230403140605.540512-2-jiangshanlai@gmail.com> X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 03, 2023 at 10:05:59PM +0800, Lai Jiangshan wrote: > @@ -915,11 +922,8 @@ SYM_CODE_END(xen_failsafe_callback) > * R14 - old CR3 > * R15 - old SPEC_CTRL > */ > -SYM_CODE_START(paranoid_entry) > +SYM_FUNC_START(paranoid_entry) > ANNOTATE_NOENDBR > - UNWIND_HINT_FUNC That isn't quite equivalent. SYM_FUNC_START() gets you ENDBR, while the SYM_CODE_START(); ANNOTATE_NOENDBR; UNWIND_HINT_FUNC is explicitly no ENDBR. > - PUSH_AND_CLEAR_REGS save_ret=1 > - ENCODE_FRAME_POINTER 8 > > /* > * Always stash CR3 in %r14. This value will be restored,