From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web08.15469.1627198902234220672 for ; Sun, 25 Jul 2021 00:41:42 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=JwDVVnpd; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: min.m.xu@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10055"; a="208961859" X-IronPort-AV: E=Sophos;i="5.84,266,1620716400"; d="scan'208";a="208961859" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jul 2021 00:41:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,266,1620716400"; d="scan'208";a="436320779" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga007.fm.intel.com with ESMTP; 25 Jul 2021 00:41:40 -0700 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) 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; Sun, 25 Jul 2021 00:41:40 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx603.amr.corp.intel.com (10.22.229.16) 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:41:40 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.174) 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; Sun, 25 Jul 2021 00:41:39 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L1sABiNGhXMTM7moPMkboigItD6G4JpMkKvOmZrMHbMAiZRCPDIIvdSSFBoXY7CQpCCDEXxdlG6XIRaQGGm2lDZwgpI9imhsEmMbpitLntC2paLJXFNZO/DoAvF7h2uGgHujrHiRo+9SWrHcEOcrWwKZ5US68xOzsUNXNnPUJYrx716qiw8ZMgTQgX/FNsZv35e7gruccrQf1D7OWrUnc+TLTW7NiP2iujDlxH668XtcZVBf8O5xRRQd5n7zjlvwTwwR6dUjyJbawq/3XsnFIlh3Y58btzY15Ne/SlMMG7CqZG+YkqEV4/ehgKC4228wRWj5olSRPFH0taXfUL7VXQ== 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=lc3yk2ENjdtRij2ZgA8qHmGO9tcCXLXH+mSEsgd01p4=; b=KTwc5dILeZBWCvDtjW3pDC1dF7UCSrB5UEUEE6yjvVmAvbZQY50K9HVCISwJhLfdCVjcwKVCbPDnPJAeU9stiM5JZO58pRQ5dNoCEs/4HleSBzEOpS/FKpUXcdSQ8ISaRIblRaAbV9USQK0DWBNMAQbYKNKJ4ygBH/SnHfQ1tMXuG4/qUgbqjmk0V30aPDuTXfAEz4j1pzTxKmKb1k8TWUGwDlOnc8xVr3+75n05RJaWDSLePcFygic3lrPQaNyQ6A1Fay1Wwgf2VE3MknXeR0UbJqBxTM4zcqCwQc29UHFWgcNtyApG8O3nEbuLA4Bx/mWrXNS8n3i7AM60G+PNkg== 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=lc3yk2ENjdtRij2ZgA8qHmGO9tcCXLXH+mSEsgd01p4=; b=JwDVVnpd+HIquGmb5176uNFzKLDE6jpL3ykueKsAfF4QMIWFACgEkvgGW+sobKm698K876HBpfpaoG1DehhtunLVMdo9dwVvzWXo2jPDnybNrO9kT1GsyhSihx/agbt+MJJgYazx6OOTeFRNfXypdUaCdm0oCFzfu3XYpE6qNcI= Received: from PH0PR11MB5064.namprd11.prod.outlook.com (2603:10b6:510:3b::15) by PH0PR11MB5077.namprd11.prod.outlook.com (2603:10b6:510:3b::17) 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:41:39 +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:41:39 +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: AQHXfr3dcRe9p4x1R0qwI00q4k6vZqtTOUmAgAAYdCA= Date: Sun, 25 Jul 2021 07:41:38 +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: 89df4e83-083f-4bf6-c87c-08d94f3fa341 x-ms-traffictypediagnostic: PH0PR11MB5077: 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: 1YGjINWNWMF5WV9iz8MlvIqgNWO/qERpbGuK0oj4MBX7s5132vR1F4XYh20LLM/5OHQxIo7VWEevi7JrfpQGocnv4PS1NFksUgLMqk96L+4zE8iLz3pG7AVkUpBWJHBbM0/h/t9pTbUaPzDknEI5KnSClEFv8tkPwUlc5WOYGcDU6iFqxoxTAT3l/xQX8na7xNcNSyzHPcb6TIvXIK8S6XyxgPFq5RK04b6BBRoJ81MVpathOsk3IaJ7OI79izaItWBylIAyq7mQJWsijQkBFQcRr/MN1X4upXM9mvLH8KN9moCWjTwgrlcYh5LeSUxGlpYRS9S9vBxTdlpLIXQsiNpKA42VAnT4PD+CHRXgNKz8uPKv3nDOebfCrv6Faocbd8ek/2gDtViSl947ofnU6j5IGRe6jw5G2GNwHvSGu36IDGtQ6O1tbS7Ejn54EjGHUao27Y6azrNFbjEW4pEGoamcmybiIN2o778xL/9zwcU8ukTI0fseFZERKde1Btk+eSK+uJs/0tpwCm53BErip+XgKJ6RJMN4g2/GvWQW7DywMZsFiZNFtbBMkGHkn+ANU2xIFe3d6kHdBm+Ul4pXRL38c8ZdAvvqMbIWQl9tD9PyXrHSg5Yl+GE9eAK/lvyQ1NcFeF1TMf/xLxqBiQ6EYA3Pha/vBR0ThxEcCbqStatqbwAKZ75j/mZIqNPgrn6n0gxO9PWjPpqVMX4yH9Ps3ZHmdsQhVqPYjYbDOE6GXbnaB+4E+7pEWVLZPmRpJVZrqVo0GAc2aP7zYwsXAexE+rNqSPaeHWdIi5RM+oHuers= 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)(39860400002)(346002)(136003)(366004)(396003)(55016002)(9686003)(86362001)(66946007)(7696005)(19627235002)(8676002)(26005)(478600001)(53546011)(2906002)(966005)(6506007)(8936002)(107886003)(110136005)(54906003)(186003)(71200400001)(76116006)(33656002)(66446008)(5660300002)(4326008)(38100700002)(83380400001)(52536014)(64756008)(66476007)(66556008)(316002)(122000001)(38070700004);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?UMznDwaLQhIrdX9kJWPz4QDOHFcaapEX+MzPTZqr67RPopWGPMQi638X6PxL?= =?us-ascii?Q?Pz4zLiORRiGW9jdMdCOupQs/iahP+nE2cBOQUp2v5xAH+LGXwH1jMnD4j0/y?= =?us-ascii?Q?uV2DmgZ0EMfjCYzDv3HjaZ0pPCjEH4JBcJX/4TnVF6tTvHnZ0LfyG5qqVJ+O?= =?us-ascii?Q?vFZmjzltiYkstmBdXqHcdTxc6SC8EOJZxeztYPAPij0aweNsFv+vvvNkKPeh?= =?us-ascii?Q?09QC/j3tU0dhtbT9u2BRL3h420101sPxHXvrI0PbDrdN6HUoAll0/0XDRMx8?= =?us-ascii?Q?3dtdwQaEoEI03twXGU3hEWOg23kJMVRk9Oi7wepF9/lWjw6zCkiqKdixUHzo?= =?us-ascii?Q?Wgbp+p4fIOAcg4URvnsyZpSKQfpKCC+SiFHW7AHLdESzQ+Tgr64iDR1p0fjS?= =?us-ascii?Q?ifIX1Vh62nAlxnwNActX0Chd/4o2O549/3SlxW8LzWfgj6w3xU2lMyM31cEU?= =?us-ascii?Q?vAIx6qogV8qy1Fc9Bf+d9zR2BHhmhLQSN4fLjZzH4RzV8AvEOvTo/NEmApPy?= =?us-ascii?Q?li3WY3SPCcj9sPCJ/9ogYk2GSe2Gc+13DF4prdffRbBCPZpMj9NhuVJPOjqR?= =?us-ascii?Q?sBwqrQhx+af4a9O4nA+7OW9uqbyR+VIJUBlC1RosCbot2Ho+JlAKMOijqhWi?= =?us-ascii?Q?7kmlywkr3WsGtPwEX5bDHczY7+6/CKWj1OTGlV6UI1h5ZIYtpml9i4MiktIU?= =?us-ascii?Q?oL8ReNONx5DtPNR+ybOy99HnK3XaCFInzL9aMxFpJgl27mEo16Zov7JWzCBz?= =?us-ascii?Q?7BhBfsYtUlkFwOUsWJ/8tzDyBRBWIm44/vF9TliQYae7DXIPoIZVR76NKccu?= =?us-ascii?Q?qYSqD3x2O4F+sFJIQLV5IleMusub3wQEIsmjQ45KLbyin6509g/pDEgmORhY?= =?us-ascii?Q?jInv7Q2aoZvVa5/lMwUatTHbPLPFJfzDYYyPqW3KgonyuXwYQOU1jiF/Mx7N?= =?us-ascii?Q?gZLwdQWDs+eu7EWA8ug2zsdy1f17fO/09gT4NRS8wVeBRPexlMtn2L3tjVm3?= =?us-ascii?Q?ItrkKxER0OzulA9Njn++q1f2LXif1Txr+/QvMI94s3imbRKeodoh8IJPmLL/?= =?us-ascii?Q?Sn/piFt9Lt9r87/MnEbI7NPsAsX1GwXlRnbCK5b/53DKMWOYRPCtwxcDutO2?= =?us-ascii?Q?iYWcRgVO8H7xqBHPgce4xEz/fZlqBAo8jMfcGCgRI6iHehWu6bKEcVhrmUx4?= =?us-ascii?Q?XoCIi4cfqFCPxAcB4IURQ469RqoIFroHACx7r3Dx+Grced6fs6wGS7hps1LP?= =?us-ascii?Q?1tTr+WWcmusgOHkWDlrXvtePDYOiAECYHNnxfmF+SP0SyhdxJX56iKWbaRb9?= =?us-ascii?Q?kXrJqJwhLctcaTq5SSWKpGRJ?= 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: 89df4e83-083f-4bf6-c87c-08d94f3fa341 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Jul 2021 07:41:38.9420 (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: PhueHQo/jxKGZYcMujVkQsqhEW7nERaspYBIAmTzRPr0qrL+gjBOrkqKFSue5yTe8hKgL1ovp/eQTtCcoECVRw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5077 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 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. >=20 > I suggest we just drop UefiCpuPkg change, and focus on improving OvmfPkg. > If we need add something in UefiCpuPkg, let's copy the file to OvmfPkg an= d > update there. >=20 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 a= nd > physical BIOS later. But at this moment, let's finish the virtual BIOS > architecture at first. >=20 > Thank you > Yao Jiewen >=20 > > -----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