From: George Dunlap Date: Tue, 18 Jun 2013 11:48:36 +0000 (+0100) Subject: hvmloader: Fix check for needing a 64-bit bar X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~6710 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=3458ab670f3043100f2c0ae5634c44226eb3d2ca;p=xen.git hvmloader: Fix check for needing a 64-bit bar After attempting to resize the MMIO hole, the check to determine whether there is a need to relocate BARs into 64-bit space checks the specific thing that caused the loop to exit (MMIO hole == 2GiB) rather than checking whether the required MMIO will fit in the hole. But even then it does it wrong: the polarity of the check is backwards. Check for the actual condition we care about (the sizeof the MMIO hole) rather than checking for the loop exit condition. v3: - Move earlier in the series, before other functional changes Signed-off-by: George Dunlap Reviewed-by: Jan Beulich Acked-by: Stefano Stabellini Acked-by: Ian Jackson CC: Ian Jackson CC: Ian Campbell CC: Stefano Stabellini CC: Hanweidong CC: Keir Fraser --- diff --git a/tools/firmware/hvmloader/pci.c b/tools/firmware/hvmloader/pci.c index a3d03ed40c..6792ed47a4 100644 --- a/tools/firmware/hvmloader/pci.c +++ b/tools/firmware/hvmloader/pci.c @@ -213,7 +213,7 @@ void pci_setup(void) ((pci_mem_start << 1) != 0) ) pci_mem_start <<= 1; - if ( (pci_mem_start << 1) != 0 ) + if ( mmio_total > (pci_mem_end - pci_mem_start) ) { printf("Low MMIO hole not large enough for all devices," " relocating some BARs to 64-bit\n");