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] xenheap pages mapped by dom0

To: Keir Fraser <Keir.Fraser@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] xenheap pages mapped by dom0
From: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
Date: Fri, 18 Dec 2009 15:29:15 +0000
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxxxx>
Delivery-date: Fri, 18 Dec 2009 07:29:34 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <C7514F4A.4C35%keir.fraser@xxxxxxxxxxxxx>
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <C7514F4A.4C35%keir.fraser@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.23 (X11/20090817)
Keir Fraser wrote:
I think the right thing to do would be very roughly:
On allocation:
 page = alloc_xenheap_page();
 share_xen_page_with_guest(page);
On deallocation:
 if (test_and_clear(PGC_allocated)) put_page();
 if (page->count_info & PGC_count_mask) return -EBUSY;
 free_xenheap_page(page);
Hmm, the first two should probably happen in the opposite order, no? I.e., we should check to see that for each page we want to deallocate, page->count_info & PGC_count_mask == 0, returning -EBUSY if that fails; then unmark allocate and call free xenheap page?

-George


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