Skip to content

[CHERRY-PICK] [REBASE & FF] Don't Duplicate Stack Memory Allocation HOB - #1906

Merged
Oliver Smith-Denny (os-d) merged 2 commits into
microsoft:release/202511from
os-d:cp_stck_hob
Sep 4, 2026
Merged

[CHERRY-PICK] [REBASE & FF] Don't Duplicate Stack Memory Allocation HOB#1906
Oliver Smith-Denny (os-d) merged 2 commits into
microsoft:release/202511from
os-d:cp_stck_hob

Conversation

@os-d

Copy link
Copy Markdown
Contributor

Description

This cherry-picks two commits from edk2 to not duplicate the stack allocation HOB.

  • Impacts functionality?
  • Impacts security?
  • Breaking change?
  • Includes tests?
  • Includes documentation?

How This Was Tested

See edk2 PR.

Integration Instructions

N/A.

… Stack

Currently, DxeIpl will allocate memory for the new DXE stack,
which creates a memory allocation HOB for that region. It will
then call UpdateStackHob() to find the stack HOB with the old
stack info and update the memory address/length to correspond
to the new stack. It then creates a new memory allocation HOB
for the old stack region as it needs to remain mapped.

This ends up creating two memory allocation HOBs for the new
stack: a regular memory allocation HOB for the AllocatePages()
call and then the stack HOB (which is a memory allocation HOB
with a special name).

When DXE Core ingests these, it will ignore one of the two HOBs
when it goes to allocate memory. However, this is incorrectly
describing handoff state. There never should be overlapping
memory allocation HOBs.

This commit updates DxeIpl behavior to instead find the old
stack HOB, convert it to a regular memory allocation HOB,
then find the memory allocation HOB for the new stack range
and convert it into the stack HOB.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
(cherry picked from commit ee655c4d815231bd0916fbdde7a59f4dfdf0ee9f)
… Alloc

Currently, PrePiHobLib will produce two memory allocation
HOBs for the stack, based on the behavior it copied from
DxeIpl. This is an incorrect description of handoff state.

This commit follows the DxeIpl logic change to only produce
a single memory allocation HOB for the new stack. The
difference is that PrePiHobLib does not preserve the old
stack region and instead frees it. That behavior is
preserved.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
(cherry picked from commit e9b31236bdbc6e0fe179c56d16c6ffe125c6069d)
@mu-automation

mu-automation Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

❌ QEMU Validation Failed

Source Dependencies

Repository Commit
mu_basecore bb2e2f9
mu_tiano_platforms b530a5c

Results

Platform Target Build Boot Overall Boot Time Build Logs Boot Logs
Q35 DEBUG ❌ failure ⏩ skipped N/A Build Logs N/A
ArmVirt DEBUG ✅ success ✅ success 0m 13s Build Logs Boot Logs

Workflow run: https://github.com/microsoft/mu_basecore/actions/runs/33833510004

This comment was automatically generated by the Mu QEMU PR Validation workflow.

@codecov-commenter

Codecov Comments Bot (codecov-commenter) commented Sep 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (release/202511@a5197f8). Learn more about missing BASE report.

Additional details and impacted files
@@                Coverage Diff                @@
##             release/202511    #1906   +/-   ##
=================================================
  Coverage                  ?    1.65%           
=================================================
  Files                     ?      637           
  Lines                     ?   232965           
  Branches                  ?      519           
=================================================
  Hits                      ?     3865           
  Misses                    ?   229076           
  Partials                  ?       24           
Flag Coverage Δ
MdeModulePkg 1.65% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@os-d

Copy link
Copy Markdown
Contributor Author

Qemu validation is failing for an unrelated override validation failure

@os-d
Oliver Smith-Denny (os-d) merged commit 7e2a44a into microsoft:release/202511 Sep 4, 2026
60 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants