From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 791C8C4332F for ; Thu, 8 Dec 2022 22:08:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229909AbiLHWIg (ORCPT ); Thu, 8 Dec 2022 17:08:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230180AbiLHWIF (ORCPT ); Thu, 8 Dec 2022 17:08:05 -0500 Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AEA4B1050; Thu, 8 Dec 2022 14:06:43 -0800 (PST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 0F80D5C00C7; Thu, 8 Dec 2022 17:06:43 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Thu, 08 Dec 2022 17:06: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=fm3; t=1670537203; x=1670623603; bh=9D fHTo0GC4PlZwrEkw31ByuDSYGHJwT7xoG/PgPL6pk=; b=H6vddsgHc7VHy1bBar C8oNkomXtE3xW6kcFD1MlJiUFdVasLaRkzX4fK0fysvwdlmwrHPnHEEXhP9qkZ2H ZpEGQMW5yoDn/e5fnJ5GDsI7Fb6U+dOlS8juDk/6kTqC4I+RCiM2t1a48mvzECm8 B8ZwzAVZRS557nwV6py+oNGIsr+aXbZxF1FMkqVCN5jv8CeQ6sA12Ux2/lDbdqQm p1kKrfYQ9WoLJwGpHbTfhQJ/0Kl0zlgxHp5cCutV6h0EzadH3UGhc8AqYHvy/64v 3PvGM6lVj3ugvQ523lX619iZPpo1sgt5RKrAW+toiAfvXQESaSvh6Ln4ffL/G114 ZkvA== 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= fm2; t=1670537203; x=1670623603; bh=9DfHTo0GC4PlZwrEkw31ByuDSYGH JwT7xoG/PgPL6pk=; b=HVZzdDMDN/Hqp2Z8Ow7oh5FxzvzJoCOL+Vf4zfqI8L24 +Cqva1jNg2YA7W+5GOiFH4Ff60jnjavsIO5PL4xr7Fr/3C/Xc/nJDSIibX4m9SNy pIPiQKuBwMkdmROl5ujKFskU2hJQNe9VaITkwHsAhlAu8OlW4KtoSD9qnLz6vfy9 T1JoD3h1j6N9CC/L7CdVcfZC9012/Hs3QX4DGc0Dv3mJg/82YaSVw+ngmh5RmnES J0DI4tdIleeY1CqxEGm2thHmgVEGOGHCKQbCfQxXpdJc12XNKI36UoHKXqFycjKa YFdIw7mOlG4bd5azs45ERB58/+khCAPll2UKOm7mEg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvddtgdduheekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdttddttddtvdenucfhrhhomhepfdfmihhr ihhllhcutedrucfuhhhuthgvmhhovhdfuceokhhirhhilhhlsehshhhuthgvmhhovhdrnh grmhgvqeenucggtffrrghtthgvrhhnpefhgfffueetheehveetfefhiefhueehvdfgjeeg tdejhefhvdeijeekvdekheejfeenucffohhmrghinhepthgutggrlhhlrdhssgenucevlh hushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehkihhrihhllhes shhhuhhtvghmohhvrdhnrghmvg X-ME-Proxy: Feedback-ID: ie3994620:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 8 Dec 2022 17:06:41 -0500 (EST) Received: by box.shutemov.name (Postfix, from userid 1000) id ECD4B109CB7; Fri, 9 Dec 2022 01:06:38 +0300 (+03) Date: Fri, 9 Dec 2022 01:06:38 +0300 From: "Kirill A. Shutemov" To: Dexuan Cui Cc: Sathyanarayanan Kuppuswamy , "ak@linux.intel.com" , "arnd@arndb.de" , "bp@alien8.de" , "brijesh.singh@amd.com" , "Williams, Dan J" , "dave.hansen@linux.intel.com" , Haiyang Zhang , "hpa@zytor.com" , "jane.chu@oracle.com" , "kirill.shutemov@linux.intel.com" , KY Srinivasan , "linux-arch@vger.kernel.org" , "linux-hyperv@vger.kernel.org" , "luto@kernel.org" , "mingo@redhat.com" , "peterz@infradead.org" , "rostedt@goodmis.org" , "seanjc@google.com" , "tglx@linutronix.de" , "tony.luck@intel.com" , "wei.liu@kernel.org" , "x86@kernel.org" , "Michael Kelley (LINUX)" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v2 4/6] x86/tdx: Expand __tdx_hypercall() to handle more arguments Message-ID: <20221208220638.2km3gibpn7wicbtb@box.shutemov.name> References: <20221207003325.21503-1-decui@microsoft.com> <20221207003325.21503-5-decui@microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 08, 2022 at 03:54:32PM +0000, Dexuan Cui wrote: > > From: Sathyanarayanan Kuppuswamy > > Sent: Wednesday, December 7, 2022 2:14 PM > > [...] > > > --- a/arch/x86/coco/tdx/tdcall.S > > > +++ b/arch/x86/coco/tdx/tdcall.S > > > @@ -13,6 +13,12 @@ > > > /* > > > * Bitmasks of exposed registers (with VMM). > > > */ > > > +#define TDX_RDX BIT(2) > > > +#define TDX_RBX BIT(3) > > > +#define TDX_RSI BIT(6) > > > +#define TDX_RDI BIT(7) > > > +#define TDX_R8 BIT(8) > > > +#define TDX_R9 BIT(9) > > > #define TDX_R10 BIT(10) > > > #define TDX_R11 BIT(11) > > > #define TDX_R12 BIT(12) > > > @@ -27,9 +33,9 @@ > > > * details can be found in TDX GHCI specification, section > > > * titled "TDCALL [TDG.VP.VMCALL] leaf". > > > */ > > > -#define TDVMCALL_EXPOSE_REGS_MASK ( TDX_R10 | TDX_R11 | \ > > > - TDX_R12 | TDX_R13 | \ > > > - TDX_R14 | TDX_R15 ) > > > +#define TDVMCALL_EXPOSE_REGS_MASK \ > > > + ( TDX_RDX | TDX_RBX | TDX_RSI | TDX_RDI | TDX_R8 | TDX_R9 | \ > > > + TDX_R10 | TDX_R11 | TDX_R12 | TDX_R13 | TDX_R14 | TDX_R15 ) > > > > > > > You seem to have expanded the list to include all VMCALL supported > > registers except RBP. Why not include it as well? That way, it will be > > a complete support. > > Hi Kirill, can you please share your thoughts? I wrote the patch to handle redefined ReportFatalError() (the updated GHCI comes soon). It doesn't need the RBP. And we run out of registers to stash arguments into. Let's think about this when the first user of RBP comes up. -- Kiryl Shutsemau / Kirill A. Shutemov