From: Sebastian Biedermann Subject: Re: Memory Page Sharing on Xen 4.0.1 Date: Wed, 29 Jun 2011 12:11:42 +0200 Message-ID: <4E0AFA5E.3040109@seceng.informatik.tu-darmstadt.de> References: <4E09C708.1010804@seceng.informatik.tu-darmstadt.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0497530984==" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: veerasena reddy Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --===============0497530984== Content-Type: multipart/alternative; boundary="------------090500040302000506020407" This is a multi-part message in MIME format. --------------090500040302000506020407 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by lnx503.hrz.tu-darmstadt.de id p5TABg2w010799 Awesome, thank you very much! dom0 source compiles without problems! domU source cannot find the xen headers: #include #include #include #include #include #include I compiled in the PV HVM modules using this tutorial: http://blog.alex.org.uk/?s=3Dxen And built them into the guest kernel, it runs fine, but I dont have the=20 right headers. Can you tell me which xenpvdrivers headers you are using and where they=20 come from? Because e.g. I cannot find the asm/maddr.h in the xen sources.. or=20 anywhere else Tank you ! Am 28.06.2011 15:24, schrieb veerasena reddy: > Hi, > > I tried the same links but had to make some changes to get it working. > Please find attached the sample working files for sharing a domU HVM=20 > page to dom0. > It has been tested xen-4.0.1 and HVM guest running ubuntu 10.10 with=20 > kernel version 2.6.35.9 (from kernel.org ) compiled=20 > with CONFIG_XEN disabled and PVHVM drivers compiled in as modules. > > Procedure: > 1. Set LINUX_ROOT appropriately in Makefiles of dom0 and domU. > 2. Set remote domain in dom0 appropriately "info.remoteDomain =3D=20 > " > 3. Compile modules dom0 and domU respectively on dom0 and domU guest. > 4. Load module on domU first. > # insmod ./domu_share.ko > 5. do "dmesg" on domU and note down the grant reference number > [ 1293.316240] gref =3D 770 <<<--- this is the grant reference num= ber > 6. now load the module on dom0 by passing grant reference number as=20 > module param > # insmod ./dom0_share.ko gref=3D770 > 7. do dmesg on dom0 > =3D=3D=3D=3D=3D=3D=3D=3D dmesg on dom0 =3D=3D=3D=3D=3D > xen: dom0: init_module with gref =3D 770 > xen: dom0: shared_page =3D 269f4000, handle =3D 9, status =3D 0 > Bytes in page aseem sethi > XEN: dom: end init_module > =3D=3D=3D=3D=3D=3D > > Thanks & Regards, > VSR. > > On Tue, Jun 28, 2011 at 5:50 PM, Sebastian Biedermann=20 > > wrote: > > Dear List, > > I=B4m trying to figure out *memory page sharing***using HVM on Xen > 4.0.1, > but I=B4m not really able to find some useful information or source= s > about this issue. > > I just found two links porviding these sources: > > http://knol.google.com/k/learning-grant-tables > http://blog.chinaunix.net/space.php?uid=3D20286427&do=3Dblog&id=3D1= 09114 > > > Both are not working.. I think they are made for an older version > of xen. > > Additionally I thought about checking the code of: > > http://kyukhin.dyndns.org/lxr/http/source/drivers/xen/grant-table.c > > ..which is located in the Xen source, but that=B4s very complicated > and I dont know what I need > for a simple page exchange using own programmed standalone tools > between two running domains. > > Can anyone help me by sending some useful links or can anyone give > me a hint where to start? > > Thank you a lot! > > --=20 > Se > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel > > --=20 Sebastian Biedermann Security Engineering Group Technische Universit=E4t Darmstadt biedermann@seceng.informatik.tu-darmstadt.de This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the sender. --------------090500040302000506020407 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Awesome, thank you very much!

dom0 source compiles without problems!
domU source cannot find the xen headers:

#include <xenpvdrivers/evtchn.h>
#include <xenpvdrivers/xenbus.h>
#include <xenpvdrivers/interface/io/netif.h>
#include <xenpvdrivers/interface/memory.h>
#include <xenpvdrivers/balloon.h>
#include <xenpvdrivers/asm/maddr.h>

I compiled in the PV HVM modules using this tutorial:
http://blog.alex.org.uk/?s=xen

And built them into the guest kernel, it runs fine, but I dont have the right headers.

Can you tell me which xenpvdrivers headers you are using and where they come from?
Because e.g. I cannot find the asm/maddr.h in the xen sources.. or anywhere else

Tank you !


Am 28.06.2011 15:24, schrieb veerasena reddy:
Hi,

I tried the same links but had to make some changes to get it working.
Please find attached the sample working files for sharing a domU HVM page to dom0.
It has been tested xen-4.0.1 and HVM guest running ubuntu 10.10 with kernel version 2.6.35.9 (from kernel.org) compiled with CONFIG_XEN disabled and PVHVM drivers compiled in as modules.

Procedure:
1. Set LINUX_ROOT appropriately in Makefiles of dom0 and domU.
2. Set remote domain in dom0 appropriately "info.remoteDomain = <domU_domain_id>"
3. Compile modules dom0 and domU respectively on dom0 and domU guest.
4. Load module on domU first.
    # insmod ./domu_share.ko
5. do "dmesg" on domU and note down the grant reference number
    [ 1293.316240]  gref = 770   <<<--- this is the grant reference number
6. now load the module on dom0 by passing grant reference number as module param
    # insmod ./dom0_share.ko gref=770
7. do dmesg on dom0
======== dmesg on dom0 =====
    xen: dom0: init_module with gref = 770
xen: dom0: shared_page = 269f4000, handle = 9, status = 0
Bytes in page aseem sethi
XEN: dom: end init_module
======

Thanks & Regards,
VSR.

On Tue, Jun 28, 2011 at 5:50 PM, Sebastian Biedermann <biedermann@seceng.informatik.tu-darmstadt.de> wrote:
Dear List,

I´m trying to figure out memory page sharing using HVM on Xen 4.0.1,
but I´m not really able to find some useful information or sources about this issue.

I just found two links porviding these sources:

http://knol.google.com/k/learning-grant-tables
http://blog.chinaunix.net/space.php?uid=20286427&do=blog&id=109114

Both are not working.. I think they are made for an older version of xen.

Additionally I thought about checking the code of:

http://kyukhin.dyndns.org/lxr/http/source/drivers/xen/grant-table.c

..which is located in the Xen source, but that´s very complicated and I dont know what I need
for a simple page exchange using own programmed standalone tools between two running domains.

Can anyone help me by sending some useful links or can anyone give me a hint where to start?

Thank you a lot!
-- 
Se

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




-- 
Sebastian Biedermann
Security Engineering Group
Technische Universität Darmstadt
biedermann@seceng.informatik.tu-darmstadt.de

This email and any files transmitted with it are confidential 
and intended solely for the use of the individual or entity 
to whom they are addressed. If you have received this email 
in error please notify the sender.
--------------090500040302000506020407-- --===============0497530984== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============0497530984==--