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/
Home Products Support Community News


[Xen-devel] Re: RFC: Using grant table to give iomem permission

To: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Subject: [Xen-devel] Re: RFC: Using grant table to give iomem permission
From: Kieran Mansley <kmansley@xxxxxxxxxxxxxx>
Date: Fri, 18 May 2007 15:14:28 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Fri, 18 May 2007 07:12:52 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <C2737153.F2A6%Keir.Fraser@xxxxxxxxxxxx>
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: <C2737153.F2A6%Keir.Fraser@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Fri, 2007-05-18 at 15:05 +0100, Keir Fraser wrote:
> On 18/5/07 15:01, "Kieran Mansley" <kmansley@xxxxxxxxxxxxxx> wrote:
> > When finished, the mapping domain can similarly unmap the grant, which
> > removes its ability to ioremap() the page:
> > struct gnttab_unmap_grant_ref op;
> > gnttab_set_unmap_op(&op, 0, GNTMAP_iomem_map, handle);
> > if (HYPERVISOR_grant_table_op(GNTTABOP_unmap_grant_ref, &op, 1))
> > BUG();
> > 
> > Some questions from me:
> >  - does this approach seem sane?
> There's no reason you shouldn't be able to use GNTMAP_host_map as usual, and
> do refcounting in the active grant entry, also as usual.

OK.  My reluctance to do that was simply that I wasn't sure if the
operations that take place when doing a GNTMAP_host_map would conflict
with those when doing an iomem_map.  If you think they shouldn't, I'll
give it a go.

That raises one of my other questions which is how to test for it being
a valid RAM page, as in the absence of it GNTMAP_iomem_map that's pretty
much the only indicator that it's iomem we're dealing with.  As I said,
mfn_valid() doesn't seem to be sufficient.


Xen-devel mailing list