OvmfPkg/PlatformBootManagerLib: Enable PCI decoding on LPC bridge

Commit 01bd046e7b4b ("OvmfPkg/PlatformBootManagerLib: Remove blanket PCI
device enablement") removed the unconditional PciIo->Attributes()
EFI_PCI_DEVICE_ENABLE call across all PCI devices in
DetectAndPreparePlatformPciDevicePath().

Unlike PCI-to-PCI bridges (which PciBusDxe enables automatically in
StartPciDevicesOnBridge()), the PCI-to-ISA (LPC) bridge requires
EFI_PCI_DEVICE_ENABLE in DetectAndPreparePlatformPciDevicePath() for two
reasons:
1. SioBusDriverBindingSupported() in OvmfPkg/SioBusDxe is the only
   DriverBindingSupported() implementation in edk2 that checks
   Pci.Hdr.Command. It requires PCI I/O and memory space decoding
   ((Pci.Hdr.Command & 0x03) == 0x03) to already be enabled on the
   bridge before binding, so ISA serial (PNP0501) and PS/2 keyboard
   (PNP0303) console initialization fail without it.
2. Guest operating systems access legacy I/O ports behind the LPC/ISA
   bridge directly without a dedicated PCI driver for the LPC bridge
   device itself.

Re-enable EFI_PCI_DEVICE_ENABLE specifically when the LPC bridge is
detected in DetectAndPreparePlatformPciDevicePath() in
PlatformBootManagerLib and PlatformBootManagerLibBhyve.

Suggested-by: Ard Biesheuvel <ardb+tianocore@kernel.org>
Signed-off-by: Kevin Loughlin <kevinloughlin@google.com>
2 files changed