From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (NAM11-CO1-obe.outbound.protection.outlook.com [40.92.18.57]) by mx.groups.io with SMTP id smtpd.web08.1117.1608317429281431480 for ; Fri, 18 Dec 2020 10:50:29 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@outlook.com header.s=selector1 header.b=VfrI5E87; spf=pass (domain: outlook.com, ip: 40.92.18.57, mailfrom: kun.q@outlook.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OlPWfViG+jLfPGuGnDQOABCA+jYNzPXliHDbPD9MQGbryTO+MoWsuYYX8lhHEox7/43BInjXK/ks5nzcKphALwacznAL75uVgHJtFnuh60eWN7vWZUQRqwaXqHMY1nI0RbBl5uoV6RpoFY58rtq/4cRMC/+yFcGJ1dUAFfjUmGhYDwEK+gAHYU9u+hpmYtUPwi4dCpU7Q7oqxYIHas30XcKDGQGd5bioyvMxV/NOUbu7dbTmY573F3CMd4OdjT7ewTKAcDNtukkg0mQXiFXDhohBmx2MphC7e9FcCws9cG6FEoxkP36qxKmc6i0Dm3MLRK/ndumUMs/nxHXEQtM8Bw== 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=c7u7diMlRXkiJFm8Nj0Yu0Z/6+sY7hN2/7TiBQ/dOz4=; b=IkOR7ic8CZ7Rnk5uekcHP7cAppUiuBJYxwVBI6v6g/MO0jQFM4znLRdxrKU9mncZAChZ9X9US0iOATUDtE7uPNCN3ONFzKSwO3FiWGkYmKtdqFeCopv80/5HYqiCZr0Gj6dpmAdVkc0V76KObZwhPZEhNQzj+nf9jV65gz0Km1Wotnx9NEaiQPjwzPD7SLSx5ZzB4wTHjMZCQqK/+YU3UHfGJ2jSqc7/hTJ2okMV4wYwqNgXLih0Oi4vg1Tl0qVR7oTq/i+ER0ubud8C709R15KuRJwaYXlthRqFMYoWZJTMqYsGcSuKsGi30u6XV1SMfjrtAmw8krNW/+fl5Uvj9Q== 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=c7u7diMlRXkiJFm8Nj0Yu0Z/6+sY7hN2/7TiBQ/dOz4=; b=VfrI5E87UDsg3k7cUksOl/Hi14hUMO1F4XwHpp6wyVZCqW+j1m37HToYXqw2h0YponYgmx0k1m0/8T8ZabHqb3MbvZVW6hmFnBO5Gd0Aguf+UvyHWeITdJbdGGeYJ5BB4lCJn1P+82NpG3xXpNivWzE70tyyLvqBXrRXf8xY83U65s+SI0yQCKtjl+VlucZZQoqYACgoN5y7vAFoVFgxeizfQpkz+EenCfZ0SBNEtt8Fugjw+7jprlgf4pxQlc7Il+YY/OcHoWNX6/k5RFLX+fHHMZkSKki36zzHogU9f/oEMs2qFgoCSDiWebcZFh2QKBPoqAEf+25v2KkvX4V4Ig== Received: from DM6NAM11FT039.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4d::40) by DM6NAM11HT186.eop-nam11.prod.protection.outlook.com (2a01:111:e400:fc4d::454) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3676.25; Fri, 18 Dec 2020 18:50:28 +0000 Received: from MWHPR06MB3102.namprd06.prod.outlook.com (2a01:111:e400:fc4d::48) by DM6NAM11FT039.mail.protection.outlook.com (2a01:111:e400:fc4d::83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3676.25 via Frontend Transport; Fri, 18 Dec 2020 18:50:28 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:09A7ED3492B65683364D6763FEFB7C6E1233492563E27693635ECBCC86B89D57;UpperCasedChecksum:B1C3369AD70501098D2C2411D4EDFB2E01397347C749EC46152902D125AFC85F;SizeAsReceived:7500;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.3654.026; Fri, 18 Dec 2020 18:50:28 +0000 From: "Kun Qin" To: devel@edk2.groups.io CC: Ard Biesheuvel , Sami Mujawar , Jiewen Yao , Supreeth Venkatesh Subject: [PATCH v1 01/15] StandaloneMmPkg: StandaloneMmCoreEntryPoint: Extends support for X64 Date: Fri, 18 Dec 2020 10:49:57 -0800 Message-ID: X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20201218185011.1366-1-kun.q@outlook.com> References: <20201218185011.1366-1-kun.q@outlook.com> X-TMN: [yPz4akpV8dmRv9FeMj0IORX1Z5VngQSe] X-ClientProxiedBy: MW2PR16CA0018.namprd16.prod.outlook.com (2603:10b6:907::31) To MWHPR06MB3102.namprd06.prod.outlook.com (2603:10b6:301:3e::35) Return-Path: kun.q@outlook.com X-Microsoft-Original-Message-ID: <20201218185011.1366-2-kun.q@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (50.35.88.161) by MW2PR16CA0018.namprd16.prod.outlook.com (2603:10b6:907::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.12 via Frontend Transport; Fri, 18 Dec 2020 18:50:28 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 47 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 7058da57-f42d-4744-be5a-08d8a385c9ce X-MS-TrafficTypeDiagnostic: DM6NAM11HT186: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: miMm8zpnlFKKXOjc+c51ILjvOMr33LyuQ1FzXx38yyjgjl/VuNg9vW/JE2bIvW7kXQws+U5H+yje3OOb2RrIW+nymu/RmW7Z1tb5lo87m6ZZILQZ6Z3BTIGeDMxWLVnzxFbH/PDGbGSQLunr2dwC7L7CREuRNMTST7/zuYhTdfKBMEz36mvvOKy7vFlhmYXv/7HuDJGlz7amDdYXcKNzPHmE02lXoy/Yr4wffrhv5opZQvMYEDl6uTAcUggWkyyu X-MS-Exchange-AntiSpam-MessageData: ii9JewbC/fG4wHLhTVDIRQKItFcKsAQZlS4nVYuisQtPMoKrGYG9YPcdAS9/+0Ahv/IBDiUXBGh6Knz1euqma6ZjB8xxXkWpsJi0nA+lgGQ4QITFleWKBie5jRthGtw2xFJdieKW/57W+2PFA5Uvxw== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2020 18:50:28.4002 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-Network-Message-Id: 7058da57-f42d-4744-be5a-08d8a385c9ce X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT039.eop-nam11.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: DM6NAM11HT186 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 --- 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 7d6ee4e08ecb..3b7629bc8fb9 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.28.0.windows.1