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] Grant a partial page

To: Daniel Castro <evil.dani@xxxxxxxxx>
Subject: Re: [Xen-devel] Grant a partial page
From: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Date: Thu, 10 Nov 2011 08:02:57 +0000
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Thu, 10 Nov 2011 00:09:07 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <CAP2B85-NrwhELRMpndhq3vzxqEuZRjsZi3C6bJ6ze3q=Dfu=aA@xxxxxxxxxxxxxx>
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>
Organization: Citrix Systems, Inc.
References: <CAP2B85-NrwhELRMpndhq3vzxqEuZRjsZi3C6bJ6ze3q=Dfu=aA@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Thu, 2011-11-10 at 05:46 +0000, Daniel Castro wrote:
> Hello,
> I to issue a grant on a page, but only partially.
> I have a pointer to somewhere in memory and need to issue the grant
> for such a pointer but not to the entire page.
> I know FLAG GTF_sub_page is used for that purpose but grant_entry_v1
> apparently has no fields for sub_page, should I change the code to use
> Version 2 grant table entries?

sub page grants are a feature of v2 grant tables only, they also require
you to make copy only grants (since you cannot enforce the subpage
aspect for a mapped grant).

Using v2 grant tables here has a few issues.

Firstly it is hard (if not impossible) to go back to v1 after switching
to v2 which presents a problem for the eventual guest OS (this could
probably be solved by suitable hypervisor modifications).

Secondly the otherend needs to be using copy grants and not mapping
grants. This generally would require some sort of protocol negotiation
via xenstore (i.e. netback would generally use mapping by default for
guest-TX pages).

I think you are better off either copying your subpage data into an
isolated page of its own (or maybe you can arrange for this to be true
of the original data) or deciding that you are happy to expose the rest
of the original page to the backend domain. Whether this second option
is safe or not depends on what is there, a read-only grant might provide
some more assurances here, depending on what the data actually is etc.

Ian.


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

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