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] xc_map_foreign_range usage

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] xc_map_foreign_range usage
From: "Alex V" <allex.vong@xxxxxxxxx>
Date: Sun, 24 Feb 2008 05:22:48 -0500
Delivery-date: Sun, 24 Feb 2008 02:23:19 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=qGGtYos+IEWjqaw5FP4QI/7N6NNe9JKXk0udtTQDAG8=; b=ncs3ikgN+/CnOQhlXF1F2k4Ki3IkZ9Qhg/4i/TlxO9DBASdWf2GGHjKXU2qveDwTAGScnoH8m8wWA+hfrK5HMQMaHmYcwh5MKP6fNGu0FyOBtErn77GRIeM0uPk2KwcJnpNJqEuKQDJvEJkRnj3ZcsVvxEIUf2RRXf4hkr0THW4=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=empb8gwqAY4kIdojHuabeSBjzokmDOWLVLTt8V/1tuBOhKnmC5N69K0M+z9gnrNP6u51ne2ZGjFw0Qx1akAeVEsrvzi9ZAlO1f3piGd7G9Y1Vfn3bKcBzekGsCmt7BfdOi8BSjVfuJA5rC7LtE4lYGzXvo3FiroO2omvEuGn0kE=
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
Hi,

I am learning source of Xen and decided to learn it by writing some code.

So I am trying to map some data from domU to dom0 using  xc_map_foreign_range.
It seemed pretty straightforward but in xenctrl.h it's stated that:
--------------------------------------------
In Linux, the ring queue for the control channel is accessible by
mapping the shared_info_frame (from xc_domain_getinfo()) + 2048.  The
structure stored there is of type control_if_t.
---------------------------------------------

which confuses me since I could not find info about this structure and
therefore cast ret value to it.

All I need is basically just to have an access from dom0 to the buffer
I allocated at domU. Could you tell me where I am able to see simple
example which deals with that?

Assume I already malloc'ed some buffer at domU and granted access to
it (have a reference number - ref)

Then in dom0 I map it using all info

void* my_addr = xc_map_foreign_range(handle, dom_id, rw, ref);

How can I change/read the buffer I granted access to dom0 previously?
I casted it to unsigned long and got an address (I suppose) but
casting it to (char*) and trying to print it out caused an segfault.

Any comments/advices would be highly appreciated.

Best regards,
Al.V.

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

<Prev in Thread] Current Thread [Next in Thread>