From nobody Thu Dec 18 19:31:59 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+105310+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+105310+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1685025090; cv=none; d=zohomail.com; s=zohoarc; b=R0mq+J173ZE+x2N7e1cENP9Cu4GjSEljYncibjKsvem/ZK5MkV2Q/hx/3sZjp+kJf6NYhxLQlEEpgGt5Ay0FbhkDRF0bIMjh0paFnMVUkgX372wErw8j0uGfZvLoTnL4J/TSTidjtEdh6sfvEgnjIlxjkOdgSwILFj/kfmyPyC8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685025090; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=gHY08XtmWLCNrceIA5jLGA1rwATQiLCV41Ccuas+3xg=; b=UwHWwy3ZOULIxv4kaqDTK4+FttPYXpvJD0FUQjtvXuk7SE5AJ+L6EWiXf1gMp/zQbnFNGfhFQfAQ/yZ9UsHeC5Fw5En4MH408xUE8fyWDjYntVMZH5S+zfkZ3p1niUAUC1GFpI12u4PxQXL72xfk0EYNmfh/pn3WGw7o7nGphRo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+105310+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1685025090152537.1455200330721; Thu, 25 May 2023 07:31:30 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id ScMyYY1788612x5X3RBpaqWz; Thu, 25 May 2023 07:31:29 -0700 X-Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mx.groups.io with SMTP id smtpd.web11.13289.1685025089047176997 for ; Thu, 25 May 2023 07:31:29 -0700 X-Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 93F23645DC; Thu, 25 May 2023 14:31:28 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 79C24C4339B; Thu, 25 May 2023 14:31:25 +0000 (UTC) From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Ray Ni , Jiewen Yao , Gerd Hoffmann , Taylor Beebe , Oliver Smith-Denny , Dandan Bi , Liming Gao , "Kinney, Michael D" , Leif Lindholm , Sunil V L , Andrei Warkentin Subject: [edk2-devel] [RFC PATCH 10/10] MdeModulePkg/DxeIpl ARM AARCH64: Switch to generic handoff code Date: Thu, 25 May 2023 16:30:41 +0200 Message-Id: <20230525143041.1172989-11-ardb@kernel.org> In-Reply-To: <20230525143041.1172989-1-ardb@kernel.org> References: <20230525143041.1172989-1-ardb@kernel.org> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,ardb@kernel.org X-Gm-Message-State: pxUT6n8PsYc1y9Pji7fvbVsWx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1685025089; bh=pKBQd0ZPk5aDEXgV4thkO2Zroc9e0g974vuIs7FXZvk=; h=Cc:Date:From:Reply-To:Subject:To; b=rctmOpBKPXSL9IhaBO7FfCEWCmI36gWBDygCdiUYS4Qdj8rbU4RqnzwfcWwiER//4B4 mM8aTuvF64wmhltxK3etcxCL+vmxf0dbAYLrYpR6MEj0YUY34c7zHOSOr+r/DtavYTMM5 Iei+DOq4NGZnCiYc20SnFTPdX7iQRqCwC2U= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1685025090731100009 Content-Type: text/plain; charset="utf-8" Now that we have a generic method to manage memory permissions using a PPI, we can switch to the generic version of the DXE handoff code in DxeIpl, and drop the ARM specific version. Signed-off-by: Ard Biesheuvel --- MdeModulePkg/Core/DxeIplPeim/Arm/DxeLoadFunc.c | 71 -------------------- MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf | 11 +-- 2 files changed, 1 insertion(+), 81 deletions(-) diff --git a/MdeModulePkg/Core/DxeIplPeim/Arm/DxeLoadFunc.c b/MdeModulePkg/= Core/DxeIplPeim/Arm/DxeLoadFunc.c deleted file mode 100644 index f62b6dcb38a702d7..0000000000000000 --- a/MdeModulePkg/Core/DxeIplPeim/Arm/DxeLoadFunc.c +++ /dev/null @@ -1,71 +0,0 @@ -/** @file - ARM specifc functionality for DxeLoad. - -Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
-Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
- -SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#include "DxeIpl.h" - -#include - -/** - Transfers control to DxeCore. - - This function performs a CPU architecture specific operations to execute - the entry point of DxeCore with the parameters of HobList. - It also installs EFI_END_OF_PEI_PPI to signal the end of PEI phase. - - @param DxeCoreEntryPoint The entry point of DxeCore. - @param HobList The start of HobList passed to DxeCore. - -**/ -VOID -HandOffToDxeCore ( - IN EFI_PHYSICAL_ADDRESS DxeCoreEntryPoint, - IN EFI_PEI_HOB_POINTERS HobList - ) -{ - VOID *BaseOfStack; - VOID *TopOfStack; - EFI_STATUS Status; - - // - // Allocate 128KB for the Stack - // - BaseOfStack =3D AllocatePages (EFI_SIZE_TO_PAGES (STACK_SIZE)); - ASSERT (BaseOfStack !=3D NULL); - - if (PcdGetBool (PcdSetNxForStack)) { - Status =3D ArmSetMemoryRegionNoExec ((UINTN)BaseOfStack, STACK_SIZE); - ASSERT_EFI_ERROR (Status); - } - - // - // Compute the top of the stack we were allocated. Pre-allocate a UINTN - // for safety. - // - TopOfStack =3D (VOID *)((UINTN)BaseOfStack + EFI_SIZE_TO_PAGES (STACK_SI= ZE) * EFI_PAGE_SIZE - CPU_STACK_ALIGNMENT); - TopOfStack =3D ALIGN_POINTER (TopOfStack, CPU_STACK_ALIGNMENT); - - // - // End of PEI phase singal - // - Status =3D PeiServicesInstallPpi (&gEndOfPeiSignalPpi); - ASSERT_EFI_ERROR (Status); - - // - // Update the contents of BSP stack HOB to reflect the real stack info p= assed to DxeCore. - // - UpdateStackHob ((EFI_PHYSICAL_ADDRESS)(UINTN)BaseOfStack, STACK_SIZE); - - SwitchStack ( - (SWITCH_STACK_ENTRY_POINT)(UINTN)DxeCoreEntryPoint, - HobList.Raw, - NULL, - TopOfStack - ); -} diff --git a/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf b/MdeModulePkg/Core/Dx= eIplPeim/DxeIpl.inf index 7126a96d8378d1f8..f1990eac77607854 100644 --- a/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf +++ b/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf @@ -45,19 +45,13 @@ [Sources.X64] X64/VirtualMemory.c X64/DxeLoadFunc.c =20 -[Sources.ARM, Sources.AARCH64] - Arm/DxeLoadFunc.c - -[Sources.LOONGARCH64,Sources.RISCV64,Sources.EBC] +[Sources.LOONGARCH64,Sources.RISCV64,Sources.EBC,Sources.ARM,Sources.AARCH= 64] DxeHandoff.c =20 [Packages] MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec =20 -[Packages.ARM, Packages.AARCH64] - ArmPkg/ArmPkg.dec - [LibraryClasses] PcdLib MemoryAllocationLib @@ -74,9 +68,6 @@ [LibraryClasses] PeiServicesTablePointerLib PerformanceLib =20 -[LibraryClasses.ARM, LibraryClasses.AARCH64] - ArmMmuLib - [Ppis] gEfiDxeIplPpiGuid ## PRODUCES gEfiPeiDecompressPpiGuid ## PRODUCES --=20 2.39.2 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#105310): https://edk2.groups.io/g/devel/message/105310 Mute This Topic: https://groups.io/mt/99131200/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-