diff options
author | Julien Grall <julien.grall@linaro.org> | 2013-09-04 16:11:57 +0100 |
---|---|---|
committer | Ian Campbell <ian.campbell@citrix.com> | 2013-09-09 14:45:50 +0100 |
commit | ffcbfb66eeb38d0f0180d5ac99a3a8b2c8dd9af7 (patch) | |
tree | 357884e964b1b42920e0d07ecc05bd7b83fcc1a8 /xen | |
parent | 8529ac933e82a900f86a71b58a338461d6027298 (diff) | |
download | xen-ffcbfb66eeb38d0f0180d5ac99a3a8b2c8dd9af7.tar.gz xen-ffcbfb66eeb38d0f0180d5ac99a3a8b2c8dd9af7.tar.bz2 xen-ffcbfb66eeb38d0f0180d5ac99a3a8b2c8dd9af7.zip |
xen/arm: Panic if we can't copy the DTB to dom0 memory
Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'xen')
-rw-r--r-- | xen/arch/arm/domain_build.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 9ca663a146..77e2a61e0c 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -535,11 +535,14 @@ static int prepare_dtb(struct domain *d, struct kernel_info *kinfo) static void dtb_load(struct kernel_info *kinfo) { void * __user dtb_virt = (void * __user)(register_t)kinfo->dtb_paddr; + unsigned long rc; printk("Loading dom0 DTB to 0x%"PRIpaddr"-0x%"PRIpaddr"\n", kinfo->dtb_paddr, kinfo->dtb_paddr + fdt_totalsize(kinfo->fdt)); - raw_copy_to_guest(dtb_virt, kinfo->fdt, fdt_totalsize(kinfo->fdt)); + rc = raw_copy_to_guest(dtb_virt, kinfo->fdt, fdt_totalsize(kinfo->fdt)); + if ( rc != 0 ) + panic("Unable to copy the DTB to dom0 memory (rc = %lu)\n", rc); xfree(kinfo->fdt); } |