xen/arm: Panic if we can't copy the DTB to dom0 memory
PATCH 1/1 xen/arm: Panic if we can't copy the DTB to dom0 memory
Signed-off-by Julien Grall <[email protected]>
--- xen/arch/arm/domain_build.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
xen/arch/arm/domain_build.c +4 -1
@@ -824,11 +824,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); }
Signature · 1 line
1.7.10.4
Quoted 1 line · Julien Grall
Signed-off-by Julien Grall <[email protected]>
Acked + Applied.