Skip to content

Add PciResourcesPreAssigned config flag to skip PCI bus enumeration#78

Open
jstarks wants to merge 1 commit into
microsoft:mainfrom
jstarks:pci_pre_assign
Open

Add PciResourcesPreAssigned config flag to skip PCI bus enumeration#78
jstarks wants to merge 1 commit into
microsoft:mainfrom
jstarks:pci_pre_assign

Conversation

@jstarks
Copy link
Copy Markdown
Member

@jstarks jstarks commented May 23, 2026

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.

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.
@jstarks jstarks requested a review from Copilot May 24, 2026 02:06
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.PcdPciDisableBusEnumeration in Platform PEI.
  • Sets the new PCD based on UEFI_CONFIG_FLAGS.Flags.PciResourcesPreAssigned.
  • Extends UEFI_CONFIG_FLAGS with 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;
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.

2 participants