From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: [PATCH v4 4/8] hvmloader: Fix check for needing a 64-bit bar Date: Fri, 21 Jun 2013 11:46:30 +0100 Message-ID: <1371811594-31135-5-git-send-email-george.dunlap@eu.citrix.com> References: <1371811594-31135-1-git-send-email-george.dunlap@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1371811594-31135-1-git-send-email-george.dunlap@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: Keir Fraser , Ian Campbell , Hanweidong , George Dunlap , Stefano Stabellini , Ian Jackson List-Id: xen-devel@lists.xenproject.org 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 CC: Ian Jackson CC: Ian Campbell CC: Stefano Stabellini CC: Hanweidong CC: Keir Fraser --- tools/firmware/hvmloader/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/firmware/hvmloader/pci.c b/tools/firmware/hvmloader/pci.c index a3d03ed..6792ed4 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"); -- 1.7.9.5