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] Cannot get shared page in domU

To: Xin Jin <jxinpku@xxxxxxxxx>
Subject: Re: [Xen-devel] Cannot get shared page in domU
From: Daniel Castro <evil.dani@xxxxxxxxx>
Date: Thu, 10 Nov 2011 14:09:13 +0900
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 09 Nov 2011 21:10:13 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=xUNK1EN8r9n7rTALMN3PHUtp7cxumJdM+0gWwQVQzAI=; b=KtFPQqTl3bh8YFN83sK4FxxnD8lcJgNpFWMMwXDUJIotIsNQi/Fjl7WjzusH0ETeOx kjNKrtZOza9E0uH9EYmBIeUS+SuvYH5kBIXpXRFCcG6ITojjAW+JILylUEmCXXiEBNqb uwgxScsXyyt4Sy7p33FmaGRhcClkcyxaneLF0=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <CAKpDeakqB2eRMbGLZwuY9Dyka+BFJSwNO+1g=9WmyJ6uF+b61A@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: <CAKpDeakqB2eRMbGLZwuY9Dyka+BFJSwNO+1g=9WmyJ6uF+b61A@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Thu, Nov 10, 2011 at 1:15 PM, Xin Jin <jxinpku@xxxxxxxxx> wrote:
> Hi, I cannot get a shared page in domU.
> In a domU, I used the folloing code to grant a page to another domU.
> share_mem = (share_mem_desp *) __get_free_page(GFP_KERNEL);
> share_mem->gref = gnttab_grant_foreign_access(domid_remote,
> virt_to_mfn(share_mem), 0);
> In another domU, I used the folloing code to get the shared page.
> share_vmarea = alloc_vm_area(PAGE_SIZE);
> gnttab_set_map_op( &map_op, (unsigned long)share_vmarea->addr,
> GNTMAP_host_map, gref, domid_remote );
> HYPERVISOR_grant_table_op( GNTTABOP_map_grant_ref, &map_op, 1 );
> While using the exactly same code to get the shared page in dom0, it woks
> all well. But it cannot work in domU.
> I use Xen 4.1.1 and fedora 14 ( linux 3.1.0 both for dom0 and domU ).
> Can anyone help me?
On the interface struct when you issue the hypercall you need to
specify the domid that can use the gref. Maybe the default is domid 0.
The struct grant_entry_v1 has member domid for the foreign guest,
check that value.

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



-- 
+-=====---------------------------+
| +---------------------------------+ | This space intentionally blank
for notetaking.
| |   | Daniel Castro,                |
| |   | Consultant/Programmer.|
| |   | U Andes                         |
+-------------------------------------+

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