[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] Question about memory management in Xen
> >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
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |