From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Stabellini Subject: Re: [PATCH v2] tools: libxc: flush data cache after loading images into guest memory Date: Thu, 12 Dec 2013 14:45:18 +0000 Message-ID: References: <1386850863-16373-1-git-send-email-ian.campbell@citrix.com> <1386858199-18882-1-git-send-email-ian.campbell@citrix.com> <1386859056.18946.15.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1386859056.18946.15.camel@kazak.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: Andre Przywara , Stefano Stabellini , julien.grall@linaro.org, tim@xen.org, xen-devel@lists.xen.org, Anup Patel , Pranavkumar Sawargaonkar List-Id: xen-devel@lists.xenproject.org On Thu, 12 Dec 2013, Ian Campbell wrote: > On Thu, 2013-12-12 at 14:30 +0000, Stefano Stabellini wrote: > > On Thu, 12 Dec 2013, Ian Campbell wrote: > > > 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 flush the cache as we load the blobs, otherwise when the > > > guest starts running it may not see them. The dom0 build in the hypervisor has > > > the same requirements and already does the right thing. > > > > > > The mechanism for performing a cache flush from userspace is OS specific, so > > > implement this as a new osdep hook: > > > > > > - On 32-bit ARM Linux provides a system call to flush the cache. > > > - On 64-bit ARM Linux the processor is configured to allow cache flushes > > > directly from userspace. > > > - Non-Linux platforms will need to provide their own implementation. If > > > similar mechanisms are not available then a new privcmd ioctl should be a > > > suitable alternative. > > > > > > No cache maintenance is required on x86, so provide a stub for all non-Linux > > > platforms which returns success on x86 only and log an error otherwise. > > > > > > This fixes guest building on Xgene which has a very large L3 cache and so is > > > particularly susceptible to this problem. It has also been observed > > > sporadically on midway. > > > > > > Signed-off-by: Ian Campbell > > > Cc: Andre Przywara > > > Cc: Pranavkumar Sawargaonkar > > > Cc: Anup Patel > > > > Looks good to me > > Is that an Ack? Yep, but keep in mind that I don't maintain libxc :)