[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] xen/arm: flush dcache after memcpy'ing the kernel image



After memcpy'ing the kernel in guest memory we need to flush the dcache
to make sure that the data actually reaches the memory before we start
executing guest code with caches disabled.

This fixes a boot time bug on the Cortex A15 Versatile Express that
usually shows up as follow:

(XEN) Hypervisor Trap. HSR=0x80000006 EC=0x20 IL=0 Syndrome=6
(XEN) Unexpected Trap: Hypervisor

Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
---
 xen/arch/arm/kernel.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c
index b4a823d..81818b1 100644
--- a/xen/arch/arm/kernel.c
+++ b/xen/arch/arm/kernel.c
@@ -53,6 +53,7 @@ void copy_from_paddr(void *dst, paddr_t paddr, unsigned long 
len, int attrindx)
 
         set_fixmap(FIXMAP_MISC, p, attrindx);
         memcpy(dst, src + s, l);
+        flush_xen_dcache_va_range(dst, l);
 
         paddr += l;
         dst += l;
@@ -82,6 +83,7 @@ static void kernel_zimage_load(struct kernel_info *info)
 
         set_fixmap(FIXMAP_MISC, (flash+offs) >> PAGE_SHIFT, DEV_SHARED);
         memcpy(dst, src, PAGE_SIZE);
+        flush_xen_dcache_va_range(dst, PAGE_SIZE);
         clear_fixmap(FIXMAP_MISC);
 
         unmap_domain_page(dst);
-- 
1.7.2.5


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.