audk/OvmfPkg/AcpiPlatformDxe
Laszlo Ersek 818bc86aa7 OvmfPkg: AcpiPlatformDxe: make dependency on PCI enumeration dynamic
SVN r16411 delayed ACPI table installation until PCI enumeration was
complete, because on QEMU the ACPI-related fw_cfg files should have been
downloaded only after PCI enumeration. Said commit implemented the
dependency by tightening the module's depex.

This patch replaces the EFI_PCI_ENUMERATION_COMPLETE_PROTOCOL depex with a
matching protocol registration callback. The depex was static, and it
could not handle dynamically discovered situations when the dependency
would turn out invalid.

Namely:

- At the moment, the depex in "QemuFwCfgAcpiPlatformDxe.inf" assumes
  that "ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationQemu.dsc"
  lacks PCI support. However, PCI support is about to become run-time
  discoverable on that platform. If PCI support is missing, then
  ArmVirtualizationPkg will set PcdPciDisableBusEnumeration to TRUE.

  Hence, when PcdPciDisableBusEnumeration is TRUE, we invalidate the
  dependency by not registering the callback and installing the ACPI
  tables right away.

- InitializeXen() in "OvmfPkg/PlatformPei/Xen.c" sets
  PcdPciDisableBusEnumeration to TRUE. This causes
  PciBusDriverBindingStart() in "MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c"
  to set gFullEnumeration to FALSE, which in turn makes PciEnumerator() in
  "MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c" branch to
  PciEnumeratorLight(). The installation of
  EFI_PCI_ENUMERATION_COMPLETE_PROTOCOL at the end of PciEnumerator() is
  not reached.

  Which means that starting with SVN r16411, AcpiPlatformDxe is never
  dispatched on Xen.

  Hence, when PcdPciDisableBusEnumeration is TRUE, we invalidate the
  dependency by not registering the callback and installing the ACPI
  tables right away.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
[jordan.l.justen@intel.com: Removed PcdOvmfPciEnabled]
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16887 6f19259b-4bc3-4df7-8a09-765794883524
2015-02-19 23:46:27 +00:00
..
AcpiPlatform.c OvmfPkg: AcpiPlatformDxe: extract common entry point 2015-02-19 23:45:57 +00:00
AcpiPlatform.h OvmfPkg: AcpiPlatformDxe: extract common entry point 2015-02-19 23:45:57 +00:00
AcpiPlatformDxe.inf OvmfPkg: AcpiPlatformDxe: make dependency on PCI enumeration dynamic 2015-02-19 23:46:27 +00:00
EntryPoint.c OvmfPkg: AcpiPlatformDxe: make dependency on PCI enumeration dynamic 2015-02-19 23:46:27 +00:00
Qemu.c OvmfPkg/AcpiPlatformDxe: Split QEMU fw-cfg into a new file 2015-02-02 19:08:57 +00:00
QemuFwCfgAcpi.c OvmfPkg: AcpiPlatformDxe: extract common entry point 2015-02-19 23:45:57 +00:00
QemuFwCfgAcpiPlatform.c OvmfPkg: AcpiPlatformDxe: extract common entry point 2015-02-19 23:45:57 +00:00
QemuFwCfgAcpiPlatformDxe.inf OvmfPkg: AcpiPlatformDxe: make dependency on PCI enumeration dynamic 2015-02-19 23:46:27 +00:00
QemuLoader.h OvmfPkg: AcpiPlatformDxe: actualize QemuLoader.h comments 2014-09-22 21:11:09 +00:00
Xen.c OvmfPkg/AcpiPlatformDxe: Fix Visual Studio build issues 2012-08-09 23:27:05 +00:00