From: Tim Deegan Subject: Re: [PATCH V3 4/4] arm: allocate per-PCPU domheap pagetable pages Date: Wed, 24 Apr 2013 14:11:06 +0100 Message-ID: <20130424131106.GB20903@ocelot.phlegethon.org> References: <1366800818.20256.269.camel@zakaz.uk.xensource.com> <1366800841-28468-4-git-send-email-ian.campbell@citrix.com> <20130424124947.GA20903@ocelot.phlegethon.org> <1366808642.20256.347.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1366808642.20256.347.camel@zakaz.uk.xensource.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: Ian Campbell Cc: Julien Grall , Stefano Stabellini , Sengul Thomas , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org At 14:04 +0100 on 24 Apr (1366812242), Ian Campbell wrote: > On Wed, 2013-04-24 at 13:49 +0100, Tim Deegan wrote: > > At 11:54 +0100 on 24 Apr (1366804441), Ian Campbell wrote: > > > + /* Some of these slots may have been used during start of day and/or > > > + * relocation. Make sure they are clear now. */ > > > + memset(this_cpu(xen_dommap), 0, DOMHEAP_SECOND_PAGES*PAGE_SIZE); > > > + flush_xen_dcache_va_range(this_cpu(xen_dommap), > > > + DOMHEAP_SECOND_PAGES*PAGE_SIZE); > > > +} > > > > This is a dcache flush -- do we need flush_xen_data_tlb_range_va() > > instead (or possibly as well)? > > The reason for this zeroing is really for the benefit of the code in > map_domain_page which is looking at the present bits to find a free > slot. I had a crash due to it stumbling over the uninitialised memory in > the freshly allocated secondary CPUs dommap and figured I should zero > the boot CPUs one as well. Ah, right - this is flushing the dommap PTEs. For some reason I read it as a flush of the domheap VAs. > It probably doesn't actually matter that much if the MMU sees stale > entries here (in the case of the boot CPU they will be valid entries, > not invalid gunk like on the secondaries). At the point that > map_domain_page actually puts something useful in here it will do all > the right flushes (I hope!). Yep. > In other words I have a feeling even the flush which is there is not > strictly necessary. However it is consistent with write_pte, which is > effectively what the memset is doing. Understood. And with that, Acked-by: TIm Deegan Cheers, Tim.