Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp2161451rwo; Thu, 3 Aug 2023 05:46:11 -0700 (PDT) X-Google-Smtp-Source: APBJJlGvVafPE/Gx5nn83L01qzXY1yQPT8sxL5d4tRarppdYYEijAebhgJ0YML88cRXrMd87CfRZ X-Received: by 2002:a17:906:77d6:b0:99b:4a2b:2ea3 with SMTP id m22-20020a17090677d600b0099b4a2b2ea3mr7688912ejn.17.1691066771455; Thu, 03 Aug 2023 05:46:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691066771; cv=none; d=google.com; s=arc-20160816; b=R5Q4yi2ZB//77MUbWJhY5OTAXT9c/OAsjlFop6/wzc7b7tE+isHInYNtJKIAcuvHxW SbP39IKdDDTIOtiE7qXkbaV5I34hV+CiWd/QDymRtZz68CNWZFE68+EjdEWRW0i1TMmJ OJeSExlpfM3nBJBq42R6sQY4bCxissCpIZSfDzwc+wFeTCPMJgvzSut/xpaNaq2/WFGQ n6H4puIlfPxI4235jIo04ofyELEzNvGys9LZhs8AIRCUzBWO6I/v52AnH9B5O/nZs4KT xxapzceuQyd9DU04Xab7gcqigHS4GM7OkA1Kt2FbNwhFIMRUY077UNCSIig/1ITsKXkx 3qeg== 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=EUX0+WxibwZOYfyL5IqgfziFKPa+eJ2gR9q5/bnhTNM=; fh=D8JJxOjBkRgGO4i8R+yZGJlBb8lVSrhJwOanxuAjkvk=; b=WhIytFYemYWZ+1e3W6AaO3dusRpRTqXlfLT95uo2ONWb0FUa5VTjIoQXLb/efQYogp U4wCy9Vwug0u+KprV8BdcOu808rBgtCfEXEW2EfbJhggdqVq5NBYmcu0B5k0k/7J188D kvIFK0lyiqc3f6pI72VUSjOIB0ps9FSc07eH3gZrIfIkNao6+XZDherNCVePNBBL2zrv gPhA8TC8e1bJEYqOVK4//Mi6iFHwK+6jy01xwxHM5JqZWVJaQGPSIPH2ySqwFWUyUGXb CkBHXSXcPkaMbelk1q0X3Wtjtga133OgR+UxaaGjHasNffl9w5ZSycdTtlc09VhxFczX mWSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=cg1DoC0g; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z14-20020a1709067e4e00b0096fe1a56de3si9230465ejr.1048.2023.08.03.05.45.45; Thu, 03 Aug 2023 05:46:11 -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=@intel.com header.s=Intel header.b=cg1DoC0g; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235826AbjHCMMS (ORCPT + 99 others); Thu, 3 Aug 2023 08:12:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235825AbjHCMMP (ORCPT ); Thu, 3 Aug 2023 08:12:15 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1A082D5F for ; Thu, 3 Aug 2023 05:12:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691064733; x=1722600733; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=8TUaEQZbSICclUzIiNKbuR74lraYMEOLLGwfyI28U74=; b=cg1DoC0g03SW7lPqdw2OXBKlk71LbnF47SPeZ3ATGBIS0/aR+RvITYDR 8VKAFv3IMikbPXqHjc+gs58Ifr0qSbCoQvJ4RgH0HqYhFE2uvjs3I7w7a zlrU4tHIbUXBhJ/gGZHSS1dc9RAatfrnR5Zpbb81d3qL7oInlQAXnY+q4 7pADnpas8K0necyVjFXoyUOYZdCjfCuLK/IffrriPLCn258T5h4jHnXqE IQkQNT2dz5DFlq3TNXnKFc6ABJKzz1hePP7Ni8WdpHaE876nRM5munwA4 FGnnX5DqdzQvQBq/hgRf3qmeG6ntKqm4WValoP2Ym+h2JDdF0VCvFIu2+ A==; X-IronPort-AV: E=McAfee;i="6600,9927,10791"; a="456229671" X-IronPort-AV: E=Sophos;i="6.01,252,1684825200"; d="scan'208";a="456229671" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Aug 2023 05:12:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10791"; a="976043495" X-IronPort-AV: E=Sophos;i="6.01,252,1684825200"; d="scan'208";a="976043495" Received: from gvarshne-mobl2.gar.corp.intel.com (HELO box.shutemov.name) ([10.252.63.106]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Aug 2023 05:12:10 -0700 Received: by box.shutemov.name (Postfix, from userid 1000) id B343A109FCF; Thu, 3 Aug 2023 15:12:07 +0300 (+03) Date: Thu, 3 Aug 2023 15:12:07 +0300 From: "kirill.shutemov@linux.intel.com" To: "Huang, Kai" Cc: "Hansen, Dave" , "Christopherson,, Sean" , "x86@kernel.org" , "bp@alien8.de" , "peterz@infradead.org" , "hpa@zytor.com" , "mingo@redhat.com" , "tglx@linutronix.de" , "linux-kernel@vger.kernel.org" , "pbonzini@redhat.com" , "Yamahata, Isaku" , "sathyanarayanan.kuppuswamy@linux.intel.com" , "n.borisov.lkml@gmail.com" Subject: Re: [PATCH v3 07/12] x86/tdx: Make TDX_HYPERCALL asm similar to TDX_MODULE_CALL Message-ID: <20230803121207.krvcuj22mdxhugog@box.shutemov.name> References: <6f92d08855491b3e9ff1221d2bb7af873d546afd.1690369495.git.kai.huang@intel.com> <20230727171008.aw3z6oxh4vfnahep@box.shutemov.name> <20230803114546.em5qsjs33i5b7ogh@box.shutemov.name> <332547a2332121313bf6d00c9eaf71136b48696b.camel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <332547a2332121313bf6d00c9eaf71136b48696b.camel@intel.com> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 Thu, Aug 03, 2023 at 11:56:40AM +0000, Huang, Kai wrote: > On Thu, 2023-08-03 at 14:45 +0300, kirill.shutemov@linux.intel.com wrote: > > > > I would rather keep the struct > > > > read-only where possible. > > > > > > > > > > We can achieve this if there's a clean way to do, but I don't see that. > > > > Keep _ret() and non-_ret() versions? > > The problem is the assembly needs to always turn on the "\ret" so that the R10 > (used as VP.VMCALL leaf return code) can be saved to the structure. Otherwise > we are not able to return VP.VMCALL leaf return code. Yeah. This is downside of single assembly macro for all calls. One possible way is to make it in C: non-_ret() version pass to the assembly helper copy of the caller's struct, keeping original intact. But, yeah, it is ugly. -- Kiryl Shutsemau / Kirill A. Shutemov