diff options
| author | Michael D Kinney <michael.d.kinney@intel.com> | 2026-09-02 21:04:01 +0300 |
|---|---|---|
| committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2026-09-03 03:59:39 +0300 |
| commit | f014b04755065a5a47765fcc5bf31fca9ed008f3 (patch) | |
| tree | 50d5f1aed251afb74f3c5bee46a367bc0e872efb /BaseTools/Source/Python/Workspace/MetaFileParser.py | |
| parent | 2e53034f67fba2209468fdde33b6d0e0c24f767f (diff) | |
| download | edk2-f014b04755065a5a47765fcc5bf31fca9ed008f3.tar.xz | |
EmulatorPkg/Sec: Align stack before ZeroMem call to prevent seg fault
After SecTemporaryRamSupport restores its saved registers and moves RSP to
permanent memory, the stack is 16-byte aligned. The existing 0x28-byte
allocation for the ZeroMem call adds an unnecessary 8-byte padding slot
and leaves RSP misaligned immediately before the call.
Reserve only the 32-byte EFIAPI register spill area for ZeroMem. This
preserves 16-byte stack alignment at the call site while providing the
required home space to the callee.
https://github.com/tianocore/edk2/pull/12244 causes the X64 GCC and CLANG
tools to generate a prologue in InternalMemZeroMem() that requires a
16-byte aligned stack. With the previous stack allocation, that prologue
can execute with an incorrectly aligned stack. Without this change, a
seg fault is generated when SecTemporaryRamSupport calls ZeroMem.
The earlier CopyMem call continues to require its 0x28-byte allocation
because its preceding stack state differs.
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/Workspace/MetaFileParser.py')
0 files changed, 0 insertions, 0 deletions
