From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web12.643.1630379354600457696 for ; Mon, 30 Aug 2021 20:09:14 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=ysffNlUG; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: min.m.xu@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10092"; a="205523182" X-IronPort-AV: E=Sophos;i="5.84,365,1620716400"; d="scan'208";a="205523182" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Aug 2021 20:09:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,365,1620716400"; d="scan'208";a="689633171" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga005.fm.intel.com with ESMTP; 30 Aug 2021 20:09:13 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10; Mon, 30 Aug 2021 20:09:13 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10 via Frontend Transport; Mon, 30 Aug 2021 20:09:13 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.170) 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.2242.10; Mon, 30 Aug 2021 20:09:12 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JJB7/8UVh7L6+PmaEhmZsRqxEyeO5unBCoxZeRiZQYdjYM3Iq3OL0OtmThCVG9VT2EHCHrxKB2jVR1WeWy8YzXlFUFbrooALZNn8u6/bKy2mGY4OfyYGpE0Dfge3QSoN10uBJSdCwo2qBB0LVb6VJac2tg1rElSRP5jJqYjnzys2xCowodWrPYXloAwk7PdaxX7zkEQsBXXOKfyLu7WiHFsoDf/VVxUDMhfAzbwZ4pRIQxI6qU4PqVbeNX287wZcxbG9H5kdV5uyremKBZef7VDImPnlW9XmblDIwps3ZIsz88BlRcm/Ufk8+XZAAfHwTxM0W4c9zkfsq2ZQZTjhTA== 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-SenderADCheck; bh=aMNJbYR4qc97TWy37ChWbmb774WoHzXKuYlHz5qfsKA=; b=aYRwwYy3B8WkW6ZQQRhpEgbCQuecjJGcfMQFdh0Ligpf3LBjUulvIKsdfwgl0w7M9sQ6bBJbqzf6zY9aS7xDtsRqQnXCma3xISnpCTQwMKhYMt8l/bvcTlUZY7KouQondtrZFK7WPpDI15v1FkOLB6gJKzYqo2eN//LWcfUINGw3y84HfYWQ6RQJY1ngSfa5K7uwniAixFQLD8+wErQDRvE8t2Au+vn/Zo4u48gNIWiN5r40E+K+SAH3CjQlWZbGxapoRrDnxjRiENEYkpgR8ayYHjrYz0e7dJ9wbQWTgggSmNp4vDS7sHMgcJzhNVi+eFSwPO+yshelfqH8oa+bRA== 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=aMNJbYR4qc97TWy37ChWbmb774WoHzXKuYlHz5qfsKA=; b=ysffNlUGC8gKRJ2+pLRDQy3K+Wv66rJ4EQkTgTNRi4v0J6nlv0f8dhFgNk2Tc4UQc5TU0cGl50ovTdeOqBslIlz5Na4ROkTdR4T3Q0aCfWM6rrv8dOcaaTFpvkDQT+fEto/Pmk+lNcC3pX2kzyeRchFA4o7tRUDCXhiwcg5i7rY= Received: from PH0PR11MB5064.namprd11.prod.outlook.com (2603:10b6:510:3b::15) by PH0PR11MB5174.namprd11.prod.outlook.com (2603:10b6:510:3b::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.24; Tue, 31 Aug 2021 03:09:08 +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, 31 Aug 2021 03:09:08 +0000 From: "Min Xu" To: "devel@edk2.groups.io" , "kraxel@redhat.com" CC: Ard Biesheuvel , "Justen, Jordan L" , Brijesh Singh , "Erdem Aktas" , James Bottomley , "Yao, Jiewen" , Tom Lendacky Subject: Re: [edk2-devel] [PATCH V5 2/2] OvmfPkg/ResetVector: Enable Intel TDX in ResetVector of Ovmf Thread-Topic: [edk2-devel] [PATCH V5 2/2] OvmfPkg/ResetVector: Enable Intel TDX in ResetVector of Ovmf Thread-Index: AQHXnUe8X7jjLtXUt0aYMxY+W+0FeauLqi4AgAFA1CA= Date: Tue, 31 Aug 2021 03:09:08 +0000 Message-ID: References: <81c97a782bbbf83043854ad8a86d14604918d788.1630289827.git.min.m.xu@intel.com> <20210830074058.22gfqmzrha4su6fh@sirius.home.kraxel.org> In-Reply-To: <20210830074058.22gfqmzrha4su6fh@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.5.1.3 authentication-results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 125db7f3-cd55-4d35-d1ee-08d96c2cb2f6 x-ms-traffictypediagnostic: PH0PR11MB5174: 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:9508; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: lG+7t/rhl/nExZ6i/0yFOMR+2Z3XOQeUBGjWIAsxHqDf2tF9kaFyPyqZ+QXcaxZY+DS4Tx0u6xNUW/WoLj2+dsdFfTNY50S0Y649u4hOZURjuBLy1oXQixH/i4PxL7aV+yB9oNcP4k1Zd4xz0EoIrWo/94ak06xY0QscuxiF25cgyNwrchY+mMikzC/C7mOQwilMPiDv9BhMtiwUPvLK9Et6hfNK2pR9hViQp7O003Dc+NOGl///wqxFM4FP9v+K9CgqdRWs0aB6gNfRIhlGzuKcmjbLhIotjn9cZM7HdbZnNpmQSbonSpRxdZyaUFQHTcBjH0aQIM1pHSs+tSLC4TAaTujiGt9VFeU8w1wvfUrNQpMF/CMhT+bfwtQs+RjLRQ06LncbYoPYuys773oJF3Ebj9AOATFyi2016b3YH9jWJn3KUYn9oLOqZoGvv2PTACXApXA1qVVdU3I0bg+kAn6LOGVt0A9JcGRrxJDFILf6ie0soWOqwWO/7dhY/UTBJ7wYbRcqv3vWpzSLT4vvvT45ziHlj0aWafqE9fD3b1YvFpoYRpVlChRZlrl1TGamciGhpzrIhkmdSUvjZYvV40s/nPUe41QT58saPIoqAXZG+GG1LHvdCHmotnB3pcbHaryQQO+oStii8BoQEZmBgdOfmkWpK/9srGS9HtA073Ru5BkqJ2dSgJ/jfNlrFRu9guqH/uuA7+I6b7HR+Aq0ZA== 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)(5660300002)(110136005)(8936002)(38100700002)(54906003)(26005)(186003)(4326008)(38070700005)(316002)(8676002)(122000001)(7696005)(9686003)(33656002)(66476007)(64756008)(52536014)(55016002)(53546011)(86362001)(6506007)(66946007)(66446008)(66556008)(2906002)(508600001)(76116006)(71200400001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?elLRQwKOHYxwNLKllwmuU2J5ESiM1W531BJGVaADL2ie00qLtuqNcjqbT6sZ?= =?us-ascii?Q?EUhUvlYId4Tno35ejBri/5rz/yHIUeWLmP98U1xlOjUzIBwjOKAuE7GPnYZQ?= =?us-ascii?Q?HFJfu0DWj97IYR2x+wZWDCwaM1L4XGKujARL27ahiFFL8D3cSFdkzowIBGPk?= =?us-ascii?Q?Hh1agDLkao2af35kxKTLy1g4oKHOCeMTYpyMq6ihv1nQblKugH2ndzowDDTO?= =?us-ascii?Q?s8k76uAyqlr1apTuN40Qyi/kn/v2LZ2lFptizhGeBbYNbL6Yzbws//0xa6hJ?= =?us-ascii?Q?NO3PosAgW6nWLwetol3BCOSQNBqJouAwKJy7vBoONTsi80wYskdr8o2o4tSk?= =?us-ascii?Q?Yj2ekc6kARcCilXunbME8dK0AOFy2SB5z16sYfWU45UyROsOy13VSbvudoHS?= =?us-ascii?Q?t9xobGpjWAOUsJhBkR9xAdjOrBIETuiHXFrAOZSTArRz9gufhJS1dygFBrKs?= =?us-ascii?Q?0cWSH9+MeD4+1M9GGAqpJXbRDGhmi4Ovzly5JYXIjgkh3Gi2izeTSXavwxKQ?= =?us-ascii?Q?PkWSmdlllB4c6i72psGR2LkgAFfgGwfWRzKv+KFQQN8+r8qEcUOOVzB1W52D?= =?us-ascii?Q?Bne3260sfaaeDJNGo6E94pPi1oZCDvO0F2yMuPwaps6qhyZUyLle5punq4ms?= =?us-ascii?Q?chWECV9V0qiHQan3PQzSdJony9v4jkU+9KpFHsTS4Ml/AG222szNM85/1AHo?= =?us-ascii?Q?I0HbJmmjMYkthG1K8E6zzGA+CZ13kMSBnrO2aw+Y8JQdp9gZ/R8mq6d71hN0?= =?us-ascii?Q?fDHaUN+OJeKB2gHpO8kKuzJrdLrJXrgxCl3A+DkZBRjCM9DumJYLhFt7WMiG?= =?us-ascii?Q?GGGOSHaaryOmaa50ZD/NGAZF5mimiE7IcTAoLgmCBExD+F/ZP7vm6IR6drq8?= =?us-ascii?Q?iqNEGCD9bnieKjxVqzXoFa1b6gjNJh8yolormynJ3Lh2qwHp+/gw4aYWjh0F?= =?us-ascii?Q?KIJshOUQSwHLyPXGqvUIeCBGq3++sdo/8DhxU1uOWhzqCpvbLBbjzeC/zA6W?= =?us-ascii?Q?wmkS6Xgz5q5DedRWwbHMblhdX1cHVxh0OOuJSQdDxhWxqD2QCvJLYTh4Bp1M?= =?us-ascii?Q?HOLRYt19R4nfhq3LI/EekQbOsUOKhFN2YBqzI/TYB6ZaqNaU+vA9I8OH0dEk?= =?us-ascii?Q?KPej76u/lXJfl+3vTdgDJyCxwNJgVT/8Of81SbtxEVTliIpA4buUMRjYzMrR?= =?us-ascii?Q?ihIQNtdsn1R3qSJ/etlmT2/8lFrdxw/5alFUOwt8USn0p2MCX3lCSDylImgR?= =?us-ascii?Q?w7xWakrGrlyy8OKEDAj2oIkxlUIAntSr1MxKeKwK9cT5ImrFD7MdKFSKEi+J?= =?us-ascii?Q?VdWL1wwp7Z/CaLRQlkyXJI+6?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5064.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 125db7f3-cd55-4d35-d1ee-08d96c2cb2f6 X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Aug 2021 03:09:08.4844 (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: h2RX3+3dtTCOntNNj7U2BqvZbR8Y5piy9oIOvhrwiWaJ+p8PXyRtOMui3lOKwpEWqDjdsKPDozio2tWNK4sjkw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5174 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 Monday, August 30, 2021 3:41 PM, Gerd Hoffmann wrote: > Hi, >=20 > > _TdxPageTable: > > If 5-level page table is supported (GPAW is 52), a top level page > > directory pointers (1 * 256TB entry) is generated in this page. > > _OvmfPageTable: > > Initial page table for standard Ovmf. >=20 > Hmm, isn't 5-level paging independent from TDX? Why mix the two? >=20 > I think a top level page directory should be added to the standard ovmf i= nitial > page tables instead, and setting up 5-level paging should not happen in t= dx- > specific code. In current Ovmf implementation (OvmfPkg/ResetVector/Ia32/PageTables64.asm) there are 6 pages reserved for initial page tables. It doesn't support 5-le= vel paging. TDX support GPAW 48 and 52. If GPAW is 52 we need an extra page to hold the= top level page directory pointers (1 * 256TB entry). This TDX extra page reuses the memory region defined by PcdOvmfSecGhcbPageT= ableBase In MEMFD. Because this memory region (PcdOvmfSecGhcbPageTableBase) will not be consumed by SEV code in Tdx guest. >=20 Thanks! Min