Skip to contentSkip to conversation

xen/arm: Panic if we can't copy the DTB to dom0 memory

PATCH In review Julien Grall 2 participants 2 messages Sep 4, 2013 – Sep 9, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/arm: Panic if we can't copy the DTB to dom0 memory

---
 xen/arch/arm/domain_build.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
xen/arch/arm/domain_build.c +4 -1
index 516d0df..0909996 100644
@@ -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