WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] GNTTABOP_unmap_grant_ref

To: "King, Steven R" <steven.r.king@xxxxxxxxx>
Subject: Re: [Xen-devel] GNTTABOP_unmap_grant_ref
From: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Date: Wed, 25 Jan 2006 10:06:59 +0000
Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 25 Jan 2006 10:09:38 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <44BDAFB888F59F408FAE3CC35AB4704102D88704@orsmsx409>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <44BDAFB888F59F408FAE3CC35AB4704102D88704@orsmsx409>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx

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

<Prev in Thread] Current Thread [Next in Thread>