From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web09.6242.1632478314911528771 for ; Fri, 24 Sep 2021 03:11:55 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=tpPn4jtr; spf=pass (domain: intel.com, ip: 134.134.136.100, mailfrom: jiewen.yao@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10116"; a="287713233" X-IronPort-AV: E=Sophos;i="5.85,319,1624345200"; d="scan'208";a="287713233" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Sep 2021 03:11:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,319,1624345200"; d="scan'208";a="535360595" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by fmsmga004.fm.intel.com with ESMTP; 24 Sep 2021 03:11:53 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Fri, 24 Sep 2021 03:11:53 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Fri, 24 Sep 2021 03:11:53 -0700 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (104.47.73.43) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Fri, 24 Sep 2021 03:11:53 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lRfFRkIYs/Z+9C6X4OL2d+OTHZHxCtb9isEdVQIneH4T27WE3YmjUpwPQ/yt7CUNrt4FUC6qMVJ29IPXCXBLltItxV1DBDWbGy7AZDaVOxhNeke2WflJ06xHp+TzpIzBIe7LxZRVbBeNpwCWPYaAbNZEZqskSgPXCCfjYCV3kqhr7KSAIWJWGJc05FqKy6fgU9ilLcpbcnb7UNOdMtBx2FtUHKOUD0flPipeR1aPv0RLCQYwarFIr2zCh4YUde8MpTCRvZt640NlV+ujoxttk3GK++ZghNqikwqBE+VSOZok0wkOiCcoIuZd59z98bdz8j+wBZZ4TLFbWBT6p+WqoA== 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=1310bZGTMm3V4xrafPKlkIhfz8xuebZgcsoTiZLWBKw=; b=XOptmqJuezx/qBRTkSt29Nr9yw3d4+Xi/L/ZXh/XYnGPNNJlY481zhW1d702w7bAzYuYW4jiReknZ9tDcU8X3sNQ92EyJw12hCMeqp7qcpDapcTlQNn2x8WYkQrk7pbKkN5ZZS1Yw5s7oJFEzim1UbR3iEfdJ3Eg05BTlbR7B9kQMyPLp/4Li5O7dgERhhQ2u65YOOpFgiNWQCgCasyKqZb10eXndDG9CrNTCEwO2YX3GbLKTsUV3q/he71XuqoA2zj4Png4EE5PGhzilqBtCBz3ewrhJFivcGTo91cu/aw656HbKRUe50GgKOKh6YQi/UwKx7VqU5PXOTam0URx6g== 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=1310bZGTMm3V4xrafPKlkIhfz8xuebZgcsoTiZLWBKw=; b=tpPn4jtrM+eZuPgPChsqfk1M/4BrBSJOJTwy8qJOLbQHhx0gjC8ksessCetWi40emaIo4IPm3f6gYY2NL7z5pS0FrJuPE5KvlkyWfCDd73WsVoFG0F7lwmXnKHKEhUhjwRtv/3wSyHzq8FNaPLd+0YIbyDET5lzp6DJ7IiTSL7s= Received: from PH0PR11MB4885.namprd11.prod.outlook.com (2603:10b6:510:35::14) by PH0PR11MB5144.namprd11.prod.outlook.com (2603:10b6:510:3e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.14; Fri, 24 Sep 2021 10:11:51 +0000 Received: from PH0PR11MB4885.namprd11.prod.outlook.com ([fe80::754e:42e9:16cd:1306]) by PH0PR11MB4885.namprd11.prod.outlook.com ([fe80::754e:42e9:16cd:1306%6]) with mapi id 15.20.4544.018; Fri, 24 Sep 2021 10:11:51 +0000 From: "Yao, Jiewen" To: Gerd Hoffmann , "devel@edk2.groups.io" CC: "Xu, Min M" , "brijesh.singh@amd.com" , Ard Biesheuvel , "Justen, Jordan L" , Erdem Aktas , James Bottomley , Tom Lendacky Subject: Re: [edk2-devel] [PATCH V7 1/1] OvmfPkg: Enable TDX in ResetVector Thread-Topic: [edk2-devel] [PATCH V7 1/1] OvmfPkg: Enable TDX in ResetVector Thread-Index: AQHXrsfv6qwUC8Li5kiwlPdQeu+jg6uvry6AgAEZ5ACAAIjkgIAALkqAgAAWigCAAAcDAIAAA09wgAEBxwCAAC1eAIAAIOIAgAAIgtA= Date: Fri, 24 Sep 2021 10:11:50 +0000 Message-ID: References: <12721dade1f2f9905cc34271d9abec24650442ff.1632214561.git.min.m.xu@intel.com> <20210922074929.e5iwf24t6wyndgbu@sirius.home.kraxel.org> <20210923084821.yxizus3loa2p6hms@sirius.home.kraxel.org> <7c9aeb95-5c33-bd8d-4f0c-40133f4c7c3d@amd.com> <20210924045416.3vb7qxcetgtdggbs@sirius.home.kraxel.org> <20210924093420.xu7kmfnygy4lx7um@sirius.home.kraxel.org> In-Reply-To: <20210924093420.xu7kmfnygy4lx7um@sirius.home.kraxel.org> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.6.200.16 dlp-product: dlpe-windows dlp-reaction: no-action 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: 0dd37f82-2dfc-4a32-9b12-08d97f43ba14 x-ms-traffictypediagnostic: PH0PR11MB5144: 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:10000; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: cmBoBjognfCvEOnErExO0DHfnwzZGjTrG8dtI3Yt/75Yjrxol8xAC1/xOMzJrq13VAFbfP8kCC+ABFL7/D5A8sIN61PPwh1PdhALcyHAr5kpOThA8BX5sGy36d1/wdd1h+bkaVvGns4Euj/Z7QwyRWH4l13WnqUZ7kGW6/YEaRgFrRFueK+Mo8sw/lWazXVtd7zjEje8wVe7KsO7pzgmyR5sAzD/gnOeubhefIZlP0od0iQh+Nu59g/2mpWPA43j832gzb6gqgHfl/FLgLCPU+kwkCreh54mwiAnI+QaZZVyAXIVsXOuSiN8zLeW33WcGnNYPB/GYe7UvdMRB5FZaU0pm3nQ+6QUYJX3z3cTzOSj1WIwv28XwW/pgFYCtIUzbUy8HeJ+kKSU+ixY5DZE+PwFWcTtDzXtI+C6B1OksAuZFvE4n1RaTXBrs2vT/RyXlfuhfR110Qpqw+0JaJPIkm9eGNa027x2giMo9JqKFeYB5ZNmrio8E42nr2hKLyFoIGl631KAGMIF8mnoWRTsnQ6BRl2LlgF29VksPshzz5JnZyroYzWwl7Ni7TgwsvNM8rbSDX10H1j38KqJ4QEa71xEGYC0eFvooOrKlgiNtfG3kjKpFXQmRdBPPiByOrR96L70Dzst4bvReIH8C5d+OML3XwMTVEmtL8a3JwRQEgvLr+VTbPJgAhmCtTE9WUc8DyeB9NoQZ6pIzJwDAjZFrSP/Y+LyICgI1YjjByB1uruOvBiERevBN616CbAr8NZOuxmBXNhSXELKcthO1kHbCSRrfDf0eRZBlC5d/kvsKs+Ko/GNY4/88qnJGkOVHd+WYXX8wGP7fNE0tmCxoPVE2w== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR11MB4885.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(53546011)(55016002)(9686003)(66556008)(8676002)(966005)(508600001)(8936002)(2906002)(7696005)(26005)(83380400001)(186003)(6506007)(54906003)(316002)(38100700002)(122000001)(110136005)(33656002)(76116006)(66476007)(86362001)(66946007)(5660300002)(38070700005)(52536014)(4326008)(64756008)(66446008)(71200400001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?bWHEmM52KixKCHp2AiiIFLqLrrqdjmw85Ta/wgNevISYasjVVG4OO0stAHSf?= =?us-ascii?Q?URnnCQVdPSoaQEcI9ndpgrGUS/UiW7AA1HVY/Buxk4ALk+ecAQ8YHK0xEVN2?= =?us-ascii?Q?GHej5lBEXzlK185ZrDILsQPLfpsN8Y5X4EqT1KGZmY/k+OOnNHVL8F0fuyRQ?= =?us-ascii?Q?Q1iJ0jKwBkbtw21ke7M4Uit14AsXQm2PSerBGYNVdILvEqaqMKm+De4zfil+?= =?us-ascii?Q?Jy2SbwQwlild4R15+gGIWMcw2D9/6poUzvlzdrtxlyOBU/2jCOTDfvuwRNAu?= =?us-ascii?Q?kzUhR93AOYpe+WHDl/EXdj0EYdJeLaKMjCb0zNoFRczNVpMVK2126AGJsYQW?=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KiWecfv6FaJNaTxKrhjv1?= =?us-ascii?Q?Jp285RMNJQ/kJdNRAy6TKgBrF9LJ7qT4/NhQqmckz70JedfEEHtmHEAMSNvw?= =?us-ascii?Q?rTJaHzvillDfoKzr+8g+XA/S?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB4885.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0dd37f82-2dfc-4a32-9b12-08d97f43ba14 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Sep 2021 10:11:50.9581 (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: ZepBl84lXPP1VmlWc03nBVhpARZReKRl8B7UAsgXO8i1GA+m0bJ6BQuz6eYa027RsNYxK7hpcVZMk7yghC7sig== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5144 Return-Path: jiewen.yao@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable You are right. My statement for page table is wrong. Both TDX and SEV need = them. That is NOT our original design. But I can understand why it is changed tod= ay. I compare https://github.com/tianocore/edk2-staging/blob/TDVF/OvmfPkg/Reset= Vector/X64/TdxMetadata.asm and https://github.com/AMDESE/ovmf/blob/snp-v8/O= vmfPkg/ResetVector/X64/OvmfMetadata.asm. There are 8 entries in TDX, and 10 entries in SEV. 2 of them are same, page table and TEMP RAM. 6 entries are TDX unique. 8 entries are SEV unique. I still feel it is burden to merge them, because some attributes field is N= OT required for SEV but needed for TDX. And TDX parsing tool need rule out SEV entries, and SEV parsing tool need r= ule out TDX entries. Thank you Yao Jiewen > -----Original Message----- > From: Gerd Hoffmann > Sent: Friday, September 24, 2021 5:34 PM > To: devel@edk2.groups.io; Yao, Jiewen > Cc: Xu, Min M ; brijesh.singh@amd.com; Ard Biesheuvel > ; Justen, Jordan L = ; > Erdem Aktas ; James Bottomley > ; Tom Lendacky > Subject: Re: [edk2-devel] [PATCH V7 1/1] OvmfPkg: Enable TDX in ResetVect= or >=20 > Hi, >=20 > > > > Type: OVMF_SECTION_TYPE_SEC_MEM also seems for SEV. TDX does not > > > need this special memory, such as Page table. It is already covered b= y code. > > > > > > These are "needs pre-validation / pre-acceptance" regions. > > > TDX surely needs that too. > > I don't think TDX need this. The page table should be covered by CODE a= lready. >=20 > I think you are wrong here, the patch has this ... >=20 > +_OvmfPageTable: > + DD 0 > + DD 0 > + DQ OVMF_PAGE_TABLE_BASE > + DQ OVMF_PAGE_TABLE_SIZE > + DD TDX_METADATA_SECTION_TYPE_TEMP_MEM > + DD 0 >=20 > ... and a few simliar entries. >=20 > > > > I really cannot see the benefit to merge into one table. > > > > > > Keep reset vector small? > > > Have common parser structs and code? > > > > I think it is opposite. This proposal makes reset vector larger, if we > > need define more structure to satisfy TDX, but it is not needed by > > SEV. >=20 > The sev and tdx specific entries will be there anyway, no matter > whenever we place them into one or two separate tables. >=20 > Shared items like the page table memory will be there only once > when we use a unified table, but twice with two separate tables. >=20 > take care, > Gerd