From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: [PATCH v3 3/8] hvmloader: Set up highmem resouce appropriately if there is no RAM above 4G Date: Thu, 20 Jun 2013 17:33:22 +0100 Message-ID: <1371746007-19073-4-git-send-email-george.dunlap@eu.citrix.com> References: <1371746007-19073-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: <1371746007-19073-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 hvmloader will read hvm_info->high_mem_pgend to calculate where to start the highmem PCI region. However, if the guest does not have any memory in the high region, this is set to zero, which will cause hvmloader to use the "0" for the base of the highmem region, rather than 1 << 32. Check to see whether hvm_info->high_mem_pgend is set; if so, do the normal calculation; otherwise, use 1<<32. Signed-off-by: Geore Dunlap CC: Ian Campbell CC: Ian Jackson CC: Stefano Stabellini CC: Hanweidong CC: Keir Fraser --- tools/firmware/hvmloader/pci.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/firmware/hvmloader/pci.c b/tools/firmware/hvmloader/pci.c index d8592b0..f0f11e2 100644 --- a/tools/firmware/hvmloader/pci.c +++ b/tools/firmware/hvmloader/pci.c @@ -244,7 +244,14 @@ void pci_setup(void) hvm_info->high_mem_pgend += nr_pages; } - high_mem_resource.base = ((uint64_t)hvm_info->high_mem_pgend) << PAGE_SHIFT; + if ( hvm_info->high_mem_pgend ) + high_mem_resource.base = ((uint64_t)hvm_info->high_mem_pgend) << PAGE_SHIFT; + else + high_mem_resource.base = 1ull << 32; + printf("%sRAM in high memory; setting high_mem resource base to %x%08x\n", + hvm_info->high_mem_pgend?"":"No ", + (uint32_t)(high_mem_resource.base>>32), + (uint32_t)high_mem_resource.base); high_mem_resource.max = 1ull << cpu_phys_addr(); mem_resource.base = pci_mem_start; mem_resource.max = pci_mem_end; -- 1.7.9.5