aboutsummaryrefslogtreecommitdiffstats
path: root/tools/firmware
diff options
context:
space:
mode:
authorGeorge Dunlap <george.dunlap@eu.citrix.com>2013-06-19 17:30:13 +0100
committerIan Jackson <Ian.Jackson@eu.citrix.com>2013-06-24 12:20:29 +0100
commit42d075411bc68effe8c75dca27447ba7c72da208 (patch)
tree6330ac44a4aff8da291cfa4f7f49c41156e5e445 /tools/firmware
parent91993aee68cd6b43f72e1ada33b295388fa5c4c1 (diff)
downloadxen-42d075411bc68effe8c75dca27447ba7c72da208.tar.gz
xen-42d075411bc68effe8c75dca27447ba7c72da208.tar.bz2
xen-42d075411bc68effe8c75dca27447ba7c72da208.zip
hvmloader: Set up highmem resouce appropriately if there is no RAM above 4G
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. v4: - Handle case where hfm_info->high_mem_pgend is non-zero but doesn't point into high memory, throwing a warning. Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> CC: Ian Campbell <ian.campbell@citrix.com> CC: Ian Jackson <ian.jackson@citrix.com> CC: Stefano Stabellini <stefano.stabellini@citrix.com> CC: Hanweidong <hanweidong@huawei.com> CC: Keir Fraser <keir@xen.org>
Diffstat (limited to 'tools/firmware')
-rw-r--r--tools/firmware/hvmloader/pci.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/firmware/hvmloader/pci.c b/tools/firmware/hvmloader/pci.c
index 44168e2929..a3d03ed40c 100644
--- a/tools/firmware/hvmloader/pci.c
+++ b/tools/firmware/hvmloader/pci.c
@@ -246,7 +246,18 @@ void pci_setup(void)
hvm_info->high_mem_pgend += nr_pages;
}
- high_mem_resource.base = ((uint64_t)hvm_info->high_mem_pgend) << PAGE_SHIFT;
+ high_mem_resource.base = ((uint64_t)hvm_info->high_mem_pgend) << PAGE_SHIFT;
+ if ( high_mem_resource.base < 1ull << 32 )
+ {
+ if ( hvm_info->high_mem_pgend != 0 )
+ printf("WARNING: hvm_info->high_mem_pgend %x"
+ " does not point into high memory!",
+ hvm_info->high_mem_pgend);
+ high_mem_resource.base = 1ull << 32;
+ }
+ printf("%sRAM in high memory; setting high_mem resource base to "PRIllx"\n",
+ hvm_info->high_mem_pgend?"":"No ",
+ PRIllx_arg(high_mem_resource.base));
high_mem_resource.max = 1ull << cpu_phys_addr();
mem_resource.base = pci_mem_start;
mem_resource.max = pci_mem_end;