From b8080a6d2d889847900e1408f71d0c01c73f5c94 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 28 Mar 2022 14:47:41 +0200 Subject: [PATCH] x86/PCI: Limit "e820 entry fully covers window" check to non ISA MMIO addresses Commit FIXME ("x86/PCI: Preserve host bridge windows completely covered by E820") added a check to skip e820 table entries which fully cover a PCI bride's memory window when clipping PCI bridge memory windows. This check also caused ISA MMIO windows to not get clipped when fully covered, which is causing some coreboot based Chromebooks to not boot. Modify the fully covered check to not apply to ISA MMIO windows. Fixes: FIXME ("x86/PCI: Preserve host bridge windows completely covered by E820") Signed-off-by: Hans de Goede --- arch/x86/kernel/resource.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/resource.c b/arch/x86/kernel/resource.c index 6be82e16e5f4..d9ec913619c3 100644 --- a/arch/x86/kernel/resource.c +++ b/arch/x86/kernel/resource.c @@ -46,8 +46,12 @@ void remove_e820_regions(struct device *dev, struct resource *avail) * devices. But if it covers the *entire* resource, it's * more likely just telling us that this is MMIO space, and * that doesn't need to be removed. + * Note this *entire* resource covering check is only + * intended for 32 bit memory resources for the 16 bit + * isa window we always apply the e820 entries. */ - if (e820_start <= avail->start && avail->end <= e820_end) { + if (avail->start >= ISA_END_ADDRESS && + e820_start <= avail->start && avail->end <= e820_end) { dev_info(dev, "resource %pR fully covered by e820 entry [mem %#010Lx-%#010Lx]\n", avail, e820_start, e820_end); continue; -- 2.35.1