From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tim Deegan Subject: Re: [PATCH 6/7] xen/arm: flush D-cache and I-cache when appropriate Date: Sat, 27 Oct 2012 12:54:23 +0100 Message-ID: <20121027115423.GA90857@ocelot.phlegethon.org> References: <1351091027-20740-6-git-send-email-stefano.stabellini@eu.citrix.com> <20121024155945.GD39126@ocelot.phlegethon.org> <20121026090141.GB76080@ocelot.phlegethon.org> <20121026165549.GF76080@ocelot.phlegethon.org> <20121027104428.GB89901@ocelot.phlegethon.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20121027104428.GB89901@ocelot.phlegethon.org> 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" , Ian Campbell List-Id: xen-devel@lists.xenproject.org At 11:44 +0100 on 27 Oct (1351338268), Tim Deegan wrote: > /* Function for flushing medium-sized areas. > * if 'range' is large enough we might want to use model-specific > * full-cache flushes. */ > static inline void flush_xen_dcache_va_range(void *p, unsigned long size) > { > void *end; > unsigned long cacheline_bytes = READ_CP32(CCSIDR); > barrier(); /* So the compiler issues all writes to the range */ > dsb(); /* So the CPU issues all writes to the range */ Oh - I just noticed that the way we've defined dsb() it includes a memory clobber. So I guess we don't need barrier() as well there. We might want to look at the other users of dsb() and see if we want to drop the memory clobber from it as well. But OTOH we may be getting way into premature optimization already. :) Tim.