]> git.proxmox.com Git - mirror_edk2.git/commit
OvmfPkg/PciHostBridgeUtilityLib: Initialize RootBridges apertures with spec
authorNicolas Ojeda Leon <ncoleon@amazon.com>
Tue, 29 Jun 2021 15:52:13 +0000 (17:52 +0200)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 22 Jun 2022 15:34:16 +0000 (15:34 +0000)
commit3f5b1b9132ffc4bc91ed3bc2da86afe5f78883e7
treee04c004a9d45c4524bda22e4386013096fad50ce
parent3497fd5c26da3956c4f06eed46a1e3a8fdac9c15
OvmfPkg/PciHostBridgeUtilityLib: Initialize RootBridges apertures with spec

Consume the host-provided specification of PCI host bridges if
available. Using the DxeHardwareInfoLib, populate a list of
hardware descriptors based on the content of the "hardware-info"
fw-cfg file, if provided. In the affirmative case, use the
resources and attributes specified by the hypervisor for each
Host Bridge to create the RootBridge elements.

In Ovmf platforms, the host can provide the specification of
non-discoverable hardware resources like PCI host bridges. If the
proper fw-cfg file is found, parse the contents provided by the
host into a linked list by using the Hardware Info library. Then,
using the list of PCI host bridges' descriptions, populate the
PCI_ROOT_BRIDGES array with the resources and attributes specified
by the host. If the file is not provided or no Host Bridge is found
in it, fold back to the legacy method based on pre-defined
apertures and rules.

In some use cases, the host requires additional control over the
hardware resources' configurations in the guest for performance and
discoverability reasons. For instance, to disclose information about
the PCI hierarchy to the guest so that this can profit from
optimized accesses. In this case, the host can decide to describe
multiple PCI Host Bridges and provide a specific set of resources
(e.g. MMIO apertures) so that the guest uses the values provided.
Using the provided values may entitle the guest to added performance,
for example by using specific MMIO mappings that can enable peer-to-peer
communication across the PCI hierarchy or by allocating memory closer
to a device for faster DMA transactions.

Cc: Alexander Graf <graf@amazon.de>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Nicolas Ojeda Leon <ncoleon@amazon.com>
OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBridgeUtilityLib.c
OvmfPkg/Library/PciHostBridgeUtilityLib/PciHostBridgeUtilityLib.inf