[CHERRY-PICK][REBASE & FF] Revert Mu Commit in Favor of edk2 Commit#1758
Merged
os-d merged 2 commits intomicrosoft:release/202511from Apr 10, 2026
Merged
[CHERRY-PICK][REBASE & FF] Revert Mu Commit in Favor of edk2 Commit#1758os-d merged 2 commits intomicrosoft:release/202511from
os-d merged 2 commits intomicrosoft:release/202511from
Conversation
…loc" This reverts commit 919765a as it has been upstreamed to edk2.
…age Alloc Currently, there is a bug in UpdateRegionMappingRecursive() when guard pages are enabled and a large page is being split. The code checks whether the page table is a block or table and seeing that it is a block, allocates a new page table for the next level. However, when it does this, it will call an additional recursive call into the page table updating logic to make sure the new page table page is mapped. In addition, when guard pages are enabled, it will mark the guard page as RP. If the guard page is in the same block as we are already trying to split, the recursive call will split the block and mark the guard page as RP. When we return to the original call, it will fill out the now orphaned page table but never install it into the page table hierarchy (and if it did, it would lose the guard page). This has been observed to cause a driver's code section to still have NX set on it and so crash when trying to execute. This commit resolves the issue by checking if the block has already been split when we return from the new page table allocation. If it has, we simply update the existing table mapping instead of trying to split the block. The allocated page table page cannot be immediately freed, because this might trigger the block to get re-merged, so a reference to it is held until the end of updating this level and subsequent levels, when it can be safely freed. It is possible that the mapping extends across two large pages and this issue could exist on both sides, so in the worst case we may have two orphaned tables to free. Signed-off-by: Oliver Smith-Denny <osde@microsoft.com> (cherry picked from commit b2a149cf97e4244e61930207c050075311996c2f)
Contributor
✅ QEMU Validation PassedSource Dependencies
Results
Workflow run: https://github.com/microsoft/mu_basecore/actions/runs/24252321472 This comment was automatically generated by the Mu QEMU PR Validation workflow. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release/202511 #1758 +/- ##
================================================
Coverage ? 4.78%
================================================
Files ? 146
Lines ? 27177
Branches ? 527
================================================
Hits ? 1301
Misses ? 25852
Partials ? 24
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Javagedes
approved these changes
Apr 10, 2026
cfernald
approved these changes
Apr 10, 2026
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
Revert a Mu commit in favor of the edk2 commit.
How This Was Tested
N/A.
Integration Instructions
N/A.