From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web12.15428.1627199211453433046 for ; Sun, 25 Jul 2021 00:46:52 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=UFJkMm6C; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: min.m.xu@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10055"; a="191668532" X-IronPort-AV: E=Sophos;i="5.84,266,1620716400"; d="scan'208";a="191668532" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jul 2021 00:46:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,266,1620716400"; d="scan'208";a="503327542" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by FMSMGA003.fm.intel.com with ESMTP; 25 Jul 2021 00:46:45 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) 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.10; Sun, 25 Jul 2021 00:46:45 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10 via Frontend Transport; Sun, 25 Jul 2021 00:46:44 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.101) 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.10; Sun, 25 Jul 2021 00:46:44 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h/7UaWLfbJCAERTSi1a/wwBUVDBXBn3+BZj00C46b6SnP3IQ8l0ni62410A26Q0rof5zLhhbjINUxJ/iXPCfkib0djGIdXdpgCyIAHrWY9iW74cqiDtJCK9v8YcLqSs7VMulFhTph9vCWRpJeiAqIQFyeY0PuLuVbQ4R1zRsXVN5Hc0Al5lqvVrdGB/sziWQKHKp+3VwKA4GyKiRFAVbR4TcEJog23tV4Spm2BJ5kvJXf8nY00YMNoKZaSH/BrkG+s9SlqzWLd44VRRk37++2ZzMJy/iehnR6h+/iv7ve3EvYmqtqfaB8/tHzf2ISCh0/nkurzY+5TGBxYlvtr526Q== 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=xDxJvE4P7V+V2YtNCvETCpgQ5eR2wDBjsYQQiE3+cCE=; b=kKLw5Kldlg99FQ+CcEn1TNisczeJLQWAdYlob5zL36DMk1k52kF9WQCOjACvkdkZx/1Ht79SwJ+mvHfrex/KxO275Qyt+Dkw2Nh/id0XRh1WGLMBQ2vbmQnm7bIFaXz66wyqH9ysfGQ+hq7SiwCXgoJTHOuWZCG8Z71e9ZZ1lgzAZvq4bhKUynV/XisdfIHbO/MXK4jtRD7hDc3A5KWGNRH3EXjs49t/lX/1etktD8j6tP1IKEQR/GjTLwZR05RSEDxv2w2xUyXWcFsSRP015sneOSvm355Gq57BqKO8aGTVXUdUZr8uWkK2TxcF7LUVG6aKxS1q3hg5gRSVOtab5g== 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=xDxJvE4P7V+V2YtNCvETCpgQ5eR2wDBjsYQQiE3+cCE=; b=UFJkMm6C3kFbOxXFPju09egw/O/8B+icQpTlkKTkNSml6XM1E2kQdwrhZwqC9fCf1Te2pUwWaaCi+ZPn1cs7fQo2HHZ7W5hxZ2DcqFs3Icqm8ziEugNaD9MHHjvYQUdVgu/T4xAhrhtPcVAHO2qAJaJONCbzLYKOhhI5Z4WbY7g= Received: from PH0PR11MB5064.namprd11.prod.outlook.com (2603:10b6:510:3b::15) by PH0PR11MB4808.namprd11.prod.outlook.com (2603:10b6:510:39::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.25; Sun, 25 Jul 2021 07:46:43 +0000 Received: from PH0PR11MB5064.namprd11.prod.outlook.com ([fe80::b4be:3994:dd4d:7b9d]) by PH0PR11MB5064.namprd11.prod.outlook.com ([fe80::b4be:3994:dd4d:7b9d%7]) with mapi id 15.20.4331.035; Sun, 25 Jul 2021 07:46:43 +0000 From: "Min Xu" To: "Yao, Jiewen" , "devel@edk2.groups.io" CC: "Dong, Eric" , "Ni, Ray" Subject: Re: [PATCH V2 3/4] UefiCpuPkg/ResetVector: Add Main32 entry point in Main.asm Thread-Topic: [PATCH V2 3/4] UefiCpuPkg/ResetVector: Add Main32 entry point in Main.asm Thread-Index: AQHXfr3dcRe9p4x1R0qwI00q4k6vZqtTOUmAgAAYdCCAAAJRAIAAAMrQ Date: Sun, 25 Jul 2021 07:46:43 +0000 Message-ID: References: <385d5e4bc26eb601a1ee6eeb982d5cde06ceab2a.1626931332.git.min.m.xu@intel.com> In-Reply-To: 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: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9068a33b-f646-4bd8-5db1-08d94f4058b0 x-ms-traffictypediagnostic: PH0PR11MB4808: 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: PjuyCQYTcHcqIwYPb9cPJ5Iuv2Jv5iKhtMa/ZSArPETyV2Nt5QRSla6tZhIrClzEPRQAiydH03LBIg6Qvmuns2nOHeTWxFA5JT1+9ZBkG25pmQZV2kLe/MbE41Cf+sElcTEW/TWWSqViAi0DR3Ci5dp203TW4hX2rUBj4RbVy6fFxaNkqizj6pNdhl9+E8bN0tbiESdcsx4IoltBOA6xyuyYpvFs2gkIWkpKNO52GFyMPbs9lVIrBFh8TF525Yq53ghCndWEF/tMQpq7TYURZOLYJ/sw+REYOfuzFrjuaFUSfDdd/8JhZ7VRbXmz4OlcdgvPD8BzY/4fcTwvq7nN4gOCQHqPv91BfPOfUS8RS4ulsVPZt4tdmhv3pHR4VaGDBFkpLXVQiM8CUIjA+4uwfZ4qvM6ogLMnCaGwae0qNFPxcmE0tLdtBnabD6A94P8VpjRxDgF4m8E8PCeC8jftVebvwSzIjpD37pbTpKpag9Doag8jJd1ANzbR0NErLgCfHNW4vmbmd5FSKxfOhxGaOmRWtyXvyIEXbqvNP2gX1WZuS04UizdvDjkQ9ZMD0zjD+VGCPOipSgx52Vs9dt0DpT7n/9Ms1Q0c2bba+V7Ag9PnQZRjdpJmsbk5NwHjpqhwpjYdF0bWqIoGCHYU2Q7gj270fJGCGs8sSvqLMjOhDanwVVTvFt/48QE2y3Hmx4husxZrv+2nmT5tRkzA8/+T+bPnCG4dUTVrtLoPfsDth5mYKLl5MFcOwKyHxkM3vh6FBkE2NlPPzUDu9UP4EEiHwftZKdGzyGup1IG/CixEn8I= 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)(376002)(136003)(366004)(346002)(39860400002)(396003)(316002)(54906003)(5660300002)(478600001)(53546011)(6506007)(9686003)(86362001)(7696005)(110136005)(2906002)(26005)(55016002)(966005)(8936002)(8676002)(71200400001)(83380400001)(64756008)(66556008)(66446008)(66476007)(76116006)(4326008)(107886003)(66946007)(33656002)(38100700002)(19627235002)(122000001)(186003)(52536014)(38070700004);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Qxl0lwNjqIHIr4QkAzhgXWRbS1gsOS/SVrJWkshBOZCOstewgijruhNnDRzl?= =?us-ascii?Q?6HY/2Eq+Gh7K1Ta9k7205/AEHguqpcB6V73UDIwLOYJlQVNxw/5oP8ojdQbc?= =?us-ascii?Q?DiZiwteOR7f2OUfGlSKfUe9Sr4Ub8+f10pvnjlI55zbmuXI3pPKz98jaudGD?= =?us-ascii?Q?gtfXYPhTB3G56qV86abV0WfeWYUUJ/W/r3/zCvV/Q3nGglom8aptNje+thAF?= =?us-ascii?Q?2NgqyJUOAH8YqJKDx9wKIIWwTM9c7XrNhOGvtTLF5bdgaSKxzpCdgrTzJnYY?= =?us-ascii?Q?V/ah5FLFxQjxDczMUCqLJMCtcxwEvEu25SDFgMASfaFsBDD/DK6WVxSohnlb?= =?us-ascii?Q?bZDFVdDUCL0Mr5z8co2Rv6cFu8ZM1u9T3zqGLJxmbf0dH3ZeO6DEcxPr5sT7?= =?us-ascii?Q?rSqbw0Ag0ia/0N4l8b/s53/vC9ROkkUEP8WGBeFWEvk32HPt8J7fOMrK869h?= =?us-ascii?Q?pubtW+rmj95XzyCpjsyqF194Ri10rCShDz+IYt/WeNqyF9l3tS9hxUzNKoTD?= =?us-ascii?Q?59bGqdpL+Mem7CZcnO2EY+3wV5tx0kYAoK+l0Vc6wu3kIdVRd7NUDY3zBjHG?= =?us-ascii?Q?AFmcI4ACkjfQKaPTqv101BU9aMtAiDR0pN0jUqMwWql7hPaqftfhycHuiR2o?= =?us-ascii?Q?DVjitjAOuS40745GPZvZ5RK7YptizMNeCJnOqoJNehrNRT3TQclynn1oVKkx?= =?us-ascii?Q?HoGpgxxTvyRWmFejwiDbg5Xmn4mHkfvm8hEfU/X0hzFPM2UfmT/qR0GxntEK?= =?us-ascii?Q?HsXGc8dU1DCQze1MrAoSARIkYQZolecGL5yDwATsPTVAQYGcxFwfBR+uPmG6?= =?us-ascii?Q?9uaHV3jBIay6MhtLSUK9qwI3y9fQ+KFPmJO5SKgBwAtqIQjjIxo8ituDRuRd?= =?us-ascii?Q?15KEBijGglJ4xsseE/sNnG2a1vG2dEldt331o8wqGGCBA+/vTVOUzA4/LXfR?= =?us-ascii?Q?v9mUbhuIneaMPXD5DJYZ55/EXI/APe14DJHTEY48SRJEdzR7PPRi9ZLiYbkS?= =?us-ascii?Q?xvRZETDtfiydm/dPBvWjFXH9Klw0VUB6y62VGj3rjwYacn9mHoyHORyxCYqB?= =?us-ascii?Q?f1GmxFK0iv7aQGAAPrX8QH7WkuB/nd9xpln5pjvvnlbQuJaeo/k/bKSGxpXB?= =?us-ascii?Q?dMRjSMrAOf0foYlNvA/nLc25wcs3WsloVqHDTDCTLCs17QFVa1p8ciUQgp57?= =?us-ascii?Q?xhnYxLhS42V33BIE/Ep0ydUnqsL2T3YNkY8Z+QPNeN0yV6yPzpFP9i+6/hse?= =?us-ascii?Q?UP8zeC2G/l/HLIdruH9ncvIivOuBLAJIwp4K/HHRU5cVlPhgtuwJ3aT1vH+a?= =?us-ascii?Q?ahqGd4y7jlyBxamZe5RqRq79?= 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: 9068a33b-f646-4bd8-5db1-08d94f4058b0 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Jul 2021 07:46:43.3005 (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: oUsRUpj5+mVdBMi/gruLtqEa4AiBQUtAYwSoFWqP73tWU885mtN0Y3TVlE2bpBGED+/PityN700KT0V90bJIHg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4808 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 I see. I will update it in the next version. Thanks! > -----Original Message----- > From: Yao, Jiewen > Sent: Sunday, July 25, 2021 3:44 PM > To: Xu, Min M ; devel@edk2.groups.io > Cc: Dong, Eric ; Ni, Ray > Subject: RE: [PATCH V2 3/4] UefiCpuPkg/ResetVector: Add Main32 entry poin= t > in Main.asm >=20 > Yes, if that can avoid the UefiCpuPkg change. >=20 > > -----Original Message----- > > From: Xu, Min M > > Sent: Sunday, July 25, 2021 3:42 PM > > To: Yao, Jiewen ; devel@edk2.groups.io > > Cc: Dong, Eric ; Ni, Ray > > Subject: RE: [PATCH V2 3/4] UefiCpuPkg/ResetVector: Add Main32 entry > > point in Main.asm > > > > On July 25, 2021 2:08 PM, Yao, Jiewen wrote: > > > Current OvmfPkg Reser vector is a mess (see my previous email). > > > I also compared the ResetVector code in UefiCpuPkg and OvmfPkg. > > > There are already duplication/override. > > > > > > I suggest we just drop UefiCpuPkg change, and focus on improving Ovmf= Pkg. > > > If we need add something in UefiCpuPkg, let's copy the file to > > > OvmfPkg and update there. > > > > > Do you mean we create the Main.asm in OvmfPkg/ResetVector/ and update > > the changes in this Main.asm? > > > > > > I really don't want to mess up UefiCpuPkg at this moment. > > > We can make a better architecture to share reset vector in virtual > > > BIOS and physical BIOS later. But at this moment, let's finish the > > > virtual BIOS architecture at first. > > > > > > Thank you > > > Yao Jiewen > > > > > > > -----Original Message----- > > > > From: Xu, Min M > > > > Sent: Thursday, July 22, 2021 1:52 PM > > > > To: devel@edk2.groups.io > > > > Cc: Xu, Min M ; Dong, Eric > > > > ; Ni, Ray ; Yao, Jiewen > > > > > > > > Subject: [PATCH V2 3/4] UefiCpuPkg/ResetVector: Add Main32 entry > > > > point in Main.asm > > > > > > > > RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3429 > > > > > > > > In Tdx all CPUs "reset" to run on 32-bit protected mode with flat > > > > descriptor (paging disabled). Main32 entry point is added in > > > > UefiCpuPkg/ResetVector/Vtf0/Main.asm so that Main.asm can support > > > > the 32-bit protected mode. > > > > > > > > Init32.asm is the 32-bit initialization code. It is a null stub in > > > > UefiCpuPkg. The actual initialization can be implemented in the > > > > platform (OvmfPkg/ResetVector/Ia32/Init32.asm is the example.) > > > > > > > > Cc: Eric Dong > > > > Cc: Ray Ni > > > > Cc: Jiewen Yao > > > > Signed-off-by: Min Xu > > > > --- > > > > UefiCpuPkg/ResetVector/Vtf0/Ia32/Init32.asm | 13 +++++++++++++ > > > > UefiCpuPkg/ResetVector/Vtf0/Main.asm | 14 ++++++++++++++ > > > > UefiCpuPkg/ResetVector/Vtf0/Vtf0.nasmb | 2 +- > > > > 3 files changed, 28 insertions(+), 1 deletion(-) create mode > > > > 100644 UefiCpuPkg/ResetVector/Vtf0/Ia32/Init32.asm > > > > > > > > diff --git a/UefiCpuPkg/ResetVector/Vtf0/Ia32/Init32.asm > > > > b/UefiCpuPkg/ResetVector/Vtf0/Ia32/Init32.asm > > > > new file mode 100644 > > > > index 000000000000..0cdae4a4a84a > > > > --- /dev/null > > > > +++ b/UefiCpuPkg/ResetVector/Vtf0/Ia32/Init32.asm > > > > @@ -0,0 +1,13 @@ > > > > +;---------------------------------------------------------------- > > > > +---- > > > > +---------- > > > > +; @file > > > > +; 32-bit initialization code. > > > > +; Copyright (c) 2021, Intel Corporation. All rights reserved.
> > > > +; > > > > +SPDX-License-Identifier: BSD-2-Clause-Patent ; > > > > +;---------------------------------------------------------------- > > > > +---- > > > > +---------- > > > > + > > > > +BITS 32 > > > > + > > > > +Init32: > > > > + nop > > > > + OneTimeCallRet Init32 > > > > diff --git a/UefiCpuPkg/ResetVector/Vtf0/Main.asm > > > > b/UefiCpuPkg/ResetVector/Vtf0/Main.asm > > > > index 19d08482f831..4920c6937e1b 100644 > > > > --- a/UefiCpuPkg/ResetVector/Vtf0/Main.asm > > > > +++ b/UefiCpuPkg/ResetVector/Vtf0/Main.asm > > > > @@ -36,6 +36,20 @@ Main16: > > > > > > > > BITS 32 > > > > > > > > +%ifdef ARCH_X64 > > > > + > > > > + jmp SearchBfv > > > > + > > > > +; > > > > +; Entry point of Main32 > > > > +; > > > > +Main32: > > > > + > > > > + OneTimeCall Init32 > > > > + > > > > +%endif > > > > + > > > > +SearchBfv: > > > > ; > > > > ; Search for the Boot Firmware Volume (BFV) > > > > ; > > > > diff --git a/UefiCpuPkg/ResetVector/Vtf0/Vtf0.nasmb > > > > b/UefiCpuPkg/ResetVector/Vtf0/Vtf0.nasmb > > > > index 493738c79c1c..6493b9863c48 100644 > > > > --- a/UefiCpuPkg/ResetVector/Vtf0/Vtf0.nasmb > > > > +++ b/UefiCpuPkg/ResetVector/Vtf0/Vtf0.nasmb > > > > @@ -51,7 +51,7 @@ > > > > %include "Ia32/SearchForSecEntry.asm" > > > > > > > > %ifdef ARCH_X64 > > > > -%include "Ia32/Flat32ToFlat64.asm" > > > > +%include "Ia32/Init32.asm" > > > > %include "Ia32/PageTables64.asm" > > > > %endif > > > > > > > > -- > > > > 2.29.2.windows.2