From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 85A32740034 for ; Wed, 8 Nov 2023 04:14:29 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=sPXOVFHQUZ98364gsUqH6JGTkRq5nlrBUN1DXFeC4kM=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1699416867; v=1; b=iPbESGfvpSCgKPjDUCIg2WdXkefQwZb8+3GqjI58QzKun5eqMttGeaK2Hct73QOHtg+jjqh1 GatJ7p4nvIzmnv9w6AJbtuSrPY4xwMv6EPDCYFOwzK+zCVfu3F8al1HAt4oDyDSydNf0snEBwFq 9hiMit7yk4EZzJdI80d0N2KM= X-Received: by 127.0.0.2 with SMTP id YTu7YY7687511xusfHJKU8vE; Tue, 07 Nov 2023 20:14:27 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web10.7015.1699416867217667839 for ; Tue, 07 Nov 2023 20:14:27 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10887"; a="388546760" X-IronPort-AV: E=Sophos;i="6.03,285,1694761200"; d="scan'208";a="388546760" X-Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Nov 2023 20:14:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10887"; a="1010138903" X-IronPort-AV: E=Sophos;i="6.03,285,1694761200"; d="scan'208";a="1010138903" X-Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga006.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 07 Nov 2023 20:14:26 -0800 X-Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Tue, 7 Nov 2023 20:14:26 -0800 X-Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Tue, 7 Nov 2023 20:14:25 -0800 X-Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34 via Frontend Transport; Tue, 7 Nov 2023 20:14:25 -0800 X-Received: from NAM04-MW2-obe.outbound.protection.outlook.com (104.47.73.168) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.34; Tue, 7 Nov 2023 20:13:45 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GbtUumDs3cgtjPJij5RcUiPxMIVQh9a3JXFqNfgl/UCkJ3zomo8IL5tiP6nV3hDIhxkR34n28dluCOgtgbvSreKpJHPFsGOeDV5iv1A7y/ZUy7ajFQ9EER0wX1vpNqaxUKXUQ6sabL9Axrr5Dj8g2wxHpRunJtM2B6KHPKHk+/eWkU1zZwSwUu6TXjVwdF+X5fWfRC2J/ToGmyMhfZvbEz/NK5hqUN0wLflTW3pnYEB5n002PFV3Dn6q7p+KooasvixsqE/Izs1KlzCuva/dtJiuf9/03YwW3dEiuAaljZiw17W43UjJb4zNyMhq2D93rdikZNEgjipWGkQPefoLhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=q5BgUk9CuEV2wy/UFMMTcuk6uNkzNpar+lRneNBPYWM=; b=UpGlPyTG8uaTQEyAS1zpB5qnVH8kJZojgG7v/pOsQx9cb10LAWfGwdNt+Ng30NKDB+06V/UOG4PmtMyVLZedRa/QWCvI/DH7SaF58K6MxzFFspCRy3JPEgoB/ldPmghw6pAXUajoHhAB5AOauld1PN0xTGjqV4wu20X0BHcVNDcv1/uUZWZSvk2nZRP51t1fEnGosD8337NFPiv6qVJ/4hHZbMgj6aRxMlCDKrphTV2+G6Zl3cGyk3VdrjML+PsgVXOdMwBlpPedHI1hLwsNuPQaOY/6W7L+EUj38aNnSFuk5HlXKPU5t+aAR81YE2FmksZM7x9Hw4P+4mAFn91YFQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none X-Received: from MW4PR11MB5872.namprd11.prod.outlook.com (2603:10b6:303:169::14) by SN7PR11MB7708.namprd11.prod.outlook.com (2603:10b6:806:352::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.27; Wed, 8 Nov 2023 04:13:43 +0000 X-Received: from MW4PR11MB5872.namprd11.prod.outlook.com ([fe80::2f2f:41ab:b556:7257]) by MW4PR11MB5872.namprd11.prod.outlook.com ([fe80::2f2f:41ab:b556:7257%3]) with mapi id 15.20.6954.027; Wed, 8 Nov 2023 04:13:42 +0000 From: "Yao, Jiewen" To: "Sun, CepingX" , "devel@edk2.groups.io" CC: "Gao, Liming" , "Kinney, Michael D" , "Aktas, Erdem" , "James Bottomley" , "Xu, Min M" , "Tom Lendacky" , Michael Roth , Gerd Hoffmann Subject: Re: [edk2-devel] [PATCH V2 1/2] MdePkg/BaseLib: Update TdVmcall to always output the value in R11 Thread-Topic: [PATCH V2 1/2] MdePkg/BaseLib: Update TdVmcall to always output the value in R11 Thread-Index: AQHaDWx+s9P+ssv8Nky6wq8TTvsPN7Bv2PmA Date: Wed, 8 Nov 2023 04:13:42 +0000 Message-ID: References: <20231102090957.2076-1-cepingx.sun@intel.com> <20231102090957.2076-2-cepingx.sun@intel.com> In-Reply-To: <20231102090957.2076-2-cepingx.sun@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MW4PR11MB5872:EE_|SN7PR11MB7708:EE_ x-ms-office365-filtering-correlation-id: 8f6d0f9d-e284-4c00-2cf2-08dbe0111821 x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: hJ1T0fcZXNC5zSQKU5PO76fUD7F6GBCDiefnNl3zoQv+DJkkQ5jkSpBAEZ8iwgAth1+FT16V7aLfZ5b0+0haL54XgUMwvQs10o6LkNoQGRV7x+CJliX+E0LPFIl2pnWrPGpX/I1EB+oRRVlKQhPDreCAiGOXSUBBDNPu3BvxD5KnY0Zu2nrXSuw8WctaIVxbO1X5FxyCkEI9SoJBBoKapfkjungl6aZ1RimwJNOlIahY+MLhv2vaj9qX4wM3ly3rIyNdD+YjlQupVEdFCpgZefJzRaA9/9c+azqqmTxyu9b9H2BpuADmGzps+H6QNy6gSm/ywV1rZ0HCDkos8um6Ng+ZaYS58ZetaW4x0EfG5ij7YchOilnkYQF91ttR3Hw6hDX1yAG4Dh1pSP0xAeo/mfd5fwfXFInrNerC4JBt2sSOaVkM0Qsi4UU8jsUy1ZLD9ZcXRYcUmOBKHMELyXDFZ3uTfjLi/by1e5OCm82dOTjLhdTJO2rysT8J6e+qgq+PBXWzW8vmZ0W5iz0fCkjHCrhhQXNih/sJjaDXX4YsWo2adQ5yPCnj3J7MTkKTcoyvsHoCFgcjIX4VtKUjFnBhqQQf+EQPqTrLCDv6A+I0ZhNAg6tMcwf+5iG/R58YIHdRbE3AhPCYVkse9WsooLFyiw== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?7vMiVlTG780UQpiyztxgZ36ghXE6CLG27/qIwTIP/YZSU4/K3eWZasb/OmYP?= =?us-ascii?Q?BTL8WWMftRgOzgPXbTnRKCJKz1FafU0r2Rbk02JmB1VlbLwjYmH4ATHRF046?= =?us-ascii?Q?6YNk6U1JtR5BYKGotrEAJLH67sdM+liH8iKjKRbsljAWC6jjYaSdPrxtDqdo?= =?us-ascii?Q?aevGDEFl8zMoND18zePo+NVIfcb8Ak1jc4vnGlKw1H8vbomAScYjvwpfwMuf?= =?us-ascii?Q?uEpiH87Tm47fWKqpEMFU0OjD7OwaVXFwzd3f2487x573Q5Z/R7kOy95CGBOF?= =?us-ascii?Q?+zmw2ypc6E/rNXBKwu9qlPBMV9djVUMaCWzj9oknqTiOIv/N21ySrowjGifY?= =?us-ascii?Q?NFKkKrVi6wRT4386kxBIftRxES28Js5gIOZm8BrPsHFKqYzmZL+pDgLJ+uy4?= =?us-ascii?Q?RT99H6mye0FVZw8bQAdmJt/oqzvt4tpl/358aiOKbEUPBlFCtKuS1S+t6rZv?= =?us-ascii?Q?PMx1qe2mxhTcTclqoG7fZD2VByPwTqbA5xV5O6QDT05MzUTEWwrv5RWHjRBH?= =?us-ascii?Q?bbb3hZ6fmQW0pcdJiC850GG4x+yi3Y2yS73G19+GGrXie/jK4xPIe2HkJryF?= =?us-ascii?Q?klGyb0M5Zpg7CAEBPnhkt4RHFPaXHrIdbJX9npyfgFLLAU8396jmiFWRfTGQ?= =?us-ascii?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VsGN7ZRH?= =?us-ascii?Q?1bL/c1PjRM5TRsROMMvMVL7pydxiuC6bWHymJf7j?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW4PR11MB5872.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8f6d0f9d-e284-4c00-2cf2-08dbe0111821 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Nov 2023 04:13:42.6638 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: J5Rr/i6Lb6BGY00SpA/y/jF3c4IRpZLVwyh3vaWva0yFUNToED5uTUHjuoX5HYkMjG1GPZSKl9gHJAEJ+GQIdg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR11MB7708 X-OriginatorOrg: intel.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,jiewen.yao@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: SnqJf4fmpcCc9GmRmkz4Pv3dx7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=iPbESGfv; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") Reviewed-by: Jiewen Yao > -----Original Message----- > From: Sun, CepingX > Sent: Thursday, November 2, 2023 5:10 PM > To: devel@edk2.groups.io > Cc: Sun, CepingX ; Gao, Liming > ; Kinney, Michael D ; > Aktas, Erdem ; James Bottomley > ; Yao, Jiewen ; Xu, Min M > ; Tom Lendacky ; Michael > Roth ; Gerd Hoffmann > Subject: [PATCH V2 1/2] MdePkg/BaseLib: Update TdVmcall to always output = the > value in R11 >=20 > From: Ceping Sun >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4572 >=20 > According to section 3.2 of the [GHCI] spec, if the return status > of MapGPA is "TDG.VP.VMCALL_RETRY", TD must retry this operation > for the pages in the region starting at the GPA specified in R11. >=20 > Currently, TDVF has not handled the retry results and always clears > the R11 on unsuccessful return status. For this, the TdVmcall needs > to output the value of R11 on unsuccessful return status to handle > the retry results of MapGPA. >=20 > Reference: > [GHCI]: TDX Guest-Host-Communication Interface v1.0 > https://cdrdv2.intel.com/v1/dl/getContent/726790 >=20 > Cc: Liming Gao > Cc: Michael D Kinney > Cc: Erdem Aktas > Cc: James Bottomley > Cc: Jiewen Yao > Cc: Min Xu > Cc: Tom Lendacky > Cc: Michael Roth > Cc: Gerd Hoffmann > Signed-off-by: Ceping Sun > --- > MdePkg/Library/BaseLib/X64/TdVmcall.nasm | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) >=20 > diff --git a/MdePkg/Library/BaseLib/X64/TdVmcall.nasm > b/MdePkg/Library/BaseLib/X64/TdVmcall.nasm > index 5ecc10b17193..8dd9bfcbfa14 100644 > --- a/MdePkg/Library/BaseLib/X64/TdVmcall.nasm > +++ b/MdePkg/Library/BaseLib/X64/TdVmcall.nasm > @@ -133,9 +133,7 @@ ASM_PFX(TdVmCall): > test r9, r9 > jz .no_return_data >=20 > - ; On success, propagate TDVMCALL output value to output param > - test rax, rax > - jnz .no_return_data > + ; Propagate TDVMCALL output value to output param > mov [r9], r11 > .no_return_data: > tdcall_regs_postamble > -- > 2.34.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#110894): https://edk2.groups.io/g/devel/message/110894 Mute This Topic: https://groups.io/mt/102337975/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-