From: Tim Deegan Subject: Re: [PATCH v2] xen/arm: p2m: Correctly flush TLB in create_p2m_entries Date: Thu, 16 Jan 2014 11:10:01 +0100 Message-ID: <20140116101001.GA56618@deinos.phlegethon.org> References: <1389285240-7116-1-git-send-email-julien.grall@linaro.org> <1389713316.12434.91.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1W3jto-0008Th-8u for xen-devel@lists.xenproject.org; Thu, 16 Jan 2014 10:10:08 +0000 Content-Disposition: inline In-Reply-To: <1389713316.12434.91.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: Keir Fraser , patches@linaro.org, Julien Grall , stefano.stabellini@citrix.com, Jan Beulich , xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org At 15:28 +0000 on 14 Jan (1389709716), Ian Campbell wrote: > On Thu, 2014-01-09 at 16:34 +0000, Julien Grall wrote: > > Except grant-table (I can't find {get,put}_page for grant-table code???), > > I think they are in __gnttab_map_grant_ref, within __get_paged_frame or > through page_get_owner_and_reference. > > and on unmap it is in__gnttab_unmap_common_complete. > > It's a bit of a complex maze though so I'm not entirely sure, perhaps > Tim, Keir or Jan can confirm that a grant mapping always takes a > reference on the mapped page (it seems like PV x86 ought to be relying > on this for safety anyhow). Not claiming to understand it completely, but I agree with your analysis. > I think the flush in alloc_heap_pages would also serve as a backstop, > wouldn't it? Not entirely -- if the grant mapping didn't take a ref, then the page could be freed and reassigned with the grant mapping still in place -- the TLB flush doesn't help if the PTE is still there. :) Cheers, Tim.