[PATCH] x86/PCI: add 16GB guard between end of memory and new PCI window

From: Christian KÃnig
Date: Tue Nov 28 2017 - 04:02:35 EST


Add a workaround for buggy BIOS implementations who steal memory for
iGPUs from the OS without reporting it as reserved.

Signed-off-by: Christian KÃnig <christian.koenig@xxxxxxx>
Tested-by: Aaro Koskinen <aaro.koskinen@xxxxxx>
---
arch/x86/pci/fixup.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c
index e663d6bf1328..e1bdae2cebb6 100644
--- a/arch/x86/pci/fixup.c
+++ b/arch/x86/pci/fixup.c
@@ -713,6 +713,10 @@ static void pci_amd_enable_64bit_bar(struct pci_dev *dev)
}
res->start = conflict->end + 1;
}
+ /* Add 16GB guard between end of memory and new PCI window to work
+ * around buggy BIOS implementations.
+ */
+ res->start += 0x400000000ull;

dev_info(&dev->dev, "adding root bus resource %pR\n", res);

--
2.11.0


--------------292CEB6B2E472794B49E0431--