From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web10.8848.1632796223029526833 for ; Mon, 27 Sep 2021 19:30:23 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=Rhdpx4kp; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: min.m.xu@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10120"; a="224639721" X-IronPort-AV: E=Sophos;i="5.85,328,1624345200"; d="scan'208";a="224639721" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Sep 2021 19:30:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,328,1624345200"; d="scan'208";a="520286142" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by orsmga001.jf.intel.com with ESMTP; 27 Sep 2021 19:30:21 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Mon, 27 Sep 2021 19:30:20 -0700 Received: from fmsmsx605.amr.corp.intel.com (10.18.126.85) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Mon, 27 Sep 2021 19:30:20 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Mon, 27 Sep 2021 19:30:20 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.47) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Mon, 27 Sep 2021 19:30:20 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XI76e/Wkb834JQ45+uKIQ31EKmCRFvTcbq1mJCVap3KzDohk4tv5ifAvlf/FJ0Q6onpQdRk6/ZrLPc8fCAt9emKNBigafqzCy/nE1LoPvf6i7fadwA40Q7gUohk3CDAMHrotYIamIhDaUad3goBiKQm+B7tm9sQo4Ng6hky+S/DcSXJQhZRSkhAb5MP/NrMi4whYxAh/+H6VBLhDJjjbY+mwmm9FClNzez4SCiSZWgo9XSMn07VXjqwyPStGGEu+Huxq5eYl3ZgjUqwKENkg5JzCvJIKfqQ7ulW/70loJSfeN5FDJzy4gMpBTjf1d3RsHxiZmHb0U0/fAXLxQPiC7w== 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; bh=fhNWCexIMJ82/Ec01s1PfqyUSUrSV4duUvp3Ll1bMJU=; b=Xs0HNxONu8GACcD02ByTu9ZK1o+6/jb5Q4X0AoEtRYoqa8UPiWyUMcfGn2U4U7FI2CV3VPYCt+L9AzJF/ZkMQ194dEfWbCBEyJSrJ1wUWbq4aWkCblSS34xgjK7SIrcxzftY29BEYdW6M5oOGGK6kt/FewKgMIEbPh+clSd4QLGR3gJY5cLnaeKyJWIlMvNj3FKwMUVziH7+YzpvItSBpp28UeVZDqrafTvVr2w2ln5ORzY1oeKjNIG2xdSgcfIbl0zGPTMWWLK65YU9aH6H3kvLZE8OpwjSp0b2NxAulZHVxDbLTQIu94fTRgHksNoXGoo0Ib4wWCpT7GAE1fugjA== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fhNWCexIMJ82/Ec01s1PfqyUSUrSV4duUvp3Ll1bMJU=; b=Rhdpx4kpBMefnlAxNE5k71kK92tuaKD3S1kP7isAcBXRYXIjPtNKPUyqP8yGWd4q57ga+qwPhmftsOMmeHIvpcdK3pinh2S7vbOafPK+0ArQpcMKnjcn6MddrRk3/uX87ESO9SAuWqtDAs0+ok9GlAaG+4T6923zwPl4lCV9zPU= Received: from PH0PR11MB5064.namprd11.prod.outlook.com (2603:10b6:510:3b::15) by PH0PR11MB4776.namprd11.prod.outlook.com (2603:10b6:510:30::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.15; Tue, 28 Sep 2021 02:30:16 +0000 Received: from PH0PR11MB5064.namprd11.prod.outlook.com ([fe80::c93:200e:5aeb:e11b]) by PH0PR11MB5064.namprd11.prod.outlook.com ([fe80::c93:200e:5aeb:e11b%3]) with mapi id 15.20.4415.029; Tue, 28 Sep 2021 02:30:16 +0000 From: "Min Xu" To: Gerd Hoffmann , "Yao, Jiewen" CC: "devel@edk2.groups.io" , Ard Biesheuvel , "Justen, Jordan L" , Brijesh Singh , Erdem Aktas , James Bottomley , Tom Lendacky , "Xu, Min M" Subject: Re: [PATCH V8 3/3] OvmfPkg: Enable TDX in ResetVector Thread-Topic: [PATCH V8 3/3] OvmfPkg: Enable TDX in ResetVector Thread-Index: AQHXs0QwX8//s6Z2f0yRFpz23fm/qqu3kLSAgAEMVRA= Date: Tue, 28 Sep 2021 02:30:16 +0000 Message-ID: References: <729034c8d47013be1e87a68ba1b6c3a7b79a4b2a.1632707635.git.min.m.xu@intel.com> <20210927084235.pj7x2agzzzjqz7be@sirius.home.kraxel.org> In-Reply-To: <20210927084235.pj7x2agzzzjqz7be@sirius.home.kraxel.org> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.200.16 authentication-results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2d604488-07d0-4053-fbc0-08d98227e89d x-ms-traffictypediagnostic: PH0PR11MB4776: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Rx49jiYCE7GBvrkGP687CY5phk6/0t2PkGa75QSlJTTS2NYayvb1tTjGUY/7P0GM7/o4vgY/YZrN2bNqKeF8PLJ+Y6RDSCFcgQdSzCdg+uHt89Ap7z6MIRD4X7xT6bG6CQcM73YVPuoowQQCXj/RHtOh8+q0y7SDjfcbpen0noyKw29rtzvUgWxgMT3KkBS8FBeYhJoIswF0k9Z7C0jPUqwxN4GzL49qrd//XKS8sWofkb8Iyj4N0qiqFFWT5DuSYw29fuLFHy5lKNhcTh6J1eIBWsBjVI60CQ2CHtPIg/e/kp+30e4JaLAbiB3x7oF0VUkRyg/zsZhtCw1TBdhyqtWk8HAAUSFh1EHvtjqfIfP265TEuYvq5RwOnvCSNCdQq+lVA+plpN4kWV4jZORkpr8XEZUEb63AH89d24ecBEKR0P0QN2s40ZJttxQqXN7AoF1B0YoNd/QW173e4taShP8+MiiXUyIIrPYsV+5jy6LMMqkn1YfVrgSPSYQ8cJWv8Rch2FsoCoSTSMZGPqZHEnER71fqfg4cUis4ZLBFSBNKp6fdFy4vxfFXazAFD9tNdAH3MFWeXcHGoAeFFTFLL00gA9BbqffCXp4Ph4XQmjMY6r10K47cjqi9b8x5meR0OdfqGhv6x1j6zExpFlPRSgM/NXpxLCqwjROhNX4q0WVQO9Mwao0K7sG2ET7T6T71Sxc3T96KyshSJlgfsxN2Qw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR11MB5064.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(186003)(110136005)(52536014)(9686003)(316002)(33656002)(55016002)(5660300002)(8676002)(7696005)(26005)(107886003)(2906002)(86362001)(54906003)(6506007)(8936002)(4326008)(122000001)(76116006)(71200400001)(6636002)(38100700002)(66476007)(508600001)(83380400001)(66556008)(38070700005)(64756008)(66446008)(66946007);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?UgaOCG4UdcpTHwJ3Pvt1NlGyZeQ3TqCwyZopjwsehFloZLSonDiY3XUIeM7a?= =?us-ascii?Q?WDgghfxX27VHxIP4wjEugjMaWSOxebtTUHa1Z/JBIyBPwbWCodJoJsL+9gSS?= =?us-ascii?Q?LPvbY/GiqZU1/fGFaPlmDOtLcVmR6biR8ypScEekyqs3vCpw0QoO0ug810Ni?= =?us-ascii?Q?+w1My5ArI4snjXJNCcUUzu1v/r8YDOHJRgcugko0opSDQWIyrBzMBc7MXyPy?= =?us-ascii?Q?fplOn+YoQHPyEbgebajfakEbYvdzNNAOuU819vGeBA4HsivmFkVnuJUDFe8y?= =?us-ascii?Q?LuGPAzqf77lP79pzi5IEba7d8y0YtneQ/dwASlFhX8i4Z63tThIoincCCxho?= =?us-ascii?Q?wJFI20UjLVIwa4jW79OechRV5ncHwSCzR5kFgEXOU/yNDYScYtPDycl4wH6P?= =?us-ascii?Q?1EkX37jGizHXXzk+QLa4aQbNyDvVoiieXSEYGnwjHBbRA9OSKaPyYB2yyBSY?= =?us-ascii?Q?uJrPU1WPl/Y7tHAl4JCVEbe5N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As: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5064.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2d604488-07d0-4053-fbc0-08d98227e89d X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Sep 2021 02:30:16.6095 (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: +xetOt8a6RSmazpCozuu8HUe+96uThmLK1/WquO5MBgwLYMcGviMVX3Tza4VnsZEctXikwToDvQ7sOAQ8Z4Oqg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4776 Return-Path: min.m.xu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable On September 27, 2021 4:43 PM, Gerd Hoffmann wrote: > Hi, >=20 > > +_Bfv: > > + DD TDX_BFV_RAW_DATA_OFFSET > > + DD TDX_BFV_RAW_DATA_SIZE > > + DQ TDX_BFV_MEMORY_BASE > > + DQ TDX_BFV_MEMORY_SIZE > > + DD TDX_METADATA_SECTION_TYPE_BFV > > + DD TDX_METADATA_ATTRIBUTES_EXTENDMR >=20 > Size is still added twice, doesn't make sense given that they are either = equal > or RAW_DATA_SIZE is zero. One size field being 32bit and the other being > 64bit is pointless too (see also my mail to Jiewen). > Gerd, I would like to hold on until Jiewen and you reach consensus. Thanks = for your understanding. >=20 > > + DD TDX_METADATA_SECTION_TYPE_TEMP_MEM >=20 > There are a bunch of TEMP_MEM entries, some of them are next to each > other in MEMFD, so you can squash them into one entry. Below is the layout of MEMFD (Used by TDX) I will squash the TEMP_MEM entries into one entry if they're adjacent. For = example, Mailbox + WorkArea will be squash into one entry. But the Heap/Stack cannot be squashed with Mailbox/Workarea, because there = is a memory hole (0xD000 - 0x10000) between these 2 entry. +------------------------------------------------+ 0x20000 | | | PcdOvmfSecPeiTempRam | * Tdx Heap/Stack (Mem)* | | +------------------------------------------------+ 0x10000 | | +------------------------------------------------+0xD000 | PcdOvmfSecGhcbBackupBase | *Tdx Mailbox (Mem)* +------------------------------------------------+0xC000 | PcdOvmWorkArea | *WorkArea (Mem)* +------------------------------------------------+0xB000 | PcdOvmfSecGhcb | *TdHob (HOB)* +------------------------------------------------+0x9000 | PcdOvmfSecGhcbPageTable | | PcdGuidedExtractHandlerTable | | PcdOvmfLockBoxStorage | +------------------------------------------------+ 0x6000 | | | PcdOvmfSecPageTables | *PageTables (Mem)* | |=20 +------------------------------------------------+0x0000 >=20 > Can you move the metadata changes to a separate patch please? >=20 Yes, the metadata changes will be in a separate patch in the next version. Thanks! Min