From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mx.groups.io with SMTP id smtpd.web11.46681.1685355467141721609 for ; Mon, 29 May 2023 03:17:47 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fNfg4O+X; spf=pass (domain: kernel.org, ip: 139.178.84.217, mailfrom: ardb@kernel.org) 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 9EEAD6101A; Mon, 29 May 2023 10:17:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A7362C433A0; Mon, 29 May 2023 10:17:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685355466; bh=QEaQIf7zznljPyOzuLRffXAFPvy9ucyZ00TCMA/9YKs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fNfg4O+XN6oPy7um7d7PYpfcd1vrJUlv25Cl+PlVDDglkcZcFiyO42qNiq+QOeu2C OMPXR0NCJSgCzu44HEgNRDYEUiVtkmtCc5vhMC/DIVB0VNRHUQJoTVAjYOXwsfQNm/ /Vw73sO/oT5vyvPS2Q/6/4eEbGr3ugdNw+KeCDjFCSxRef+ocFRhkQ8MRCuzLX6OAO DxY1wrTUjJO/fkOKleTfj1IwR3y/YWVhF4q2wkkc2bm3LfXSF2kCHpmfiv2Rqlru+/ N9uaB65oeob6CwvWgAgYXetri5n3wqPdghLP8ONl6BlMGIf6QkEHId79lCaq/RFAv4 Y2eswSs9wb72w== 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 , Michael Kubacki Subject: [RFC PATCH 10/11] ArmVirtPkg/ArmVirtQemu: Allow CPU arch protocol DXE to execute in place Date: Mon, 29 May 2023 12:17:04 +0200 Message-Id: <20230529101705.2476949-11-ardb@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230529101705.2476949-1-ardb@kernel.org> References: <20230529101705.2476949-1-ardb@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Add ArmCpuDxe and its dependencies to the APRIORI DXE section, and use a rule override to emit the executable images in a way that permits them to execute in place from the firmware volume. This allows them to be mapped with the appropriate permissions before dispatching the DXE core. Signed-off-by: Ard Biesheuvel --- ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc | 17 ++++++++++++----- ArmVirtPkg/ArmVirtRules.fdf.inc | 9 +++++++++ 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc b/ArmVirtPkg/ArmVirtQemuF= vMain.fdf.inc index 8a063bac04ac287c..24d5c8dd1dc99ca6 100644 --- a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc +++ b/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc @@ -38,16 +38,23 @@ [FV.FvMain] READ_LOCK_CAP =3D TRUE=0D READ_LOCK_STATUS =3D TRUE=0D =0D + APRIORI DXE {=0D + INF MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf=0D + INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf=0D + INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf=0D + INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf=0D + INF ArmPkg/Drivers/CpuDxe/CpuDxe.inf=0D + }=0D INF MdeModulePkg/Core/Dxe/DxeMain.inf=0D - INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf=0D + INF RuleOverride=3DDXE_XIP MdeModulePkg/Universal/PCD/Dxe/Pcd.inf=0D INF OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf=0D - INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf=0D + INF RuleOverride=3DDXE_XIP EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe= .inf=0D INF OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf=0D =0D #=0D # PI DXE Drivers producing Architectural Protocols (EFI Services)=0D #=0D - INF ArmPkg/Drivers/CpuDxe/CpuDxe.inf=0D + INF RuleOverride=3DDXE_XIP ArmPkg/Drivers/CpuDxe/CpuDxe.inf=0D INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf=0D INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf=0D INF MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf=0D @@ -71,7 +78,7 @@ [FV.FvMain] INF MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf=0D INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf=0D =0D - INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf=0D + INF RuleOverride=3DDXE_XIP ArmPkg/Drivers/ArmGic/ArmGicDxe.inf=0D INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf=0D INF OvmfPkg/VirtNorFlashDxe/VirtNorFlashDxe.inf=0D INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf=0D @@ -107,7 +114,7 @@ [FV.FvMain] #=0D # Bds=0D #=0D - INF MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf=0D + INF RuleOverride=3DDXE_XIP MdeModulePkg/Universal/DevicePathDxe/DevicePa= thDxe.inf=0D INF MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf=0D INF MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf=0D INF MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerDxe= .inf=0D diff --git a/ArmVirtPkg/ArmVirtRules.fdf.inc b/ArmVirtPkg/ArmVirtRules.fdf.= inc index b8ec040d2330deb3..0b9acc6d9031d9cf 100644 --- a/ArmVirtPkg/ArmVirtRules.fdf.inc +++ b/ArmVirtPkg/ArmVirtRules.fdf.inc @@ -79,6 +79,15 @@ [Rule.Common.DXE_DRIVER] RAW ASL Optional |.aml=0D }=0D =0D +[Rule.Common.DXE_DRIVER.DXE_XIP]=0D + FILE DRIVER =3D $(NAMED_GUID) {=0D + DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NA= ME).depex=0D + PE32 PE32 Align =3D Auto $(INF_OUTPUT)/$(MODULE_NAME).efi= =0D + UI STRING=3D"$(MODULE_NAME)" Optional=0D + RAW ACPI Optional |.acpi=0D + RAW ASL Optional |.aml=0D + }=0D +=0D [Rule.Common.DXE_RUNTIME_DRIVER]=0D FILE DRIVER =3D $(NAMED_GUID) {=0D DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NA= ME).depex=0D --=20 2.39.2