Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5102017rwb; Mon, 21 Nov 2022 16:51:51 -0800 (PST) X-Google-Smtp-Source: AA0mqf7/z9pMaK151m0FlaephpsQlj1EAZYafMJQ/EzEL7V34ygwFfex8jvnqHxWwUh+bs9Z6Fur X-Received: by 2002:a17:90b:3444:b0:213:519d:fe51 with SMTP id lj4-20020a17090b344400b00213519dfe51mr28940610pjb.239.1669078311425; Mon, 21 Nov 2022 16:51:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669078311; cv=none; d=google.com; s=arc-20160816; b=zoGtQL2bCLVVT4pkvOWz4uLv5m4UfyHjGVsxhtCojjFJQWWDfvb6dzFauOmOmYuizP MzCpXSMMK++EzWSi15cB0DrpIBTXLikMfUAHjBXgWYq0mqVZtT3UluGZJH1wAmwcrCH9 9MFJuntLq4mNiVUd/4gjthhDKw/YhqTT5Rv/x+g5hiUIy3y8MICYBfa/omcdKBs6J5SO nWWBeocOww+Ed3Xii/4n/gDuwX43boUOsLLLRWaT7WqIfLUZp2uLUXK33AUhyh5LIQfz SOcB/cy58s6S/fOHNN5WqjFUSxMaWRMTWsnsiWY1Rk2x2bikOFlSIPKxK59+v5HTvZlu oJhw== 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:feedback-id :dkim-signature:dkim-signature; bh=/TTpDFg+so1Z9SXl6Kq/T8u7wvo0UjCRKomGK5iT/s8=; b=NTczntlN7D4LVIEv7xRBrOOE3qpF9Rbd0nBLRCRL2eBM7kWVxA8KrVUZoQC8oDrnfd CI/X9EoP47WsltPkkjD3G/rcFbiLrEaLqPShwDnEmxvVXsgkLwfiRKemaX30Cp5q0Fl6 1i31q3WpKE7f+p/PBAH18ca4DuGv9SSjL5P2Xy3Txke7ihzaN/R5jxsKg3MrLDg24KXl FXSuM2rH7SQYo8eSu/0yvM5fQo3NOSBTg98U3qHMGNqS7h05r617o8kPsLPM8E0DEiWX QxsgJwuhR4G4Ui4KubO9o8qXLNoEJoCOxaGQ1Q6Ga7K4O97vmhgCAckE/+Qim7nalGCK LRkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov.name header.s=fm2 header.b=IJJVwzzx; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=FSVjBrQY; 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 b37-20020a631b25000000b0047798cae7easi1090278pgb.594.2022.11.21.16.51.40; Mon, 21 Nov 2022 16:51:51 -0800 (PST) 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=@shutemov.name header.s=fm2 header.b=IJJVwzzx; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=FSVjBrQY; 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 S231969AbiKUXxG (ORCPT + 91 others); Mon, 21 Nov 2022 18:53:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232003AbiKUXwv (ORCPT ); Mon, 21 Nov 2022 18:52:51 -0500 Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20AC71175; Mon, 21 Nov 2022 15:52:46 -0800 (PST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 187A632009A2; Mon, 21 Nov 2022 18:52:42 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 21 Nov 2022 18:52:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov.name; h=cc:cc:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1669074761; x=1669161161; bh=/T TpDFg+so1Z9SXl6Kq/T8u7wvo0UjCRKomGK5iT/s8=; b=IJJVwzzxcJ5DKHsVm7 ov7o5ATR7Ri0E7u4SgFnhVBO/2koLsIfZpLv0oz8cR+C44lPdeoLnOtJkBEBEeMr kHB+OirEKGY+vXm7EyIupVPaK+W7hEZ2h9WaDfeaT6y/Ugb1HIWVyPrsWE4C/2DW qlB240D94BMFpy2CHxAZfdEekkB6nwnnuAvXI9N3OefTrp+ju2a2V2sFKn6BW/OJ UvCUARpsv/KIl7eAhQPhSSOrRtxyaiQfUMj1+M2EDKnunVo4Mryq7UklG/VwbgQG qbPsWN/D8dCALig5St6Rk3LliwliekArVDuSWhUOxWWKrXim3u/OkCPUofso59Cz f1NQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1669074761; x=1669161161; bh=/TTpDFg+so1Z9SXl6Kq/T8u7wvo0 UjCRKomGK5iT/s8=; b=FSVjBrQYZDQk8TpV4oQ04LxFlUfEoMBRvwugBnRlbuPo gHi8c22Oh6H5xbpx3GZVqN62UQq7IA4uwPFrOQHE+icrclxaTOX0ksaCr92EQui5 mwyDdH23IHFuWB54Ym+WczOqX+Wo6D9vPgQQ3gg+FZRLdyl+/lqVb7o1GQ9zrgF9 moDuDZnr69/ztHvUYkDxFkHZMKJr3wDjJcqsyKX7LpKra0sNTO0VIIwMIXHjgcnD VOBX6eTpLYqpcdY5nh0x+egPvdRaxLY4fUxerLuoSdGrZfogcBPU2NSuzo8dysgL Bd8YN1tQAZDlb9HMiRS9ucE4mi7ferN3/k3psD8IBQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrheejgdduhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfhfgggtuggjsehttddttddttddvnecuhfhrohhmpedfmfhirhhi lhhlucetrdcuufhhuhhtvghmohhvfdcuoehkihhrihhllhesshhhuhhtvghmohhvrdhnrg hmvgeqnecuggftrfgrthhtvghrnhephfeigefhtdefhedtfedthefghedutddvueehtedt tdehjeeukeejgeeuiedvkedtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepkhhirhhilhhlsehshhhuthgvmhhovhdrnhgrmhgv X-ME-Proxy: Feedback-ID: ie3994620:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 21 Nov 2022 18:52:40 -0500 (EST) Received: by box.shutemov.name (Postfix, from userid 1000) id 07E89109A30; Tue, 22 Nov 2022 02:52:38 +0300 (+03) Date: Tue, 22 Nov 2022 02:52:37 +0300 From: "Kirill A. Shutemov" To: Dave Hansen Cc: Dexuan Cui , ak@linux.intel.com, arnd@arndb.de, bp@alien8.de, brijesh.singh@amd.com, dan.j.williams@intel.com, dave.hansen@linux.intel.com, haiyangz@microsoft.com, hpa@zytor.com, jane.chu@oracle.com, kirill.shutemov@linux.intel.com, kys@microsoft.com, linux-arch@vger.kernel.org, linux-hyperv@vger.kernel.org, luto@kernel.org, mingo@redhat.com, peterz@infradead.org, rostedt@goodmis.org, sathyanarayanan.kuppuswamy@linux.intel.com, seanjc@google.com, tglx@linutronix.de, tony.luck@intel.com, wei.liu@kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/6] x86/tdx: Support hypercalls for TDX guests on Hyper-V Message-ID: <20221121235237.ebvkgxe3zm47wp6v@box.shutemov.name> References: <20221121195151.21812-1-decui@microsoft.com> <20221121195151.21812-2-decui@microsoft.com> <18323d11-146f-c418-e8f0-addb2b8adb19@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <18323d11-146f-c418-e8f0-addb2b8adb19@intel.com> X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS autolearn=ham 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, Nov 21, 2022 at 12:38:36PM -0800, Dave Hansen wrote: > On 11/21/22 11:51, Dexuan Cui wrote: > > __tdx_hypercall() doesn't work for a TDX guest running on Hyper-V, > > because Hyper-V uses a different calling convention, so add the > > new function __tdx_ms_hv_hypercall(). > > Other than R10 being variable here and fixed for __tdx_hypercall(), this > looks *EXACTLY* the same as __tdx_hypercall(), or at least a strict > subset of what __tdx_hypercall() can do. > > Did I miss something? > > Another way of saying this: It seems like you could do this with a new > version of _tdx_hypercall() (and all in C) instead of a new > __tdx_hypercall(). +1. There should be a strong reason to add another asm helper. -- Kiryl Shutsemau / Kirill A. Shutemov