From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (NAM02-BL2-obe.outbound.protection.outlook.com []) by mx.groups.io with SMTP id smtpd.web11.1046.1610663659919316097 for ; Thu, 14 Jan 2021 14:34:20 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@outlook.com header.s=selector1 header.b=pXDWSHE5; spf=softfail (domain: outlook.com, ip: , mailfrom: kun.q@outlook.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OOajYplgVYELOjgACdml1xKOJRFJXjrOtz9k54p+xIlNwtAAsnDspLwZqsghQKz1r/chda96et6uizGALWFmMN0B21myOuDFrqKrmMyO5odoPUh/q/eA0ENWAxTYdXaUeKU/HZ+0FC6DCdtvdZdyBE8TsjazwXiOrBKoCaxdW/r5ZcEWCINVQxluHNE8T0yWUNiFc7O/RUFWwyoslxRAaQROe3UvKkdYnveE48vaTO1SWhr+fHC+tUQpwn7tdlNtlF6YORCVAe9cY2mzHFHPQessT7x/EC/fy7CYaRSd3GUwWPfVxhyz0nlKNJErStV6TmZpsrGKhlWcvvuj39te6A== 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=cx1Z+/jRdvAam0Gpm5L3FFCYRhCTPEmfHkZH+1jjLFQ=; b=Asrp9gYOcSXp+DEixwNFES1JuQCa215uvELvDoPdESuzz8y3EjKFwtB4DOvPbnjqOrwwDfO74MTDgJ7hX5Gbe1JhkX0WJ4bN8YtdM5e4EJKsqoQmH8JVQV0dzfwkfRPyu2qS9skAaB7iHXXrpA6fmRf3khlugPJaIaehDGtuJrabLBZD+339ZlcBh74M2desuWtBS0h1EeWwX5bSDjf2PAMrSBdK3xrOm50oaLpLatKiK3qmIQz7lIVfzYBobCuo0vFy8pIM7xpof9SS7N1/RT7Zj7PDAa3cvzgCzGTJFQP64evpDXJh9ZwTieSF/a2k4Af3af8DZaY7cn+I6oQcsA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cx1Z+/jRdvAam0Gpm5L3FFCYRhCTPEmfHkZH+1jjLFQ=; b=pXDWSHE5p9YD25ytr4nXq7H2lcJ5ZZIEOrSAYOWsuQ4oKXlhZY60UfKVDUjWpZsV23qd6Pk/DaxGgSWB+5OKULLSeK0zqLSbrEOZQUF55HtaOAiSCJhFOPGnJonHvziQBIYr09DuoNJ6O5cDZzUEBm/5QDixPJW+kI3bdQZVZI1dVEhZcBdyUtE3lmuh7TOKaqzqi6W0m4eFwl/York3C0QyuqRpHVG9U+doesFNNzxcgBDk6qIURRuHv/FJyH6Zmzm3If1pdngjHOqbYHEVjw8rF6gRXKo3jTvrIFhB6yOl9/aF7Hmt/qCVgD2OSRPZcx2gsUcLSQDrDnc3hwRlUg== Received: from CY1NAM02FT023.eop-nam02.prod.protection.outlook.com (10.152.74.57) by CY1NAM02HT177.eop-nam02.prod.protection.outlook.com (10.152.75.174) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.6; Thu, 14 Jan 2021 22:34:18 +0000 Received: from MWHPR06MB3102.namprd06.prod.outlook.com (2a01:111:e400:7e45::41) by CY1NAM02FT023.mail.protection.outlook.com (2a01:111:e400:7e45::237) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.6 via Frontend Transport; Thu, 14 Jan 2021 22:34:18 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:0F1011A628841666090AFC765A0BA3B3EF1AFF5C000E95D3EBA065BFF70BA6A8;UpperCasedChecksum:2D28013ECCDA7BD59F954EA00C31869CD7980FD4B02DE1E7CD66EA86A10ADB44;SizeAsReceived:7578;Count:47 Received: from MWHPR06MB3102.namprd06.prod.outlook.com ([fe80::acb3:ab69:563d:b0d6]) by MWHPR06MB3102.namprd06.prod.outlook.com ([fe80::acb3:ab69:563d:b0d6%5]) with mapi id 15.20.3742.012; Thu, 14 Jan 2021 22:34:18 +0000 From: "Kun Qin" To: devel@edk2.groups.io CC: Ard Biesheuvel , Sami Mujawar , Jiewen Yao , Supreeth Venkatesh , Jiewen Yao Subject: [PATCH v3 02/18] StandaloneMmPkg: StandaloneMmCoreEntryPoint: Extends support for X64 Date: Thu, 14 Jan 2021 14:33:44 -0800 Message-ID: X-Mailer: git-send-email 2.30.0.windows.1 In-Reply-To: <20210114223400.2596-1-kun.q@outlook.com> References: <20210114223400.2596-1-kun.q@outlook.com> X-TMN: [Y1Oi2rE1UjShJB+l493d46c3/GlrWXv0] X-ClientProxiedBy: MWHPR03CA0013.namprd03.prod.outlook.com (2603:10b6:300:117::23) To MWHPR06MB3102.namprd06.prod.outlook.com (2603:10b6:301:3e::35) Return-Path: kun.q@outlook.com X-Microsoft-Original-Message-ID: <20210114223400.2596-3-kun.q@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (50.35.88.161) by MWHPR03CA0013.namprd03.prod.outlook.com (2603:10b6:300:117::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.10 via Frontend Transport; Thu, 14 Jan 2021 22:34:18 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 47 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 35284869-e78b-414e-15ba-08d8b8dc8811 X-MS-TrafficTypeDiagnostic: CY1NAM02HT177: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kC3w7k2IqULMRhKIzEvskyuLYPstC5xydVYyevonZK06OLb0zMIdwayeey/yppoxvy1IlKOzP4d/GdVN3ieMg4xF+Oq7MMgsPlK4Kv1WLuCdSu65BHPBzi0DF3V2ReLcKEd1VFW4uRTOclkxUFyVMeMV1uR3DkF9DDy3je7c3H5Xb9pUu18qNGrNoM8CRu5QP9D8UpCX4UBJBOiY2AvznzpPuMAgJd8qq3f+W0XYY00IzYmOeyF3a+9csNF9uAg4 X-MS-Exchange-AntiSpam-MessageData: Bm0+VXzyYIlixdU5SSHeqkR3aFWrP4DMCYWqnleI/25nLvEVBMreYNdNSCMvLnCD+hvtbExyOz8xxZMcxtohMaS/w/yPT24kJogeWpA02w4RaMte1m1DMhirXh6W3bmDHWqex9CEmpA/qOS6ivO0WQ== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jan 2021 22:34:18.6632 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-Network-Message-Id: 35284869-e78b-414e-15ba-08d8b8dc8811 X-MS-Exchange-CrossTenant-AuthSource: CY1NAM02FT023.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1NAM02HT177 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain This change extends StandaloneMmCoreEntryPoint library to support X64 architecture. Cc: Ard Biesheuvel Cc: Sami Mujawar Cc: Jiewen Yao Cc: Supreeth Venkatesh Signed-off-by: Kun Qin Reviewed-by: Jiewen Yao --- Notes: v3: - Reviewed previously. No change. =20 v2: - Added Reviewed-by tag [Jiewen] StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/X64/StandaloneMmCoreEnt= ryPoint.c | 71 ++++++++++++++++++++ StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPo= int.inf | 3 + 2 files changed, 74 insertions(+) diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/X64/Standal= oneMmCoreEntryPoint.c b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/= X64/StandaloneMmCoreEntryPoint.c new file mode 100644 index 000000000000..dffa965b8425 --- /dev/null +++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/X64/StandaloneMmCo= reEntryPoint.c @@ -0,0 +1,71 @@ +/** @file + Entry point to the Standalone Mm Core. + +Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) Microsoft Corporation. +SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + + +#include + +#include +#include +#include + +// +// Cache copy of HobList pointer. +// +VOID *gHobList =3D NULL; + +/** + The entry point of PE/COFF Image for the STANDALONE MM Core. + + This function is the entry point for the STANDALONE MM Core. This functi= on is required to call + ProcessModuleEntryPointList() and ProcessModuleEntryPointList() is never= expected to return. + The STANDALONE MM Core is responsible for calling ProcessLibraryConstruc= torList() as soon as the EFI + System Table and the image handle for the STANDALONE MM Core itself have= been established. + If ProcessModuleEntryPointList() returns, then ASSERT() and halt the sys= tem. + + @param HobStart Pointer to the beginning of the HOB List passed in fro= m the PEI Phase. + +**/ +VOID +EFIAPI +_ModuleEntryPoint ( + IN VOID *HobStart + ) +{ + // + // Cache a pointer to the HobList + // + gHobList =3D HobStart; + + // + // Call the Standalone MM Core entry point + // + ProcessModuleEntryPointList (HobStart); + + // + // TODO: Set page table here?? AARCH64 has this step for some reason + // +} + + +/** + Required by the EBC compiler and identical in functionality to _ModuleEn= tryPoint(). + + This function is required to call _ModuleEntryPoint() passing in HobStar= t. + + @param HobStart Pointer to the beginning of the HOB List passed in fro= m the PEI Phase. + +**/ +VOID +EFIAPI +EfiMain ( + IN VOID *HobStart + ) +{ + _ModuleEntryPoint (HobStart); +} diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneM= mCoreEntryPoint.inf b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/St= andaloneMmCoreEntryPoint.inf index 75a654b06d51..313bc6f7bdad 100644 --- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEn= tryPoint.inf +++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEn= tryPoint.inf @@ -26,6 +26,9 @@ [Sources.AARCH64] AArch64/SetPermissions.c AArch64/CreateHobList.c =20 +[Sources.X64] + X64/StandaloneMmCoreEntryPoint.c + [Packages] MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec --=20 2.30.0.windows.1