From: Ian Campbell Subject: Re: [PATCH] xen/arm: flush dcache after memcpy'ing the kernel image Date: Thu, 6 Dec 2012 09:20:57 +0000 Message-ID: <1354785657.17165.41.camel@zakaz.uk.xensource.com> References: <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: In-Reply-To: <1354732666-3132-2-git-send-email-stefano.stabellini@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: "xen-devel@lists.xensource.com" , "Tim (Xen.org)" List-Id: xen-devel@lists.xenproject.org On Wed, 2012-12-05 at 18:37 +0000, Stefano Stabellini wrote: > 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 That's a symptom of a thousand different problems though, since it's just a generic Instruction Abort from guest mode caused by a translation fault at stage 2. Anyhow this won't apply in top of "arm: support for initial modules (e.g. dom0) and DTB supplied in RAM", could you rebase on that please? > 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);