From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web11.24733.1626679260745266112 for ; Mon, 19 Jul 2021 00:21:01 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=qS84NaBT; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: ashraf.ali.s@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10049"; a="211003683" X-IronPort-AV: E=Sophos;i="5.84,251,1620716400"; d="scan'208";a="211003683" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jul 2021 00:20:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,251,1620716400"; d="scan'208";a="659713552" Received: from orsmsx605.amr.corp.intel.com ([10.22.229.18]) by fmsmga005.fm.intel.com with ESMTP; 19 Jul 2021 00:20:59 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Mon, 19 Jul 2021 00:20:58 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx607.amr.corp.intel.com (10.22.229.20) 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, 19 Jul 2021 00:20:58 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.177) 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.10; Mon, 19 Jul 2021 00:20:58 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gdyNnFrZuCGS+dR8+ro44DugVxcXrPD9TMTHk94vsnpDf8x7n+LQZd3vt6eSkcBU+eqKhKX0hTYyfsqAKWb9Yvxgw8871kpnFL18viA8N+lba9cJzUYpji7Xlckw7QprDrupvlYnNlNshlt8S1mTwWwrWz5w6nBaAlOGGZUf+qgwl3hqAw/LE1E8IxdYOck+FJlqLkqRAFnGsCz2w0WWj6ZrN71fBfXqAQlxfkPUciC621AE4a2H5s/D1trsGu6qHPYCMpN0KYoLg4K8bGoZkk757tZqPFuBo1DqNC014F/aq8trbDR7/EKr6PWHEumeKLbh4JfP1AyCG0zD/lPMgg== 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=6l3GYzYqMmdL8eLmGGVQi2pG9XjzW4vgHJOpCKjM2QI=; b=mDosW8CMZs54pnuLAxYhhB4ocKCP0sueNP8IGDQS/Wc557YZsWEwY1v8kpUVJk/wSaNDhLRgKLv5WJGBJpen2u1TTEXQekHGW9UlOdTLVYk8odkZkikKq6bYU0i6b18Ie6/esiaEP25hyVG9m2SrRrkq1hTn0eZR/ZSackR3nO3fBTIeC7cbNXbh7dlliOubLh3DD4vPFv/vDNcUBabUSHpJENotAgBu45Hcrlv4QQ+sJALLAbRBDP9lU1tdV8Cvza3nieMKrkAJSjWtd2+qoitaCjLIM04zSEZbjZeFtkQLoXsc0AAOU8f39hULQES6X46IxArEhaQOxBGzzfUENg== 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=6l3GYzYqMmdL8eLmGGVQi2pG9XjzW4vgHJOpCKjM2QI=; b=qS84NaBTWI1CDY2f+Q1Ew0RsLkua+nKFeABJVZtGPssUpEWgnd6aWPHZUXtCregKLHDW+jSXFwAIxrguKQ1l9JKI/u823UIjaKlm61ZZTyzmIU8GgAiDcL2PDHSaNl1zoMUPOnOUS+baDx4Vdmwlgl/PIAU/z7ZetRTq3iOFIV4= Received: from DM4PR11MB5280.namprd11.prod.outlook.com (2603:10b6:5:38b::18) by DM6PR11MB3516.namprd11.prod.outlook.com (2603:10b6:5:72::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.24; Mon, 19 Jul 2021 07:20:57 +0000 Received: from DM4PR11MB5280.namprd11.prod.outlook.com ([fe80::ad81:c1e0:a608:5021]) by DM4PR11MB5280.namprd11.prod.outlook.com ([fe80::ad81:c1e0:a608:5021%2]) with mapi id 15.20.4331.032; Mon, 19 Jul 2021 07:20:57 +0000 From: "Ashraf Ali S" To: "Ni, Ray" , "devel@edk2.groups.io" CC: "Kumar, Rahul1" , "De, Debkumar" , "Han, Harry" , "West, Catharine" , "Solanki, Digant H" , "V, Sangeetha" , "Dureja, Sahil" , "Chaganty, Rangasai V" Subject: Re: [PATCH] UefiCpuPkg: SecCoreNative without ResetVector Thread-Topic: [PATCH] UefiCpuPkg: SecCoreNative without ResetVector Thread-Index: AQHXeJV0fWSquz7gNEOfNdQTNMHEC6tJnnIAgABEwGA= Date: Mon, 19 Jul 2021 07:20:57 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.5.1.3 dlp-reaction: no-action dlp-product: dlpe-windows 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: 2c69769d-f12b-4239-7daa-08d94a85c0ad x-ms-traffictypediagnostic: DM6PR11MB3516: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2733; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 2DO9cia5KdTiSz7nt9xPrwMzfAMIb6DRMCrfU7zRBcqnNNZAw0/1eBRVbC0ETXcOKEWbg3uDcb7rYSwpLAlZtMtgO8l4DFN4Jo2NM9/OR3FSPdh8U06zStwRgcJX9nSK/2GYHnC6kypDjo8UH64dzFqpB+URYtCd9Fehf3a5HQKTXMZHUwXKMT/oRvLSHCyVq044OKPOpimBsOi7rS07vBa8u3w8EgssnmnPgwcBgkNFGWMMJdS6qtMbghUkHbiryk1ZIFy/tEyADfPBFt1KcfIqqHL/TpjzGQHIlQKlFgfKN3lUuxGx0gVO5CoDLOBPrcX5x0RWyKtRhuTXOpfu9zGygCI7kJjCl3fViNbWIOxBrPR9yx5OIoxaEOArlVE6htSsNP4jgI+c7mMIt5eCdCw3XClYyN8yjSdaj034VrzcE15km4BBnh/tBzf9jTklR7RWIIZ/J95X2dPyDGB5BfcVhnXT/9pJel9z8xr+px7kjGNm7TvEkRf1ipf52p+W5Hohx4E9PFUwVmEe0Y3P61SnFsuuJzy8XMJR8OK2X9CeknxUTy6dnm8+DwkEoFR1UzRi2Kh0+xL+y0bvwo2rrc5Y9h3nOGPZiPN58pRas8vbj084tygCWJ3Ofjyp15wdiC3NnFI65XGs4NZR7tBhm5wm0w1i1n/+6/0rSaDHMzXw4eWMtT860HC9Mbz/BdLUL/gijn976TEibgCt2ki8iW9G7yIB/NP1KSSM03wpJhI2qK6kr95VkJRqf7izhhhjyRGxROpjTfXn0h1HYoNhhzbjON1DN5mSASiAQKpxaUc= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM4PR11MB5280.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(346002)(366004)(39860400002)(396003)(136003)(376002)(4326008)(8936002)(66556008)(66476007)(66446008)(64756008)(9686003)(5660300002)(66946007)(71200400001)(76116006)(52536014)(83380400001)(2906002)(478600001)(110136005)(54906003)(186003)(19627235002)(55016002)(316002)(122000001)(38100700002)(33656002)(8676002)(107886003)(55236004)(53546011)(26005)(7696005)(86362001)(6506007)(38070700004);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?FaNlVKjxf5HHWBrKkpoPU1UBSQE7vZ4u2aki3G8iWWt1Qk2hcjnedyRYV3?= =?iso-8859-1?Q?0/dIlEM4nvPLtV6XM12M6Er5zaIKpXilIUFhSIxDPF4OUAzaHCDSDjgIuj?= =?iso-8859-1?Q?VQqcQWzC8j5o3MBMmYT5yVIGi3+i7pRB14hqPW6/T7hbrwc6W0QYJ70c5C?= =?iso-8859-1?Q?B3w8AplhvB/V2M7uaeJkX0DAdSbdiEd1fZ2LNUNDji0eyYccLXP0YEcsn3?= =?iso-8859-1?Q?YnuSt+64533yZpfmU2WRVdaXKeQqOZJsyHlr+plZYzNwB7t0YU62WIzq6V?= =?iso-8859-1?Q?egHmgnX8AQip4lwVV1BwvDzeCi8CSSarqVBc0ePrp1AQ0XiGLZj8W/G5dD?= =?iso-8859-1?Q?dmrxiyonYqMFB+QtPrkrRSxq1SlqTKRnMG3shBsKaAiHKrK9QAdSPoT4JR?= =?iso-8859-1?Q?pb7wj7hbaLIcTheZiyE2Bc9rvGBzDMgmEv2f4XuYjRqfleDnDIsoA/iqHh?= =?iso-8859-1?Q?ejlQU60gn1NzIQBw2I35risBSH2bYUamOqPkaPd4Hy7UodGrdlLPGy/44n?= =?iso-8859-1?Q?itostCUZD+gn9qGIwECZnb9kTnuQzNDDvKqtTJ0mjLOa4aFRZMUPUddmkB?= =?iso-8859-1?Q?nl59A8gwRK6DNb/K7qrA8JQF4S/znzxCI98Hzmj2CY6pW60aoU15VP7dMO?= =?iso-8859-1?Q?wy/nkjcpwFkzfYSxwzy7JyzanURrFVtpX9CX32wYpCTaqltjviUwbLwfaL?= =?iso-8859-1?Q?muFBecU7+e6JSWjYCIpatbBXJwcefjw+exGgIbGZnapBmN9YhXbGKiKp1B?= =?iso-8859-1?Q?EBVtv1/YaICQhOy+BdaWaLb4EVOqfqXhgGJtaxfawKrmw4SoAx5qTI048b?= =?iso-8859-1?Q?PVSB7a4G8gk5boUUsQSQevWxaASh/+PTWSlxNNyW7dqDvwYgycyIcMQaqe?= =?iso-8859-1?Q?p36E3eqrrgcA0h0myCiYRlQmc0Py1FQ/BliykCVCy3hoGaex0u+pB9vkmQ?= =?iso-8859-1?Q?3H+GwerCAC0iPR/USrYqRFugKa5/FaZQpU8i7t42PeiaXwkBUgo/x/OYTK?= =?iso-8859-1?Q?2mQt3W5TkeMOaaKjA9ROX/Uc1yenfLOARzon+gCgSnpvIKr5s3CmWnlu7q?= =?iso-8859-1?Q?reMbkNtzCdsbuSjf5zwFpKiGVRmrd1IyWY/he6p76Kki0j79Df9X3z8Clv?= =?iso-8859-1?Q?Z95tGgs2loXD8TXL/GHSiJdhUCx5SAEurC4BZBHpQMR9K4pEZKWNcw5mB8?= =?iso-8859-1?Q?SaEHfWFnNA7basGeMZrhJx49snY6RC2v8yZkuV5pIzWmdfylLKn++uLSNF?= =?iso-8859-1?Q?BqXgyNU8vttgMcJMUhzfE0CK7I4szMcLW9U3hS5YEmEETFSpYuD3HKIk6U?= =?iso-8859-1?Q?L0E2XkGukOF2PRx/jqwuBjWjYkadUVb8dMj854x2bLIPln5LDa4XsNg3tl?= =?iso-8859-1?Q?29c6cOrqi0?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5280.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2c69769d-f12b-4239-7daa-08d94a85c0ad X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Jul 2021 07:20:57.1823 (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: NBTxVWw2W9LitoeafLshicOFJ7uASh2/y9PVf6QH9+xOFJ70V5fFR5XEv7wchmH/i+ThVtI6pbFeDiqq8Gdk+w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3516 Return-Path: ashraf.ali.s@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi., Ray BIOS boot to OS verified in Simics Successfully with the following changes. 1. SecCoreNative.inf with new GUID. 2. Removed IA32 resetvector code from SecCoreNative. 3. Removed the ResetVector Code from PlatformSecLib 4. Consumed the ResetVector Code from UefiCpuPkg/ResetVector The reason for this change: Currently SecCore and ResetVector are using the Same GUID (BFV guid), which= will block the usage of both SecCore and UefiCpuPkg/ResetVector at a same = time. Advantage of this patch: 1. Provided the Backward compatibility by keeping the original SecCore 2. User can use both SecCoreNative and ResetVector at a same time. 3. User can choose to avoid resetvector code maintenance at the platform le= vel. Regards, Ashraf Ali S Intel Technology India Pvt. Ltd.=A0 -----Original Message----- From: Ni, Ray =20 Sent: Monday, July 19, 2021 8:13 AM To: S, Ashraf Ali ; devel@edk2.groups.io Cc: Kumar, Rahul1 ; De, Debkumar ; Han, Harry ; West, Catharine ; Solanki, Digant H ; V, Sangeetha Subject: RE: [PATCH] UefiCpuPkg: SecCoreNative without ResetVector Ashraf, What unit tests have you performed with this native SecCore? Thanks, Ray -----Original Message----- From: S, Ashraf Ali Sent: Wednesday, July 14, 2021 5:48 PM To: devel@edk2.groups.io Cc: S, Ashraf Ali ; Ni, Ray ; Kum= ar, Rahul1 ; De, Debkumar ; = Han, Harry ; West, Catharine ; Solanki, Digant H ; V, Sangeetha Subject: [PATCH] UefiCpuPkg: SecCoreNative without ResetVector REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3492 Currently SecCore.inf having the resetvector code under IA32. if the user w= ants to use both SecCore and UefiCpuPkg ResetVector it's not possible, sinc= e SecCore and ResetVector(VTF0.INF/ResetVector.inf) are sharing the same GUID which is BFV. to overcome this issue we can creat= e the Duplicate version of the SecCore.inf as SecCoreNative.inf which conta= ins pure SecCore Native functionality without resetvector. SecCoreNative.inf should have the Unique GUID so that it can be used along = with UefiCpuPkg ResetVector in there implementation. Signed-off-by: Ashraf Ali S Cc: Ray Ni Cc: Rahul Kumar Cc: Debkumar De Cc: Harry Han Cc: Catharine West Cc: Digant H Solanki Cc: Sangeetha V --- UefiCpuPkg/SecCore/SecCoreNative.inf | 80 ++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 UefiCpuPkg/SecCore/SecCoreNative.inf diff --git a/UefiCpuPkg/SecCore/SecCoreNative.inf b/UefiCpuPkg/SecCore/SecC= oreNative.inf new file mode 100644 index 0000000000..f89a0e5f38 --- /dev/null +++ b/UefiCpuPkg/SecCore/SecCoreNative.inf @@ -0,0 +1,80 @@ +## @file +# SecCoreNative module that implements the SEC phase. +# +# This is the first module taking control after the reset vector. +# The entry point function is _ModuleEntryPoint in PlatformSecLib. +# The entry point function will start with protected mode, since the #=20 +the transistion to flat mode it done by the resetvector, enable #=20 +temporary memory and call into SecStartup(). +# +# Copyright (c) 2021, Intel Corporation. All rights reserved.
# +SPDX-License-Identifier: BSD-2-Clause-Patent # ## + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D SecCore + MODULE_UNI_FILE =3D SecCore.uni + FILE_GUID =3D 43CA74CA-7D29-49A0-B3B9-20F84015B27D + MODULE_TYPE =3D SEC + VERSION_STRING =3D 1.0 + + +# +# The following information is for reference only and not required by the = build tools. +# +# VALID_ARCHITECTURES =3D IA32 X64 EBC +# + +[Sources] + SecMain.c + SecMain.h + FindPeiCore.c + SecBist.c + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + UefiCpuPkg/UefiCpuPkg.dec + +[LibraryClasses] + BaseMemoryLib + DebugLib + PlatformSecLib + PcdLib + DebugAgentLib + UefiCpuLib + PeCoffGetEntryPointLib + PeCoffExtraActionLib + CpuExceptionHandlerLib + ReportStatusCodeLib + PeiServicesLib + PeiServicesTablePointerLib + HobLib + +[Ppis] + ## SOMETIMES_CONSUMES + ## PRODUCES + gEfiSecPlatformInformationPpiGuid + ## SOMETIMES_CONSUMES + ## SOMETIMES_PRODUCES + gEfiSecPlatformInformation2PpiGuid + gEfiTemporaryRamDonePpiGuid ## PRODUCES + ## NOTIFY + ## SOMETIMES_CONSUMES + gPeiSecPerformancePpiGuid + gEfiPeiCoreFvLocationPpiGuid + ## CONSUMES + gRepublishSecPpiPpiGuid + +[Guids] + ## SOMETIMES_PRODUCES ## HOB + gEfiFirmwarePerformanceGuid + +[Pcd] + gUefiCpuPkgTokenSpaceGuid.PcdPeiTemporaryRamStackSize ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdMigrateTemporaryRamFirmwareVolumes +## CONSUMES + +[UserExtensions.TianoCore."ExtraFiles"] + SecCoreExtra.uni -- 2.30.2.windows.1