public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v2 0/7] Add PPI to manage PEI phase memory attributes
@ 2023-06-02 15:17 Ard Biesheuvel
  2023-06-02 15:17 ` [PATCH v2 1/7] MdeModulePkg: Define memory attribute PPI Ard Biesheuvel
                   ` (8 more replies)
  0 siblings, 9 replies; 15+ messages in thread
From: Ard Biesheuvel @ 2023-06-02 15:17 UTC (permalink / raw)
  To: devel
  Cc: Ard Biesheuvel, Ray Ni, Jiewen Yao, Gerd Hoffmann, Taylor Beebe,
	Oliver Smith-Denny, Dandan Bi, Dun Tan, Liming Gao,
	Kinney, Michael D, Leif Lindholm, Michael Kubacki

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.ni@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Taylor Beebe <t@taylorbeebe.com>
Cc: Oliver Smith-Denny <osd@smith-denny.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Dun Tan <dun.tan@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: "Kinney, Michael D" <michael.d.kinney@intel.com>
Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Michael Kubacki <mikuback@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


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2023-06-26  9:17 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-02 15:17 [PATCH v2 0/7] Add PPI to manage PEI phase memory attributes Ard Biesheuvel
2023-06-02 15:17 ` [PATCH v2 1/7] MdeModulePkg: Define memory attribute PPI Ard Biesheuvel
2023-06-02 15:17 ` [PATCH v2 2/7] MdeModulePkg/DxeIpl: Merge EBC, RISCV64 and LOONGARCH code Ard Biesheuvel
2023-06-06 18:48   ` [edk2-devel] " Michael Kubacki
2023-06-06 22:17     ` Ard Biesheuvel
2023-06-06 23:07       ` Michael Kubacki
2023-06-02 15:17 ` [PATCH v2 3/7] MdeModulePkg/DxeIpl: Use memory attribute PPI to remap the stack NX Ard Biesheuvel
2023-06-02 15:17 ` [PATCH v2 4/7] ArmPkg/ArmMmuLib: Extend API to manage memory permissions better Ard Biesheuvel
2023-06-02 15:17 ` [PATCH v2 5/7] ArmPkg/CpuPei: Implement the memory attributes PPI Ard Biesheuvel
2023-06-02 15:17 ` [PATCH v2 6/7] MdeModulePkg/DxeIpl ARM AARCH64: Switch to generic handoff code Ard Biesheuvel
2023-06-02 15:17 ` [PATCH v2 7/7] ArmPkg/CpuDxe: Simplify memory attributes protocol implementation Ard Biesheuvel
2023-06-06 16:42 ` [edk2-devel] [PATCH v2 0/7] Add PPI to manage PEI phase memory attributes Oliver Smith-Denny
2023-06-06 23:12 ` Michael Kubacki
2023-06-25  2:58   ` 回复: [edk2-devel] " gaoliming
2023-06-26  9:16     ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox