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

[Xen-devel] Share Memory Between DomainU and Domain0

To: <Xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] Share Memory Between DomainU and Domain0
From: "JungHyun.Kim" <jhkim@xxxxxxxxxxxxxxxxxx>
Date: Fri, 8 Dec 2006 00:55:03 +0900
Delivery-date: Thu, 07 Dec 2006 07:57:24 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AccaGA6EnPI2mkLeQFaWLv0aVfDITw==

Hi.

 

I want to share some pages between Dom0 and DomU.

But I have some problems with it.

 

The sharing scenario is like that.

 

1.     Dom0 grants access permission of pages to DomU  using “gnttab_grant_foreign_access_ref()”

2.     Dom0 passes “Machine Page Numbers” and “Ref” to DomU through I/O Ring

3.     DomU install granted pages. (Change original mfn to new mfn of Dom0)

A.     map.host_addr = mfn_to_virt(pfn_to_mfn(DomU’s PFN));

B.      HYPERVISOR_grant_table_op(GNTTABOP_map_grant_ref,&map,count)

C.      Set_phys_to_machine(DomU’s PFN, Dom0’s MFN)

 

 

They are being done in “blkback.c” and “blkfront.c”.

 

The source code is

 

In blkback.c

           dom0_cache_vaddr = get_zeroed_page(GFP_KERNEL);

           dom0_cache_mfn[i] = pfn_to_mfn(__pa(dom0_cache_vaddr) >> PAGE_SHIFT);

share_ref = gnttab_claim_grant_reference(&share_ref_head);

           BUG_ON(share_ref == -ENOSPC);

           share_ref = gnttab_grant_foreign_access( req_domid, dom0_cache_mfn[i], 1);

 

In blkfront.c

           bret = RING_GET_RESPONSE(&info->ring, i);

           map.host_addr = mfn_to_virt(pfn_to_mfn(bret->map_pfn_mfn[j].pfn));

for(j < 0 ; j < number_of_pages ;j++){

                      map.dom = (domid_t) 0;

                      map.ref = bret->map_pfn_mfn[j].ref;

                      map.flags = ( GNTMAP_host_map | GNTMAP_readonly);

                                         

                      ret = HYPERVISOR_grant_table_op(GNTTABOP_map_grant_ref,&map,1);

                      BUG_ON(ret);

set_phys_to_machine(

                                bret->map_pfn_mfn[j].pfn,

                                FOREIGN_FRAME((bret->map_pfn_mfn[j].mfn)));

           }

 

For the sharing, I modified response struct. So it has grant ref, Dom0’s MFN and DomU’s PFN now.

 

But I encountered Kernel Panic as DomU booted up.

 

Message :

Unable to handle kernel paging request at virtual address c0cff000

 printing eip:

c0148bc1

*pde = ma 1d639067 pa 0116a067

*pte = ma 0db4f061 pa 10b4f061

 

Question :

1.     Should I update Page table with “HYPERVISOR_mmu_update” in DomU although I call “HYPERVISOR_grant_table_op”??

2.     Anyone can advice to me about this problem? (Anything about the kernel panic message or mistakes in source code)

 

Thank you very much. :-)

 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>