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] question about mapping memory from Dom0 to domU

To: "吴佳民" <wujiamin_tyut@xxxxxxx>
Subject: Re: [Xen-devel] question about mapping memory from Dom0 to domU
From: "Derek Murray" <Derek.Murray@xxxxxxxxxxxx>
Date: Thu, 10 Jul 2008 07:20:37 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 09 Jul 2008 23:21:00 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:reply-to :sender:to:subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=QpL6mEPNGDYLk843I2O491rlR+n1iN3WnVDP5GC/75w=; b=IdVtGBTisRwQfRSJ6aJ2WCmq2UzGa0nyCa/9wTG7m74ur5xJyjNXGXNLYwpT5kYsRT mvRYIRO4BoiJOkbXDoby2PxE4NkMy6Sa+ooMKru6JYakG9Z9kv0LLZqAV6GS4tDDWvgM jzGQotK9F8KW0K5Lt0Ormtrawgl5dGYz4zBzI=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:reply-to:sender:to:subject:cc:in-reply-to :mime-version:content-type:content-transfer-encoding :content-disposition:references:x-google-sender-auth; b=hEN9keNp9kNVtjjVjw7bYyyzEfbWWqLDgUusV+Wc6uatx+o2Twn+FFYVrOuGXFZbHj puFaVPKqSwbUzZZzjeRWP/3iVCanQsRWkK85rSur6IDBrVOSUgpHROTTwjK2kXvxZZQY weExUcQ2sEEU72O3s0DagAkogLXpBhLAfZuzM=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <13888894.677311215657040416.JavaMail.coremail@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>
References: <13888894.677311215657040416.JavaMail.coremail@xxxxxxxxxxxxxx>
Reply-to: Derek.Murray@xxxxxxxxxxxx
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi,

This won't work: xc_map_foreign_range can only be used in privileged
domains (i.e. Dom0) to map memory from DomUs. This is because allowing
a DomU to map arbitrary memory from another domain would undermine the
security and isolation of the system.

You could use xc_map_foreign_range in Dom0 to map memory from the
DomU. However, it would be better still to use grant references, as
this would observe the principle of least privilege.

Note also that the parameter "port" is actually "prot", which
corresponds to the page-protection on the mapped pages (e.g.
PROT_READ, or PROT_READ | PROT_WRITE).

Regards,

Derek Murray.

2008/7/10 吴佳民 <wujiamin_tyut@xxxxxxx>:
>  Hi:
>     I wanna write code about sharing memory between dom0 and domU, and I
> decide to use void *xc_map_foreign_range(int xc_handle, unint32_t dom, int
> size, int port, unsigned long mfn) (this is a function in xenctl.h).
>    My question is :
>    If I wanna map a range of memory in dom0 to domU, how can I get the value
> of mfn? and I do not know the port here.
>
>    Can anybody help me ?
>    Thanks .
>
>
>                                                                 Danius Wu
> =========================================================
>
>
>
>
> ________________________________
> 渊波阔宅 湖景人生
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel
>
>
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>