From: Stefano Stabellini Subject: [PATCH] xen/arm: flush dcache after memcpy'ing the kernel image Date: Wed, 5 Dec 2012 18:37:46 +0000 Message-ID: <1354732666-3132-2-git-send-email-stefano.stabellini@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xensource.com Cc: tim@xen.org, Ian.Campbell@citrix.com, Stefano Stabellini List-Id: xen-devel@lists.xenproject.org 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 --- 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