From: Ian Campbell Subject: Re: [PATCH v3] xen/arm: flush D-cache and I-cache when appropriate Date: Mon, 19 Nov 2012 13:56:21 +0000 Message-ID: <1353333381.18229.90.camel@zakaz.uk.xensource.com> References: <1353080578-1487-1-git-send-email-stefano.stabellini@eu.citrix.com> <1353329757.18229.81.camel@zakaz.uk.xensource.com> <20121119130826.GB31411@ocelot.phlegethon.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20121119130826.GB31411@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: Tim Deegan Cc: "xen-devel@lists.xensource.com" , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Mon, 2012-11-19 at 13:08 +0000, Tim Deegan wrote: > Sorry for the late review - I meant to get to these on Thursday but > hadn't time. > > At 12:55 +0000 on 19 Nov (1353329757), Ian Campbell wrote: > > > +/* Macro for flushing a single small item. The predicate is always > > > + * compile-time constant so this will compile down to 3 instructions in > > > + * the common case. > > This is no longer true! The predicate now depends on the alignment of > the pointer, so this will compile to quite a bit of code, including the > memory barrier I was trying to avoid. If p is static then isn't p + sizeof(*p) etc static and therefore the compiler can figure it out? Stefano, what does it actually compile down to in practice? > If we can sensibly restrict this to naturally-aligned objects smaller > than a cacheline, we should go back to the previous version of this > macro. If not, I think we might as well just use > flush_xen_dcache_va_range(_p, sizeof *_p) and be done with it. I've already committed it, so please send a followup patch of whichever sort is needed. Ian.