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 73BC474003D for ; Wed, 8 Nov 2023 13:29:24 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=fHlroBP9MU+ht8jzaKR8QJfwyMw5qKCz3GuQJBsZMxc=; 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=1699450163; v=1; b=hPJpvvGkXu6aW8kydiTJAFpSSapoElin36YkGqOf1fq2ejfnAj3R/eL+qCT498cpaQStgQrs z2maeTxUrCejMGTxolKF48DS1oYTapDdMm4TbhwmKTHRQOkdoL3RLKQui33yuWoHZZk31VFdAH9 vuyXslZrtE7wkYXi/45G0Fuc= X-Received: by 127.0.0.2 with SMTP id Mu2bYY7687511xJdZ5QXCAkR; Wed, 08 Nov 2023 05:29:23 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web11.13479.1699450162535922931 for ; Wed, 08 Nov 2023 05:29:22 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10888"; a="369963135" X-IronPort-AV: E=Sophos;i="6.03,286,1694761200"; d="scan'208";a="369963135" X-Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Nov 2023 05:29:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10887"; a="833484784" X-IronPort-AV: E=Sophos;i="6.03,286,1694761200"; d="scan'208";a="833484784" X-Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by fmsmga004.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 08 Nov 2023 05:29:22 -0800 X-Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Wed, 8 Nov 2023 05:29:21 -0800 X-Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34 via Frontend Transport; Wed, 8 Nov 2023 05:29:21 -0800 X-Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.40) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.34; Wed, 8 Nov 2023 05:29:21 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eV1ZCDMdBFonUyZWTQHlQ4f4QivV+m2Mjsn41Kt2ASKS5X3Rg/lXYy1fSewGAjhPen0u3JGk7TUa/7XHSpW5YjbjlDZfNdKe7LwmtDDjtohjAfDMRa7W1/Q/eTyIlrJp6ne5UKe0jyys8ZchRgLZjrEVolWCTgijKnjyBmJqJsrQrZgvynZKFr8XAffLTVpt2g6guRgdZiQ1T4pZo5xnzrXi5aQYtUaq8Yhh6hNqkD4JVrPJUsNy1Olg5Bi5DVVy+Hsogde6R1AO7TBNqJcv3Cfy4EB4nCr0LKG3oIgVKIvBa0VNbHO4OLYdDgJZRAqa7fGCS2hgfNWuDAki9HufqA== 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=35f/q7xlIWw7fZB5IjyI6/czfUfssBsiOvg3oRxl8OY=; b=ZUDNriApYFn1WGZ19TtQA8AHhNy5cKzVD1PctvneUP2ySTKXw+ViPyWPGCEBk3gibycuIlPl6F5vvjhMXv2cNUNb38mn2ZNp5UOWU28WtAuxLDa2+vbdTN41t0vENh+Y9atTK0FXRIQ3wfK6p7h3pzn9xYE7PvrMODTotR/DlWlu8emxPRVkW7KO8AJl4t1X2Ih3ZzMU7oCKlcyIBMeCcy0CVx6o6xYs7W4LheObcrT8BDv50U4VBhZcyjgcmwBnimy9pvfsT/7K6gyNv45EraZ8biI72mqt0DOpR+r48FfEJuugSGCmn+Bpuclmr6IvQuxeIvnzQrfFL7f5oxu/qg== 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 PH0PR11MB7523.namprd11.prod.outlook.com (2603:10b6:510:280::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.18; Wed, 8 Nov 2023 13:29:18 +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 13:29:18 +0000 From: "Yao, Jiewen" To: "devel@edk2.groups.io" , "Yao, Jiewen" , "Sun, CepingX" , "Kinney, Michael D" , "Gao, Liming" CC: "Aktas, Erdem" , James Bottomley , "Xu, Min M" , Tom Lendacky , Michael Roth , Gerd Hoffmann Subject: Re: [edk2-devel] [PATCH V4 0/3] OvmfPkg: Update TdVmCall to handle the retry for MapGPA Thread-Topic: [edk2-devel] [PATCH V4 0/3] OvmfPkg: Update TdVmCall to handle the retry for MapGPA Thread-Index: AQHaEjg8qknLj53mhU6OMJfONwxv7rBwaFEQgAABGcA= Date: Wed, 8 Nov 2023 13:29:18 +0000 Message-ID: References: <20231108113827.3917-1-cepingx.sun@intel.com> <1795A87A01316EEF.15940@groups.io> In-Reply-To: <1795A87A01316EEF.15940@groups.io> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MW4PR11MB5872:EE_|PH0PR11MB7523:EE_ x-ms-office365-filtering-correlation-id: a42b285e-f7ef-411b-a6c8-08dbe05eb5ac 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: EzRRnTXwVSpJzjPC16pK9VRC3dV9zfJmRCbJD0FHiAkU7nUIZ1YTgslpVYpOaiXd3vjv++d1wwcRz95pVMChBHI12icfxJLMlPjZcM+RCFszOLAo2uw5rKc1qKalArwNQ7eGRa0++DFCRF20crDGyg9xTDK303Ar8xly7G/4ACavhwn1OSnXQsoGORKAhO63e1p/sPHuW0v3mW3++ynopEIzdbJf9149g8fFxGA2OghFnAIY4ScOvaIPeArpx2BeZ5IFfEYOEinblzeKjR0pG2c3K7FoWdKE0YnJRFPO+uyZ463GUjlqKFEcBTQk5YZX9S/sqLdOfKFVgH3sov7b/h0COuo22oJ3XikUCmP6+Y6beV03mR3v04vC/J4NPoqYoMm+lhulsSMr1lzdC5NzjWChJnO9uqCD9vcrEXr6+tzLq2eFQE1c4XWQvulYL8VIwY0IQZghmNVUoRqj3CscHbSHzW+fdY94K1hIzdp0XZIXgOMfgFbq9Jk08bo1ktTZlUtyaVJLTGN5KS6RE5EFv3Xg8ZaEKn3W/KZJusB7IJaWur5W9uI7IrTziCao9hWKTeTmPSmkJGkKA57W/ArUAa4ZAJzhWea0iWZR+dR7DwAiiFkDBeAEi1kMd0SBoyDn8lGrCIlMWwssJnXCEEXAKA== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?cEIr+wQik9lJISqF/4WGjADH+FbHaJn9Bh+MWLTjJShIPMfR7CpGDpCnYqye?= =?us-ascii?Q?INyX5zKVnxi9CAVJUQJ2ZWjqF0a8DqWYLzy3iwbJ7HnntVNPgSRQIUgxrckJ?= =?us-ascii?Q?9q7j//Y01tD7o4Vp25lLOpafz8ZzfGYgn91S0tBvClM2k67jEcfyl5r182rF?= =?us-ascii?Q?19BbXIFcFg1i/MlzsKlnNjUr1ckMD8XFrTkD1w8Yv8qy5H2yozKWZ/tDLNEi?= =?us-ascii?Q?bymrqh7F+Q2ml+f+Lfu5kSO++6RXTUCqmyArJGezvJLAi/oplBiF+tVzBogY?= =?us-ascii?Q?s6cOnpqQsMUkQ+qKmfIYy02FuyVFCaEiOTBgmAgrZ4FGpFtkoScfDYxvdGC6?= =?us-ascii?Q?7g/3GKO+nhDsguJUit9mI15wzLt8uWRGWP2lK0lQKaLxh58gNOl+TIg5GY55?= =?us-ascii?Q?cNqM1bvqjVkrUnauIrKvPVP35VQ4yFhOzobhIwJmVxmpFwkfB2wmYCs2s2tA?= =?us-ascii?Q?QrddDNfRluB5vKOzfc/AU6f+Uh1vdd5GSZ6/UwXLsZ3CSBC88SZOqMJZ2grW?= =?us-ascii?Q?MamOFZetgstORW4fKEvhigCentEQQERgmMvJaSYWrXwk23Mfo/e0eBcahH6b?= =?us-ascii?Q?FNsujS88wfJ5jp5rqLid5OwhZxAmpaz7XAwVJOak1pHrUrJO0yD5PYOV4em0?= =?us-ascii?Q?zdteqQJLJom/OmqA/i8VXxXmrGVh3275GPY41hLjazhFf/aFScwFDUl5WUS3?= =?us-ascii?Q?4OdU+gXaQeNFKcbmyEhGO3o+CvKKwM7shc5cMXCLPaCGcMoBhIBoT8jQiqxL?= =?us-ascii?Q?OpbAYUVmUzjLU3Hz2zgpq1bf0F4VQmQtJCW4cwhSB67ajcy59Y38E6jkcbqV?= =?us-ascii?Q?9Rhpqv4xb1DGoGnaCUqq9CsJ2Q63alTLAO4jNWvSV2H6Psncwp139GMtaDQQ?= =?us-ascii?Q?JfcmewATJ6otbdM3d4HiFnZPaVlUrH9tH1ELzluu+ywBZEf709c3pdGAlMR7?= =?us-ascii?Q?im1Ahkb/Vsb6RGsyKdRCyTrEpT5fb9UCo5PBAtU9mBbf8vTxKrP9i+CfzcqH?= =?us-ascii?Q?oh1+RTLdNZhcTxz21hthUwbA5bSa4dqrhm5NHx56fmwx7Q3Yo7u/FtAeRLMP?= =?us-ascii?Q?nbtjfY7xzkuJHuozA/OwwBb2REBZSLtpaJnBPTsIGrO8K+v5J8Y4SMNrxCNg?= =?us-ascii?Q?x2Cw3bsUkn7cZ5waKrerxJxHlPKbhaYRDHHTXBSfsMxz7vo3BSADcBPFBNG+?= =?us-ascii?Q?1ZS26OaZM0jzQywFvGLVOPyfBZWt47x2XbV3jQDuPd0LrD7qNj8IYCAghskj?= =?us-ascii?Q?66OLPbepd0a8Rvfhs2EgmhJEvnB6Hzt/AMfG0wOqvVWW2bly2QkudaHzEWAC?= =?us-ascii?Q?uJsBeHCvUiQBJeZ2hFn/huK/Y9dyHCcK+7rjuL+oHLfHX9Xrbnp3DABJIRTb?= =?us-ascii?Q?CnVroIM9cYgdAT8HoHkRI78bZfpNUhyqDGtEwKn3zxjRfsn6nCbJjsgodfib?= =?us-ascii?Q?WhhF222hdzPEOL5S1VfAScTifpvpczqFO1MapTbijcwuAXiWj88OHlCeVW1U?= =?us-ascii?Q?xmwWCSRBrzWB0u94JY9OIoIq4rigiyoNa1oEtUnl9pzsfNBns5RyyIaAyP+I?= =?us-ascii?Q?ppvO6PtQrNv8lFBdm+rd14MvMApN8X2dVj5f+S5j?= 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: a42b285e-f7ef-411b-a6c8-08dbe05eb5ac X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Nov 2023 13:29:18.2484 (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: Ah0grq6V020bvP1jrQTgPymQJqjcm08zISlwABZkeoieXNdHJPeFaZ+mqFwp/38T0hBCRvjbvs9QTVLmYsq2VA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB7523 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: 4OOo7eUS2GjJrpQBxsrNCeuFx7686176AA= 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=hPJpvvGk; 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}") Hi Liming and Mike Would you please review the MdePkg update? This patch was sent before soft freeze. I request that it be in 202311 release because this patch is required by th= e latest KVM/QEMU. This patch only impacts Intel TDX, and has no impact to other CC (AMD SEV) = or non-CC module. Thank you Yao, Jiewen > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Yao, Jiewe= n > Sent: Wednesday, November 8, 2023 9:21 PM > 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 V4 0/3] OvmfPkg: Update TdVmCall to hand= le > the retry for MapGPA >=20 > All: Reviewed-by: Jiewen Yao >=20 >=20 > > -----Original Message----- > > From: Sun, CepingX > > Sent: Wednesday, November 8, 2023 7:38 PM > > To: devel@edk2.groups.io > > Cc: Sun, CepingX ; Gao, Liming > > ; Kinney, Michael D > ; > > Aktas, Erdem ; James Bottomley > > ; Xu, Min M ; Tom Lendacky > > ; Michael Roth ; Yao, > > Jiewen ; Gerd Hoffmann > > Subject: [PATCH V4 0/3] OvmfPkg: Update TdVmCall to handle the retry fo= r > > MapGPA > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4572 > > > > According to section 3.2 of the [GHCI] spec, if the result is > > "TDG.VP.VMCALL_RETRY" for TDG.VP.VMCALL.MapGPA, TD must retry the > > mapping for the pages in the region starting at the GPA specified in r1= 1. > > > > Currently, TDVF does not properly handle the retry results of MapGPA. > > For this, TDVF should update the TdVmCall to return the value in R11 > > and must retry the mapping for the pages by the value. > > > > How to verify the retry for MapGPA in TDVF: > > Note: Since the range size of MapGPA in QEMU is limited to 64MB and > > TDVF always maps 1.5GB( 2GB~3.5GB) MMIO to shared-memory for TD guest, > > the retry action is triggered always. > > Pre-Config: > > QEMU: > > https://github.com/intel/qemu-tdx/tree/tdx-qemu-upstream | tag: tdx-qem= u- > > upstream-2023.10.20-v8.1.0 > > KERNEL: > > https://github.com/intel/tdx/tree/kvm-upstream-2023.10.16-v6.6-rc2 > > > > Step: > > Boot with TD guest and check the log with TdVmcall(MAPGPA), as below: > > TdxDxe:SetMemorySharedOrPrivate: Cr3Base=3D0x0 Physical=3D0x80000000 > > Length=3D0x60000000 Mode=3DShared > > SetOrClearSharedBit: TdVmcall(MAPGPA) Retry PhysicalAddress is > > 8000080000000, MapGpaRetryaddr is 8000084000000 > > > > Reference: > > [GHCI]: TDX Guest-Host-Communication Interface v1.0 > > https://cdrdv2.intel.com/v1/dl/getContent/726790 > > > > v2 changes: > > - Update the code based on the comments of v1 reviewer > > - Update TdVmcall to instead of the extra API file > > > > v3 changes: > > - Move the definition of TDVMCALL_STATUS_RETRY to Tdx.h > > > > v4 changes: > > - Split the patch to MdePkg update and OvmfPkg update. > > > > code: https://github.com/sunceping/edk2/tree/handleRetryMapGPA.v4 > > > > Cc: Liming Gao > > Cc: Michael D Kinney > > Cc: Erdem Aktas > > Cc: James Bottomley > > Cc: Min Xu > > Cc: Tom Lendacky > > Cc: Michael Roth > > Cc: Jiewen Yao > > Acked-by: Gerd Hoffmann > > Signed-off-by: Ceping Sun > > > > Ceping Sun (3): > > MdePkg/BaseLib: Update TdVmcall to always output the value in R11 > > MdePkg/Tdx.h: Add TDVMCALL_STATUS_RETRY > > OvmfPkg/BaseMemEncryptTdxLib: Handle retry result of MapGPA > > > > MdePkg/Include/IndustryStandard/Tdx.h | 2 + > > MdePkg/Library/BaseLib/X64/TdVmcall.nasm | 4 +- > > .../BaseMemEncryptTdxLib/MemoryEncryption.c | 41 ++++++++++++++++++- > > 3 files changed, 43 insertions(+), 4 deletions(-) > > > > -- > > 2.34.1 >=20 >=20 >=20 >=20 >=20 -=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 (#110913): https://edk2.groups.io/g/devel/message/110913 Mute This Topic: https://groups.io/mt/102461779/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-