[PATCH 0/1] x86/PCI: Disable exclusion of E820 reserved addresses in some cases

From: Hans de Goede
Date: Wed Feb 16 2022 - 10:02:04 EST


Hi all,

Here is a new patch to try and address the exclusion of E820 reserved
addresses from PCI bridge windows causing issues on some systems.

Since the previous attempt at fixing this (commit 7f7b4236f204 ("x86/PCI:
Ignore E820 reservations for bridge windows on newer systems")) we have
learned that excluding E820 reserved addresses from PCI bridge windows
helps to workaround issues where the ACPI _CRS advertised window for
the bridge overlaps with some mem addresses which we should not touch,
so just disabling it on most new systems turns out to not be a good idea.

This new patch instead takes a very narrow approach. On all the systems
where we end up having issues to allocate PCI BARs this is caused by there
being a MMIO EFI memmap entry which covers the entire ACPI _CRS advertised
window for the PCI bridge. This new patch makes use of this by making
pci_acpi_root_prepare_resources() check for those specific set of
conditions and when these exact conditions are met, then disable the
exclusion of E820 reserved addresses from PCI bridge windows, to fix
the PCI BAR allocation failures.

This has been successfully tested on one of the laptops where we were
seeing PCI BAR allocation failures, see:
https://bugzilla.redhat.com/show_bug.cgi?id=1868899

I've also tested this on a X1C8 and the new "host bridge window %pR is
marked by EFI as MMIO" message does not show up there as expected.

Regards,

Hans


Hans de Goede (1):
x86/PCI: Disable exclusion of E820 reserved addressed in some cases

arch/x86/include/asm/pci_x86.h | 8 +++++
arch/x86/kernel/resource.c | 4 +++
arch/x86/pci/acpi.c | 65 +++++++++++++++++++++++++++++++++-
3 files changed, 76 insertions(+), 1 deletion(-)

--
2.33.1