From: Ian Campbell Subject: Re: [PATCH XEN RFC] libxc: use an uncached mapping of guest ram in domain builder Date: Fri, 20 Dec 2013 09:19:49 +0000 Message-ID: <1387531189.1025.67.camel@dagon.hellion.org.uk> References: <1387387710.28680.88.camel@kazak.uk.xensource.com> <1387387847-19821-1-git-send-email-ian.campbell@citrix.com> <20131218211449.GA11717@phenom.dumpdata.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20131218211449.GA11717@phenom.dumpdata.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: Konrad Rzeszutek Wilk Cc: tim@xen.org, julien.grall@linaro.org, Ian Jackson , stefano.stabellini@eu.citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Wed, 2013-12-18 at 16:14 -0500, Konrad Rzeszutek Wilk wrote: > On Wed, Dec 18, 2013 at 05:30:47PM +0000, Ian Campbell wrote: > > VERY MUCH A WIP. > > > > On ARM guest OSes are started with MMU and Caches disables (as they are on > > native) however caching is enabled in the domain running the builder and > > therefore we must use an explcitly uncached mapping, otherwise when the guest > > starts running it may not see them. > > > > Cache flushes are not sufficient because there is a race between the flush and > > the unmap, where the processor may speculatively fill a cache line. Thanks to > > Catalin Marinas and Marc Zyngier for pointing this out. > > > > Therefore use the newly introduced IOCTL_PRIVCMD_MMAPBATCH_V2_UNCACHED on ARM > > when mapping guest memory from xc_dom_* (which means xc_dom_boot_domU_map in > > practice). This avoids issues with the processor dirtying cache lines while > > the guest will then fail to see because it starts with MMU and caches > > disabled. > > Why not make the default IOCTL_PRIVCMD_MMAPBATCH_V2 when running under ARM > do this? For the same reason as I explained in your equivalent reply to the Linux patch...