From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel Subject: Re: [PATCH] xen/balloon: don't alloc page while non-preemptible Date: Wed, 25 Sep 2013 14:58:01 +0100 Message-ID: <5242EBE9.2030004@citrix.com> References: <1379607293-6149-1-git-send-email-david.vrabel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: Boris Ostrovsky , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 25/09/13 14:26, Stefano Stabellini wrote: > On Thu, 19 Sep 2013, David Vrabel wrote: >> >> - put_balloon_scratch_page(); >> + /* Ensure that ballooned highmem pages don't have kmaps. */ >> + kmap_flush_unused(); >> + flush_tlb_all(); > > The change with possible side effects in this patch is that > kmap_flush_unused and flush_tlb_all are now called after setting the p2m > and after calling balloon_append instead of before. > > However they are still called before the XENMEM_decrease_reservation > hypercall, so I think it's OK. Yes, the requirement is that the kmap cache is flushed before releasing the frame to Xen (in case it contains a kmap for a frame we're about to release). I also wonder if the flush_tlb_all() is even necessary. Surely Xen has all the appropriate TLB flushes in the decrease_reservation hypercall. It can't possibly rely on the guest doing the right thing. David