From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (NAM02-SN1-obe.outbound.protection.outlook.com []) by mx.groups.io with SMTP id smtpd.web08.1553.1609873192669577225 for ; Tue, 05 Jan 2021 10:59:55 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@outlook.com header.s=selector1 header.b=giIH6sX9; 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=DoSUIdnZd34ssIbcgiD68/vS48gckScpYwZa3giSxdpgq65vs3H3D8ZMKLnbcdwycCf1qwkQTp0H0qXAIBLMsNRCPtLYZYLO9o07Dokm8hS7FBrza0l8qmvvqSOdISHMq3KjKV6Xq8g86ctPzS8JiCiqDmeQ9xDSmAO2vW1ZLkDBhU0TfY8gdgDtpWOxI6kERZ0CcfSNjYqMoa6uqYKbgQVKpB6moLGH+7htId6Wm3lqfkERtBL7279YadQEKYWMe6yrTcGsbDZETKK8YEFJDc7Eu8zVdIZaUKHyCgrAOtz9C8IhXWvTl8qw8DQG7Iyi/B3QCyBfZPnLWD757dAH7A== 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=wgj69NkSOibBKUfXAdQxof3UVxVW16WZ28aBAbu8y+k=; b=FSiY3wTRB+taWgbNimZWLZz3CUPz9N8SZmgV+xxu+eryxLjPp+vYObwdwtbK0LuJ3n6RnzDWcaqCLaAAMlXxUPHk4sXt1HaYHuI2sdgbEgT+gYdDsL+ylAsvEaDe9G/HR/u72HjSxr0gN2KYqGxxXy8RJPwkpbe/sVd6a3iH7moK3AuvoKOWBxGiV41am25ZKsXgGmP8XEwWwtmu0xeDlNG4P7cc0EAL/V+Z00X1mbJ7Up0Sc1jS+sOBCt/oqcVtc7X9M/cUxBJVZNbRKzCigVGXRQ91bnFDIsTxW3CA2UitR9MSRfnPeyqx72zVupsQ066yyo+x7H6K0OlJ6BShcA== 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=wgj69NkSOibBKUfXAdQxof3UVxVW16WZ28aBAbu8y+k=; b=giIH6sX9tkWyj7OBJ63YVH5QDiUNfk8/gneM5nWko088VKborhIwgdHjimbivdnDwTCa2Myav/smnylblxX6YaTmlD5xaQinMKH6Pyal53F7ZWusCG2HN+vIlkhfw3QDss1n3bN7LMSSctNtk9OidR3x44KOCxIWGFrCzIZJNhihrjrBpQhoYoU3AlSeIu0NkIWZrM/zXsb6HACZdsB+Zpb1lhpoMAInEl17KdOa+T7uodqsOgkzryZb4YaYotwTmrF+0s3az+4YcmJHZpac1F8TMX84/0W51oD/3Nb7A4n+RW0jpxAeAwrafky2sgsR9ulU0gPZgGj0Jk22d9oxfA== Received: from CY1NAM02FT003.eop-nam02.prod.protection.outlook.com (10.152.74.55) by CY1NAM02HT104.eop-nam02.prod.protection.outlook.com (10.152.74.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3721.22; Tue, 5 Jan 2021 18:59:51 +0000 Received: from MWHPR06MB3102.namprd06.prod.outlook.com (2a01:111:e400:7e45::53) by CY1NAM02FT003.mail.protection.outlook.com (2a01:111:e400:7e45::151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3721.22 via Frontend Transport; Tue, 5 Jan 2021 18:59:51 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:2A38FA3DBBB2130769CC3DF65F66F9438D9B42BF17649A9433463206E0EEB8C4;UpperCasedChecksum:7CCACE7C3794735DE63E4462F598DDC710A7393B167176C1DD87C210D47DE7C6;SizeAsReceived:7570;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.3721.024; Tue, 5 Jan 2021 18:59:51 +0000 From: "Kun Qin" To: devel@edk2.groups.io CC: Ard Biesheuvel , Sami Mujawar , Jiewen Yao , Supreeth Venkatesh , Jiewen Yao Subject: [PATCH v2 01/16] StandaloneMmPkg: StandaloneMmCoreEntryPoint: Extends support for X64 Date: Tue, 5 Jan 2021 10:59:20 -0800 Message-ID: X-Mailer: git-send-email 2.30.0.windows.1 In-Reply-To: <20210105185935.3769-1-kun.q@outlook.com> References: <20210105185935.3769-1-kun.q@outlook.com> X-TMN: [PL6xPa1D9npt3BNdi/CGfFc3lyAbK6PF] X-ClientProxiedBy: MWHPR22CA0045.namprd22.prod.outlook.com (2603:10b6:300:69::31) To MWHPR06MB3102.namprd06.prod.outlook.com (2603:10b6:301:3e::35) Return-Path: kun.q@outlook.com X-Microsoft-Original-Message-ID: <20210105185935.3769-2-kun.q@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (50.35.88.161) by MWHPR22CA0045.namprd22.prod.outlook.com (2603:10b6:300:69::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.6 via Frontend Transport; Tue, 5 Jan 2021 18:59:51 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 47 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: f5c9d136-505e-44f7-12f1-08d8b1ac1503 X-MS-TrafficTypeDiagnostic: CY1NAM02HT104: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: C7FKC5eAB1PhCp9XhYeQjq8AHjKOwBj0sgiKJePbzN3LRXTM9t8eR+UjAGFF0rFP45JyWwISywNBD3nGJNYs/13sxg21smDPN+JXvbyj72ed7hUnow9FQXig7lqexKELokJGsomCnqvw7n4yU9byT5JokWz3PcL25POuqCYm1G3Q0x2d32hRucwSuzt60FeY5lQXeN7Mb4uruXSiewBa/zOjRJ14tSZcq4D1BGVl4wuj2zneCSIIlGGaF4NmdR0I X-MS-Exchange-AntiSpam-MessageData: 2mEiDX39WD0S1gZNrux2rc2TvMtJ17bYmqElLx9XBGQQ+/nAzR+xsNq/ZN+PwU71OhBGcd+xsi/tAsL48dGop57TuTp7d91ZzVjplc/roYKIeDhk6e68BvF5d/wtfOccI1Xhay6nT3i7CzI2G1U8Gw== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jan 2021 18:59:51.4281 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-Network-Message-Id: f5c9d136-505e-44f7-12f1-08d8b1ac1503 X-MS-Exchange-CrossTenant-AuthSource: CY1NAM02FT003.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: CY1NAM02HT104 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: 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 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.30.0.windows.1