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.web10.14922.1627193272921817066 for ; Sat, 24 Jul 2021 23:07:53 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=cVTx1Any; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: jiewen.yao@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10055"; a="191661231" X-IronPort-AV: E=Sophos;i="5.84,266,1620716400"; d="scan'208";a="191661231" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jul 2021 23:07:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,266,1620716400"; d="scan'208";a="578792456" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga001.fm.intel.com with ESMTP; 24 Jul 2021 23:07:51 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) 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; Sat, 24 Jul 2021 23:07:51 -0700 Received: from orsmsx606.amr.corp.intel.com (10.22.229.19) by ORSMSX612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10; Sat, 24 Jul 2021 23:07:50 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) 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.10 via Frontend Transport; Sat, 24 Jul 2021 23:07:50 -0700 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (104.47.74.45) 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; Sat, 24 Jul 2021 23:07:47 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kaOHd4l/Cxy7/Ntivf+/qLSyn4+9A604Tz8wlzn5eu+h1E5LpIaZFTun7siGLe+6xYOZsjjz6IA4sHZ/ktLLoknQxkXL6klxUsz2L6nJdGIjr4r4/u9Kew/1CRK4axDwTAWZ+J95MzjkNSzcPVxlCyDKn1NqeSj/q3mosG6hkNYTfIKALyrJC8liLOZfO0GPXAOW6ysE3YAVjXQ7r1VJYP8P9dd7QVNY6DnqTnJgm7FlY2wxNScOqyL8ZuN6J3vXGYWLJDwMK+5EMlJVRUKySbG43fx7LF2vZY0NXPl3L1mw/pRO7HGN1IMJCxHVueOzMzN0aWnWzwi37QeCcxIVbA== 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=XKiSoBa5TJq7Rh4q8fGD/B7969iBUdqxjei86+TcGYo=; b=OHKj5VjZQbviysccHccANHazy9df7f1uPTM1dpPAF5fI9dcU/8YcPS3qCauPNFFptMnZKl12k6iqKavKLkjJmhwp08Uo/208NICqbjmoCmkPg3s2tJoYSMlDny6CFnpB+bZDClOlFJyGpj4tX6BOJLPtuEFiwaBSSbTUSLzrS1tu80JadTFxlTnz8yI/vsUdpzpi4SPI8MMhIw1o3HBMTXa0SP3MRFCzBjxapgvi3rC0BVgsO2m4izaqeqOZ5l0tHU5i9g8IriSWHGm3zEx2a54e6B76XwmWKZm5Ik5BqrLu2mW7cYautmH5E323kcpXSucuT896GrMlV4hzsTLMjA== 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=XKiSoBa5TJq7Rh4q8fGD/B7969iBUdqxjei86+TcGYo=; b=cVTx1AnyqFOZakj+KTH7TsQGzq29dyNhKYPc9yUcanySaJQ28fPAcFwaJuK+2Nv6AmcStSVx3Ox50H0H3+cC4ATEirvuUwhAXqcjWms7MaevM+KFO0rYKg+2uba0+dnAXENuyjI8sym30sEtdJl/USgj2/E+9Q6KdKgI0ogO+XQ= Received: from PH0PR11MB4885.namprd11.prod.outlook.com (2603:10b6:510:35::14) by PH0PR11MB4789.namprd11.prod.outlook.com (2603:10b6:510:38::10) 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 06:07:45 +0000 Received: from PH0PR11MB4885.namprd11.prod.outlook.com ([fe80::6c99:8170:1c3c:9121]) by PH0PR11MB4885.namprd11.prod.outlook.com ([fe80::6c99:8170:1c3c:9121%3]) with mapi id 15.20.4352.030; Sun, 25 Jul 2021 06:07:45 +0000 From: "Yao, Jiewen" To: "Xu, Min M" , "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: AQHXfr3dAIpBhEiaNEeEHV1Dj9l+CatTN3Qg Date: Sun, 25 Jul 2021 06:07:45 +0000 Message-ID: References: <385d5e4bc26eb601a1ee6eeb982d5cde06ceab2a.1626931332.git.min.m.xu@intel.com> In-Reply-To: <385d5e4bc26eb601a1ee6eeb982d5cde06ceab2a.1626931332.git.min.m.xu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.5.1.3 dlp-product: dlpe-windows dlp-reaction: no-action 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: 585864a6-1bf1-4a0d-f18f-08d94f328593 x-ms-traffictypediagnostic: PH0PR11MB4789: 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: ontTn9n1MBa+3s/x0n8q0KZ2Itlyti6UsJfBmDja4N3nog3sfIOAGkQp3ivuxCmR/c1PV8RXesunyjE4v1Vy6z4XjV3qS6g0RxXk2Hu2y4giXLVVsyr3cIGxLTyXjgwq9tF0aW7FD2QQH96HamuJ0wT+b6fRZgM0sXzXJHYHRCAkOujDL9N5eEkMoEv9urUi/mNY3xcL82gOtci88NREtxRASpY3hLC8hH95uUJClXyL1m7x4tAjal5rKN+WBMjNI6fMerPLXljdS9A3ZdUxNuQrXG6UxIZMvIhVNZ6Bk6G2jkb3WbZ/fXWNRLWMW+wthL1aNXhhNAfQQaeXkNvMf/GsOzAdXuRGL5PIie7DMNn+FBBKchY8xhCs/e/voYY6UMGvwgKLF5EPh4c5vCOmm3yiILg/pUv7H2jxsBrOiyNVfgcvjQKUU+J732XSQpBzy4M9s0HQ/xXS1D4efPXQkHSSPxsxPujp2cgWZ9vZQEeGP8KfLGQyPH755qKL7QRO4S5HaNa+DC1/vIi2fVuAEq19obvTjMJEusxlMLALxDwi4oP6kCCLzhSNT+VdBDXFpB+ToHZ3/L6I7UAMp/4A3O7G/i+JTVVoLJjS6nlPaATDbHXvK4HsvhtjIm/OLB4MkdV/U9KSE9wNG87Dsz8xg4YsZlA0chJ1L14pJvO3M3RodiuCGWKkUW8UWoqo2OhyhgksDXY8o1ay18PnALqtV6KvXk47+T1tuDC/FyiTEIffN4ocwEfluxh7o3YF1TbPzyhS4Q2cJfulWRn8iqYvmzUwvDSdc5qB0fQ3KaNA9ng= 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)(346002)(366004)(136003)(39860400002)(396003)(376002)(107886003)(55016002)(4326008)(122000001)(38100700002)(7696005)(52536014)(2906002)(53546011)(6506007)(9686003)(8936002)(966005)(76116006)(110136005)(86362001)(83380400001)(33656002)(5660300002)(478600001)(71200400001)(66946007)(316002)(19627235002)(8676002)(26005)(54906003)(66446008)(64756008)(186003)(66476007)(66556008)(38070700004);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?rnOSO56mzU1dIznY9+COH3r/7OZTOIVtNgekg9QNb+ubtTM/PGMkwZlnPhzY?= =?us-ascii?Q?+alcUydRq1oIKTHGPn1c/CwIdy7xACXlxOnoVaxkwC/zlZ2pj06Q4o4OskM+?= =?us-ascii?Q?YfZS59S+doFVtHBoqlhOWHqW61m62iVHUjVLJK2bckExHprOghZ6y34njMTz?= =?us-ascii?Q?AaI4QgxDQsWVKbgF0N3cNsrICFKPaVlDNHcrNwyKRmmP/3SOFliAkyZFBbEU?= =?us-ascii?Q?LfCJ/tVpUign2CEv7kQetf/lIlHwL0Nn6z5U8Gq/J8Fq/5LER+MQKUByZvZQ?= =?us-ascii?Q?fvges0N26C0Oofux5Km23aW5CYngvRSr5I7OEQblwM9e8kXLiBzCOc0tPPrR?= =?us-ascii?Q?W8m0ljqeMlUUzwP8+2DbSAs2/xAFJQtWWZsh4SjVCNGTgGZNl9Q6yGkg2wXw?= =?us-ascii?Q?q+pDBgvxp9H5IQM751ciJYzMrqm6YVK5aRPIMQTzDcYAeh14gFNr0lj8pii/?= =?us-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= 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: 585864a6-1bf1-4a0d-f18f-08d94f328593 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Jul 2021 06:07:45.6833 (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: lTnZZxY+H4vticOvrRmgy3WbH6CuRt+h8V2k3O8ZCEqT4I+MtZIcjVEDO9Hn4+aasxWZogXckZAd2ighu8Kj/g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4789 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 Current OvmfPkg Reser vector is a mess (see my previous email). I also compared the ResetVector code in UefiCpuPkg and OvmfPkg. There are a= lready duplication/override. 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 and = update there. 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 arc= hitecture 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 >=20 > RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3429 >=20 > 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. >=20 > 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.) >=20 > 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 >=20 > 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: >=20 > BITS 32 >=20 > +%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" >=20 > %ifdef ARCH_X64 > -%include "Ia32/Flat32ToFlat64.asm" > +%include "Ia32/Init32.asm" > %include "Ia32/PageTables64.asm" > %endif >=20 > -- > 2.29.2.windows.2