diff options
author | Julien Grall <julien.grall@linaro.org> | 2013-09-27 17:56:36 +0100 |
---|---|---|
committer | Ian Campbell <ian.campbell@citrix.com> | 2013-10-08 15:46:39 +0100 |
commit | e501dc9aa9100c5a6ffa21234f37d2f66403cc30 (patch) | |
tree | 8a2ba1d08566586625fcf38bee842a5db06963f2 /xen/arch/arm/kernel.c | |
parent | 14c616eca8630f11b24969e06cacfc945ebf3b12 (diff) | |
download | xen-e501dc9aa9100c5a6ffa21234f37d2f66403cc30.tar.gz xen-e501dc9aa9100c5a6ffa21234f37d2f66403cc30.tar.bz2 xen-e501dc9aa9100c5a6ffa21234f37d2f66403cc30.zip |
xen/arm: Add support to load initrd in dom0
Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'xen/arch/arm/kernel.c')
-rw-r--r-- | xen/arch/arm/kernel.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c index 6d2c164799..315d12c917 100644 --- a/xen/arch/arm/kernel.c +++ b/xen/arch/arm/kernel.c @@ -72,15 +72,22 @@ static void kernel_zimage_check_overlap(struct kernel_info *info) { paddr_t zimage_start = info->zimage.load_addr; paddr_t zimage_end = info->zimage.load_addr + info->zimage.len; - paddr_t dtb_start = info->dtb_paddr; - paddr_t dtb_end = info->dtb_paddr + fdt_totalsize(info->fdt); + paddr_t start = info->dtb_paddr; + paddr_t end; - if ( (dtb_start > zimage_end) || (dtb_end < zimage_start) ) + end = info->initrd_paddr + early_info.modules.module[MOD_INITRD].size; + + /* + * In the dom0 memory, the initrd will be just after the DTB. So we + * only need to check if the zImage range will overlap the + * DTB-initrd range. + */ + if ( (start > zimage_end) || (end < zimage_start) ) return; panic(XENLOG_ERR "The kernel(0x%"PRIpaddr"-0x%"PRIpaddr - ") is overlapping the DTB(0x%"PRIpaddr"-0x%"PRIpaddr")\n", - zimage_start, zimage_end, dtb_start, dtb_end); + ") is overlapping the DTB-initrd(0x%"PRIpaddr"-0x%"PRIpaddr")\n", + zimage_start, zimage_end, start, end); } static void kernel_zimage_load(struct kernel_info *info) @@ -335,9 +342,6 @@ int kernel_prepare(struct kernel_info *info) paddr_t start, size; - if ( early_info.modules.nr_mods > MOD_INITRD ) - panic("Cannot handle dom0 initrd yet\n"); - if ( early_info.modules.nr_mods < MOD_KERNEL ) { printk("No boot modules found, trying flash\n"); |