[CHERRY-PICK] [REBASE & FF] Don't Duplicate Stack Memory Allocation HOB - #1906
Merged
Oliver Smith-Denny (os-d) merged 2 commits intoSep 4, 2026
Merged
Conversation
… 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)
Contributor
❌ QEMU Validation FailedSource Dependencies
Results
Workflow run: https://github.com/microsoft/mu_basecore/actions/runs/33833510004 This comment was automatically generated by the Mu QEMU PR Validation workflow. |
Oliver Smith-Denny (os-d)
enabled auto-merge (rebase)
September 4, 2026 03:24
Aaron (apop5)
approved these changes
Sep 4, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
Author
|
Qemu validation is failing for an unrelated override validation failure |
Chris Fernald (cfernald)
approved these changes
Sep 4, 2026
Oliver Smith-Denny (os-d)
merged commit Sep 4, 2026
7e2a44a
into
microsoft:release/202511
60 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This cherry-picks two commits from edk2 to not duplicate the stack allocation HOB.
How This Was Tested
See edk2 PR.
Integration Instructions
N/A.