From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (NAM10-BN7-obe.outbound.protection.outlook.com [40.92.40.100]) by mx.groups.io with SMTP id smtpd.web08.18032.1611690324937736811 for ; Tue, 26 Jan 2021 11:45:25 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@outlook.com header.s=selector1 header.b=Wgs7ZpvP; spf=pass (domain: outlook.com, ip: 40.92.40.100, mailfrom: kun.q@outlook.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WxnVSlmiYuI+f4rq9IRsuMQTEwLLQfRD1Fi4TTnwXvi2zL/u6jKsNaFQd9mfakilA8tDsf/ORuHhnmkK+QqjJ8OPI5kk52sXrtvrMlfinCX9dO94LwHmp5aoZvhZD3vw3ckeiehHeLUUjDJ15ezNroCdVqrOriTHsHyjXrjC6ZHfCqjsQLbdT2nwFV8iGGtHCj1RekUp02Fhu4g+Il45vqUck3aNZOE/H+GOs174vYHbJBKI5X7mw/e9HaQL+oaWAloxyeC9Yw5MxbhnTgCHGUcY1SjSRmduqtUDAjCT5x+liLE/ignDXBw5LT8MYit5tJpIYfS6mtVg3GCzSHz8pw== 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=HqtEHM5E+v/fcA1F5WwHfyCMrzucChLOo+5xZH8UudM=; b=dipi8rf3HeqdHPnQQG4tqcM2YF1pkcdCbYYWHirQw2kJxow845LHjQG3x3wxcyQLOBa4Q15Y/uRRqr7xQ++l62L4esqbKRvlyPoCKQol0zeG4tya0O/JK97rQmeZwtJwBLZhY1K5nhIx5qNzKkTIvR0d0r9d0e8Fk5DzKfFNLOpgOGF8M9jX300mbkrUlFYUMrTwNQsH5k/wkCnx2UuyS1Dt8H6f27fDFwbohjvFiUGkWowsC6jAX80Tsh4BFjyL5lsYGW2d94vh/o1G9oMdcO+OjsGZWOV64eVPrYY1yeUNY9qBCpZPlqPu1od4xT7O7GaEZmqXNXP0avKOxAmgoA== 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=HqtEHM5E+v/fcA1F5WwHfyCMrzucChLOo+5xZH8UudM=; b=Wgs7ZpvPKW2NUbZo/X8Zuiv9NrjIOY7XjpS+9QBbk9cgZ5+QEgugcVsVklc55Gng+KXkxgPMTJ8sw1VFGRGuU2b4ITvNN3JmEl84mvYX8M8KC0u4JJqqr2NphcYWpQ86zdwu6Jq0SYrKsC/x7wsfZZs+1v+JGJqyvmrYTfBkxQIOe7kxZPIvZoh3XppH75lrQEIzAqRJLH0qTX4NgDP6qXCBSfr5dV6vkWUDI3wFKO8YH/VIrMy5jaNttHsUocCtkjKD9JfUJ85EqknmwgvQsVbE4BrG9GKGSTx91p9RSnEFNQjkJ3olOutr9pGmkb9Z6hcS+RfHcRTp6wgsl+amIA== Received: from BN7NAM10FT059.eop-nam10.prod.protection.outlook.com (2a01:111:e400:7e8f::43) by BN7NAM10HT022.eop-nam10.prod.protection.outlook.com (2a01:111:e400:7e8f::418) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.11; Tue, 26 Jan 2021 19:45:23 +0000 Received: from MWHPR06MB3102.namprd06.prod.outlook.com (2a01:111:e400:7e8f::4c) by BN7NAM10FT059.mail.protection.outlook.com (2a01:111:e400:7e8f::447) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.11 via Frontend Transport; Tue, 26 Jan 2021 19:45:23 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:A18D405F5717651405F39A4DA449CAD9148311A31FFB6820828018AC86166C4F;UpperCasedChecksum:6DFBB5267AE8A525A4F7AAFBDC23A55DFF2DECE5BE19AFD409407A4B437C06EB;SizeAsReceived:7574;Count:47 Received: from MWHPR06MB3102.namprd06.prod.outlook.com ([fe80::d4ee:1260:6f53:3f7b]) by MWHPR06MB3102.namprd06.prod.outlook.com ([fe80::d4ee:1260:6f53:3f7b%6]) with mapi id 15.20.3784.017; Tue, 26 Jan 2021 19:45:23 +0000 From: "Kun Qin" To: devel@edk2.groups.io CC: Ard Biesheuvel , Sami Mujawar , Jiewen Yao , Supreeth Venkatesh , Jiewen Yao Subject: [PATCH v4 02/20] StandaloneMmPkg: StandaloneMmCoreEntryPoint: Extends support for X64 Date: Tue, 26 Jan 2021 11:44:48 -0800 Message-ID: X-Mailer: git-send-email 2.30.0.windows.1 In-Reply-To: <20210126194506.2171-1-kun.q@outlook.com> References: <20210126194506.2171-1-kun.q@outlook.com> X-TMN: [zwooWiGX5ATb7w12v32Sed0zc+SbQxIt] X-ClientProxiedBy: MW4PR03CA0350.namprd03.prod.outlook.com (2603:10b6:303:dc::25) To MWHPR06MB3102.namprd06.prod.outlook.com (2603:10b6:301:3e::35) Return-Path: kun.q@outlook.com X-Microsoft-Original-Message-ID: <20210126194506.2171-3-kun.q@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (50.35.88.161) by MW4PR03CA0350.namprd03.prod.outlook.com (2603:10b6:303:dc::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.12 via Frontend Transport; Tue, 26 Jan 2021 19:45:23 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 47 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 40ad7096-175a-41cb-b84e-08d8c232ebdd X-MS-TrafficTypeDiagnostic: BN7NAM10HT022: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FII0s9zFtuLdXrj4i5j/sNgyRoLCgTKIhWWkocUkB4kfROYUG0oQ3lGFk8w56anR1g61mn+nto/vSzK2oz7iCw52Z3hmaVauoIbmSUBCDhEo7uI8whn4RUmGiPX33VJwlSylHo6bAkYCIQ80B0+uKPa4eUUjHGwGiVA+Bt3rL8qkguDC1x9RaSPWu9AF8kEyo/jmHNC8bndJhpAm2HLJ+k1rWpqqyvXMgh9VWIdDavRtMSE6ufGSZ3viP85v26hz/h7AYpG0urfn1DIQFCV4O6hF45XovkUpfsJUPPE59LqvvBhkYoqvf4a6xSDlrsOqZcL8ExhSd/fgfw0pN3m062o8vbqWSAL9VEx2ipZ4Z/VMpwlBaLPzzjX84xan+ut63G44Bl/zRpEmqYTPjTOgMQ== X-MS-Exchange-AntiSpam-MessageData: nLIKQu2UnxCPjQbZPsT4w7ZBjCIzX2AiUACvysTOjylNTv3rYr/Y2xkpY9YNItHB2Xxe0ff3bA+QDaW4y63MW6pT5dCTggGntSJI8T94qys2/L0IkUhTUIQv546Ugy8js41Zk5o+GocRaj9fDPdmNw== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 40ad7096-175a-41cb-b84e-08d8c232ebdd X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2021 19:45:23.6223 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: BN7NAM10FT059.eop-nam10.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: BN7NAM10HT022 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: v4: - Reviewed previously. No change. =20 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