[CHERRY-PICK] MdeModulePkg: PciBusDxe: Degrade MEM64 to PMEM64 when bridge lacks MEM64#1690
Merged
kuqin12 merged 1 commit intomicrosoft:release/202511from Mar 10, 2026
Merged
Conversation
os-d
approved these changes
Mar 10, 2026
makubacki
approved these changes
Mar 10, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release/202511 #1690 +/- ##
=================================================
Coverage ? 1.58%
=================================================
Files ? 634
Lines ? 232239
Branches ? 420
=================================================
Hits ? 3672
Misses ? 228552
Partials ? 15
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:
|
apop5
approved these changes
Mar 10, 2026
…ridge lacks MEM64 P2P bridge Memory Base/Limit registers (0x20-0x22) only support 32-bit addresses. Previously, MEM64 resources behind such bridges were always degraded to MEM32, forcing allocation below 4GB. This can lead to resource constraints when using massive storage (such as MPF drives) as MEM32 space is limited on most platforms. Based on PCIe Base Specification 6.3+, assigning 64-bit resources irrespective of the prefetchable/non-prefetchable BAR bit is allowed. In DegradeResource(), if an upstream bridge supports PMEM64, MEM64 resources are now degraded to PMEM64 first. This enables 64-bit BAR allocation for devices like NVMe controllers that declare non- prefetchable 64-bit BARs. We still fall back to MEM32 degradation if the bridge lacks PMEM64 support as well. Ref: PCI-SIG ECN "Removing Prefetchable Terminology" (2024-04-05) Ref: PCIe Base Specification 6.3+ Signed-off-by: Kun Qin <kuqin12@gmail.com> (cherry picked from commit f6489621b8ae1164c5e4930902988ba7c86847ba)
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
P2P bridge Memory Base/Limit registers (0x20-0x22) only support 32-bit addresses. Previously, MEM64 resources behind such bridges were always degraded to MEM32, forcing allocation below 4GB. This can lead to resource constraints when using massive storage (such as MPF drives) as MEM32 space is limited on most platforms.
Based on PCIe Base Specification 6.3+, assigning 64-bit resources irrespective of the prefetchable/non-prefetchable BAR bit is allowed.
In DegradeResource(), if an upstream bridge supports PMEM64, MEM64 resources are now degraded to PMEM64 first. This enables 64-bit BAR allocation for devices like NVMe controllers that declare non- prefetchable 64-bit BARs.
We still fall back to MEM32 degradation if the bridge lacks PMEM64 support as well.
Ref: PCI-SIG ECN "Removing Prefetchable Terminology" (2024-04-05)
Ref: PCIe Base Specification 6.3+
How This Was Tested
This was tested on propreitary physical platform and verified that the PCIe devices behind P2P bridge can properly request 64bit resources without downgrading.
Integration Instructions
N/A