summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2016-03-13 15:34:07 +0100
committerLaszlo Ersek <lersek@redhat.com>2016-03-23 17:39:35 +0100
commit8f35eb92c419f8a02dcaaac41073d88739a86562 (patch)
tree5b5465e854e13ebdfe16ae4f336d0dbc3245eebd /OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c
parentb6bc800d5ad6f15588a1f5e44f7aa67499399787 (diff)
downloadedk2-8f35eb92c419f8a02dcaaac41073d88739a86562.tar.gz
edk2-8f35eb92c419f8a02dcaaac41073d88739a86562.tar.bz2
edk2-8f35eb92c419f8a02dcaaac41073d88739a86562.zip
OvmfPkg: AcpiPlatformDxe: enable PCI IO and MMIO while fetching QEMU tables
Now that the previous patches ensure that we can access all PCI devices in AcpiPlatformDxe, we can enable IO and MMIO decoding for all of them while we contact QEMU for the ACPI tables. See more details in the patch titled: OvmfPkg: introduce gRootBridgesConnectedEventGroupGuid In particular, this patch will prevent the bug when the 64-bit MMIO aperture is completely missing from QEMU's _CRS, and consequently Linux rejects 64-bit BARs with the error message pci 0000:00:03.0: can't claim BAR 4 [mem 0x800000000-0x8007fffff 64bit pref]: no compatible bridge window Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Diffstat (limited to 'OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c')
-rw-r--r--OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c b/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c
index 81620448a0..faaff3757c 100644
--- a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c
+++ b/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c
@@ -561,6 +561,8 @@ InstallQemuFwCfgTables (
UINTN FwCfgSize;
QEMU_LOADER_ENTRY *LoaderStart;
CONST QEMU_LOADER_ENTRY *LoaderEntry, *LoaderEnd;
+ ORIGINAL_ATTRIBUTES *OriginalPciAttributes;
+ UINTN OriginalPciAttributesCount;
ORDERED_COLLECTION *Tracker;
UINTN *InstalledKey;
INT32 Installed;
@@ -580,8 +582,10 @@ InstallQemuFwCfgTables (
if (LoaderStart == NULL) {
return EFI_OUT_OF_RESOURCES;
}
+ EnablePciDecoding (&OriginalPciAttributes, &OriginalPciAttributesCount);
QemuFwCfgSelectItem (FwCfgItem);
QemuFwCfgReadBytes (FwCfgSize, LoaderStart);
+ RestorePciDecoding (OriginalPciAttributes, OriginalPciAttributesCount);
LoaderEnd = LoaderStart + FwCfgSize / sizeof *LoaderEntry;
Tracker = OrderedCollectionInit (BlobCompare, BlobKeyCompare);