REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4468
This is a followup to the RFC that I sent to the edk2-devel list on the 25th of May. In an attempt to make some incremental progress, this v2 only covers the NX remapping of the DXE stack in DxeIpl, using the newly introduced memory attributes PPI. Other use cases are deferred until we can converge on an approach that works across architectures and platforms. In particular, this means the following use cases: - mapping the DXE core code and data regions RO and XP, respectively; - mapping shadowed PEIMs read-only (including the PEI core itself); - managing memory permissions after temporary RAM migration; - reorganizing the X64 PEI flow with respect to page table allocation; - managing the dispatch order of the PEIM producing the PPI in relation to its consumers. The current series specifies the PPI in patch #1, and wires it up into DxeIpl to remap the DXE stack non-executable in a generic manner (patches #2 and #3) Patches #4 and #5 implement the PPI for ARM and AArch64. Patch #6 switches ARM and AArch64 over to the generic DxeIpl. Patch #7 cleans up the ARM implementation of the UEFI memory attributes protocol, based on the improvements made in patch #4. Changes since RFC (in addition to the above): - update PPI protype to use attributes+mask instead of setmask+clearmask - drop OVMF patch for RISC-V that has been applied in the meantime Cc: Ray Ni <ray...@intel.com> Cc: Jiewen Yao <jiewen....@intel.com> Cc: Gerd Hoffmann <kra...@redhat.com> Cc: Taylor Beebe <t...@taylorbeebe.com> Cc: Oliver Smith-Denny <o...@smith-denny.com> Cc: Dandan Bi <dandan...@intel.com> Cc: Dun Tan <dun....@intel.com> Cc: Liming Gao <gaolim...@byosoft.com.cn> Cc: "Kinney, Michael D" <michael.d.kin...@intel.com> Cc: Leif Lindholm <quic_llind...@quicinc.com> Cc: Michael Kubacki <mikub...@linux.microsoft.com> Ard Biesheuvel (7): MdeModulePkg: Define memory attribute PPI MdeModulePkg/DxeIpl: Merge EBC, RISCV64 and LOONGARCH code MdeModulePkg/DxeIpl: Use memory attribute PPI to remap the stack NX ArmPkg/ArmMmuLib: Extend API to manage memory permissions better ArmPkg/CpuPei: Implement the memory attributes PPI MdeModulePkg/DxeIpl ARM AARCH64: Switch to generic handoff code ArmPkg/CpuDxe: Simplify memory attributes protocol implementation ArmPkg/Drivers/CpuDxe/CpuMmuCommon.c | 2 +- ArmPkg/Drivers/CpuDxe/MemoryAttribute.c | 50 +---------- ArmPkg/Drivers/CpuPei/CpuPei.c | 76 +++++++++++++++++ ArmPkg/Drivers/CpuPei/CpuPei.inf | 4 + ArmPkg/Include/Library/ArmMmuLib.h | 36 +++++++- ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c | 52 +++++++++++- ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibUpdate.c | 88 +++++++++++++++++--- ArmPkg/Library/OpteeLib/Optee.c | 2 +- MdeModulePkg/Core/DxeIplPeim/Arm/DxeLoadFunc.c | 71 ---------------- MdeModulePkg/Core/DxeIplPeim/{Ebc/DxeLoadFunc.c => DxeHandoff.c} | 31 ++++++- MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf | 24 ++---- MdeModulePkg/Core/DxeIplPeim/LoongArch64/DxeLoadFunc.c | 63 -------------- MdeModulePkg/Core/DxeIplPeim/RiscV64/DxeLoadFunc.c | 75 ----------------- MdeModulePkg/Include/Ppi/MemoryAttribute.h | 83 ++++++++++++++++++ MdeModulePkg/MdeModulePkg.dec | 3 + 15 files changed, 366 insertions(+), 294 deletions(-) delete mode 100644 MdeModulePkg/Core/DxeIplPeim/Arm/DxeLoadFunc.c rename MdeModulePkg/Core/DxeIplPeim/{Ebc/DxeLoadFunc.c => DxeHandoff.c} (62%) delete mode 100644 MdeModulePkg/Core/DxeIplPeim/LoongArch64/DxeLoadFunc.c delete mode 100644 MdeModulePkg/Core/DxeIplPeim/RiscV64/DxeLoadFunc.c create mode 100644 MdeModulePkg/Include/Ppi/MemoryAttribute.h -- 2.39.2 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#105649): https://edk2.groups.io/g/devel/message/105649 Mute This Topic: https://groups.io/mt/99288474/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-