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 memory management in Xen

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-devel] Question about memory management in Xen
From: Mark Williamson <mark.williamson@xxxxxxxxxxxx>
Date: Mon, 3 Dec 2007 04:28:42 +0000
Cc: Haifeng He <hehaifeng2nd@xxxxxxxxx>, Akio Takebe <takebe_akio@xxxxxxxxxxxxxx>
Delivery-date: Sun, 02 Dec 2007 20:29:22 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <DBC81B747EBA6Etakebe_akio@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/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: <ab08258e0710300235k24e8edc2of68994846b228d74@xxxxxxxxxxxxxx> <DBC81B747EBA6Etakebe_akio@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: KMail/1.9.6 (enterprise 0.20070907.709405)
> >I was wondering if it is possible to share machine memory pages
> >between Domains. I found there is a function
> >"share_xen_page_with_guest" in arch/x86/mm.c. What's used for? Is it
> >possible to use the function for that purpose?
>
> The function is used for sharing between hypervisor and guest.
> Hypervisor need to map shared memory to guest for console page
> and shared info page before staring guest.
>
> If you can share between domains, you should use grant table.

For examples of grant table usage, see the current block and network 
front/back drivers, amongst other things.  These show you how to share memory 
by using grant tables from kernel space.

Basically, the domU which wishes to share memory adds a sharing grant into its 
grant table and then communicates a "grant reference" (just an integer) 
identifying it to dom0.  This reference can be communicated via Xenstore 
(which is how the block / net drivers set up the communications ring), via 
existing shared memory (the block and net drivers pass further grant refs 
through the communications rind), or via any other method.

Dom0 then maps the granted memory using a hypercall, specifying the domain ID 
and the grant reference it was given, plus a virtual address to map it at.

I've used dom0 and domU as examples partly to simplify things but also because 
until recently only dom0 was allowed to map grant references.  I'm told that 
domUs can also map grant references in the current -unstable tree.

Cheers,
Mark

-- 
Dave: Just a question. What use is a unicyle with no seat?  And no pedals!
Mark: To answer a question with a question: What use is a skateboard?
Dave: Skateboards have wheels.
Mark: My wheel has a wheel!

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

<Prev in Thread] Current Thread [Next in Thread>
  • Re: [Xen-devel] Question about memory management in Xen, Mark Williamson <=