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

Re: [Xen-devel] GNTTABOP_unmap_grant_ref




On 25 Jan 2006, at 01:33, King, Steven R wrote:

To verify that I wasn't making some new mistake, inspection of
linux/mm/mmap.c shows that Linux calls vma->close() *after* the page
table manipulation.  In do_munmap(), the sequence is:

detach_vmas_to_be_unmapped()
unmap_region()       <--- page table manipulation buried in here
remove_vma_list()    <--- vma->close() buried in here

As others have suggested, you need a special type of vma that knows how to map/unmap/destruct ranges of granted mappings. A good way to do this would be to have gnttab.c export a device file that has an mmap() function. You can then add vma hook functions that know that any mapping created in that vma range must be destructed via gnt_unmap operations.

Is this turning into a Xen problem?  Why does Xen forbid implicit
unmapping of shared pages?

It's hard for Xen to distinguish between mappings created via grants vs. mappings created because domain X is privileged to be able to map any page of domain Y.

So far we've only really had grant-mapping code in the kernel. Doing it in user space just needs some work on the clean-up path. We expect guests to track and clean up their own mess. :-)

 -- Keir


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

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