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] Mapping another domain's user memory

To: Michael Abd-El-Malek <mabdelmalek@xxxxxxx>
Subject: Re: [Xen-devel] Mapping another domain's user memory
From: Daniel Stodden <stodden@xxxxxxxxxx>
Date: Thu, 31 Jan 2008 16:09:24 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 31 Jan 2008 07:09:53 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <EB906B8E-C730-4856-B8C1-8BDB4FEB3BB0@xxxxxxx>
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>
Organization: Fakultät für Informatik I10, Technische Universität München
References: <EB906B8E-C730-4856-B8C1-8BDB4FEB3BB0@xxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Thu, 2008-01-31 at 09:57 -0500, Michael Abd-El-Malek wrote:
> Hello,
> 
> Is it possible to map another domain's user-level memory into a  
> different domain's kernel?  (For clarity, let the source domain be the  
> one with the user-space pages that a destination domain wants to write  
> to.)
> 
> I tried to do that by first getting a grant for the user-space memory  
> in the source domain as follows:
> 
>       page_start = user_buf;
>       buffer_mfn = virt_to_mfn(page_start);
>       gnttab_grant_foreign_access_ref(grant_ref, info->dev->otherend_id,  
> buffer_mfn, 0);

this functions wants a guest page frame number, not the mfn, e.g. via
page_to_pfn().

> But the virt_to_mfn call asserted, in include/asm-x86_64/mach-xen/asm/ 
> maddr.h:pfn_to_mfn.
> The assertion that failed was: BUG_ON(end_pfn && pfn >= end_pfn);
> 
> So a few questions:
> 1) is it even possible to map a domain's user-space page into another  
> domain?

yes, any, by dom0, or else via grants.

> 2) for the above code snippet to work, must I install some mappings in  
> the source domain first?

no, afaik it does not have to be mapped, just owned.

> 3) does the blktap driver do something similar? I tried looking at the  
> blktap driver, because it looked like it might help.  But I'm new to  
> the Xen memory management code so it was a bit difficult to follow.

not sure about blktap, but {blk|net}front should give you examples of
how the above code is supposed to be used. grants are typically created
by the frontend, as the backend drivers won't dedicate memory of the
driver domain to that purpose.

regards,
daniel

-- 
Daniel Stodden
LRR     -      Lehrstuhl für Rechnertechnik und Rechnerorganisation
Institut für Informatik der TU München             D-85748 Garching
http://www.lrr.in.tum.de/~stodden         mailto:stodden@xxxxxxxxxx
PGP Fingerprint: F5A4 1575 4C56 E26A 0B33  3D80 457E 82AE B0D8 735B



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

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