[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2] xen/arm: p2m: Correctly flush TLB in create_p2m_entries



On Thu, 2014-01-16 at 11:10 +0100, Tim Deegan wrote:
> 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.

Thanks.

> > 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. :)

True, but I think we agree that grant mappings do (and must) take refs,
Phew!

Likewise on ARM we reference count foreign mappings so this is ok wrt
this sort of thing too.

I actually forgot I'd asked this question and was waiting for feedback
-- so the patch is already in, good thing it is all fine!

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.