Add PciResourcesPreAssigned config flag to skip PCI bus enumeration#78
Open
jstarks wants to merge 1 commit into
Open
Add PciResourcesPreAssigned config flag to skip PCI bus enumeration#78jstarks wants to merge 1 commit into
jstarks wants to merge 1 commit into
Conversation
When the VMM has pre-assigned PCI bus numbers and BAR addresses, it sets the PciResourcesPreAssigned flag in UEFI_CONFIG_FLAGS. PlatformPei reads this flag and sets PcdPciDisableBusEnumeration to TRUE, causing PciBusDxe to use its PciEnumeratorLight() path which discovers devices and reads their existing BAR values without reallocating resources. Also adds placeholder bits for HvSintEnabled (bit 30) and VmbusDisabled (bit 31) to keep the config flags layout in sync with other branches.
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds support for disabling PCI bus enumeration via a platform configuration flag, wiring it through PCDs and exposing the control bit in the BIOS interface flags.
Changes:
- Introduces use of
gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumerationin Platform PEI. - Sets the new PCD based on
UEFI_CONFIG_FLAGS.Flags.PciResourcesPreAssigned. - Extends
UEFI_CONFIG_FLAGSwith new flag bits and updates default PCD values in DSCs.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| MsvmPkg/PlatformPei/PlatformPei.inf | Declares the module’s consumption of PcdPciDisableBusEnumeration. |
| MsvmPkg/PlatformPei/Config.c | Sets PcdPciDisableBusEnumeration from a UEFI config flag. |
| MsvmPkg/MsvmPkgX64.dsc | Adds default value for PcdPciDisableBusEnumeration (FALSE). |
| MsvmPkg/MsvmPkgAARCH64.dsc | Adds default value for PcdPciDisableBusEnumeration (FALSE). |
| MsvmPkg/Include/BiosInterface.h | Adds new bitfields including PciResourcesPreAssigned. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -943,6 +943,7 @@ ConfigSetUefiConfigFlags( | |||
| PEI_FAIL_FAST_IF_FAILED(PcdSetBoolS(PcdWatchdogEnabled, (UINT8) ConfigFlags->Flags.WatchdogEnabled)); | |||
| PEI_FAIL_FAST_IF_FAILED(PcdSetBoolS(PcdTpmLocalityRegsEnabled, (UINT8) ConfigFlags->Flags.TpmLocalityRegsEnabled)); | |||
| PEI_FAIL_FAST_IF_FAILED(PcdSetBoolS(PcdMtrrsInitializedAtLoad, (UINT8) ConfigFlags->Flags.MtrrsInitializedAtLoad)); | |||
Comment on lines
+792
to
+795
| UINT64 HvSintEnabled : 1; | ||
| UINT64 VmbusDisabled : 1; | ||
| UINT64 PciResourcesPreAssigned : 1; | ||
| UINT64 Reserved:32; |
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.
When the VMM has pre-assigned PCI bus numbers and BAR addresses, it sets the PciResourcesPreAssigned flag in UEFI_CONFIG_FLAGS. PlatformPei reads this flag and sets PcdPciDisableBusEnumeration to TRUE, causing PciBusDxe to use its PciEnumeratorLight() path which discovers devices and reads their existing BAR values without reallocating resources.
Also adds placeholder bits for HvSintEnabled (bit 30) and VmbusDisabled (bit 31) to keep the config flags layout in sync with other branches.