Skip to content

Add PciResourcesPreAssigned config flag to skip PCI bus enumeration#78

Merged
maheeraeron merged 1 commit into
microsoft:mainfrom
jstarks:pci_pre_assign
Jun 1, 2026
Merged

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

Conversation

@jstarks

@jstarks jstarks commented May 23, 2026

Copy link
Copy Markdown
Member

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

Copilot AI left a comment

Copy link
Copy Markdown

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.

Comment thread MsvmPkg/PlatformPei/Config.c
Comment thread MsvmPkg/Include/BiosInterface.h Outdated
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 commented May 30, 2026

Copy link
Copy Markdown
Member Author

@mebersol, @chris-oo this is ready.

@maheeraeron maheeraeron merged commit 4752de7 into microsoft:main Jun 1, 2026
8 checks passed
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.

3 participants