From: Ian Campbell Subject: Re: [PATCH v2 3/4] xen/arm: clean and invalidate all guest caches by VMID after domain build. Date: Thu, 6 Feb 2014 14:29:00 +0000 Message-ID: <1391696940.25128.38.camel@kazak.uk.xensource.com> References: <1391616214.23098.9.camel@kazak.uk.xensource.com> <1391616235-22703-3-git-send-email-ian.campbell@citrix.com> <52F39B7B.3090208@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <52F39B7B.3090208@linaro.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: Julien Grall Cc: keir@xen.org, stefano.stabellini@eu.citrix.com, ian.jackson@eu.citrix.com, tim@xen.org, xen-devel@lists.xen.org, jbeulich@suse.com List-Id: xen-devel@lists.xenproject.org On Thu, 2014-02-06 at 14:26 +0000, Julien Grall wrote: > Hi Ian, > > On 05/02/14 16:03, Ian Campbell wrote: > > Guests are initially started with caches disabled and so we need to make sure > > they see consistent data in RAM (requiring a cache clean) but also that they > > do not have old stale data suddenly appear in the caches when they enable > > their caches (requiring the invalidate). > > > > This can be split into two halves. First we must flush each page as it is > > allocated to the guest. It is not sufficient to do the flush at scrub time > > since this will miss pages which are ballooned out by the guest (where the > > guest must scrub if it cares about not leaking the pagecontent). We need to > > clean as well as invalidate to make sure that any scrubbing which has occured > > gets committed to real RAM. To achieve this add a new cacheflush_page function, > > which is a stub on x86. > > > > Secondly we need to flush anything which the domain builder touches, which we > > do via a new domctl. > > As I understand, there is no hypercall continuation so if a domain give > a big range Xen will get stuck for a long time (no softirq will be > handled on the current processor ...). Shall we at least use > hypercall_create_continuation? The hypercall deliberately limits the allowable range to avoid this. This was discussed with Jan in a previous iteration, the other places which end up here have a similar property, perhaps as a future cleanup they can all be made preemptable. Ian.