[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v2] tools: libxc: flush data cache after loading images into guest memory
On Thu, 2013-12-12 at 14:23 +0000, Ian Campbell wrote: > +#elif defined(__aarch64__) > + unsigned long start = (unsigned long)ptr; > + unsigned long end = start + nr; > + unsigned long p, ctr; > + int stride; > + > + /* Flush cache using direct DC CVAC instructions. This is > + * available to EL0 when SCTLR_EL1.UCI is set, which Linux does. > + * > + * Bits 19:16 of CTR_EL0 are log2 of the minimum dcache line size > + * in words, which we use as our stride length. This is readable > + * with SCTLR_EL1.UCT is set, which Linux does. > + */ > + asm volatile ("mrs %0, ctr_el0" : "=r" (ctr)); > + > + stride = 4 * (1 << ((ctr & 0xf0000UL) >> 16)); > + > + for ( p = start ; p < end ; p += stride ) > + asm volatile ("dc cvac, %0" : : "r" (p)); I wonder if I need a dsb here. I suspect I do. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |