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] Confusion about copy_to/from_guest

To: Tej <bewith.tej@xxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] Confusion about copy_to/from_guest
From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Date: Mon, 26 Apr 2010 06:33:08 +0100
Cc:
Delivery-date: Sun, 25 Apr 2010 22:33:47 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <h2gf1c9d251004251932s19c2f51ofb422ee27c366fca@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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acrk6NY4XyMtUx/aQpusZiM5+xoQAwAGR1+8
Thread-topic: [Xen-devel] Confusion about copy_to/from_guest
User-agent: Microsoft-Entourage/12.24.0.100205
On 26/04/2010 03:32, "Tej" <bewith.tej@xxxxxxxxx> wrote:

> Now passing the list_head from kernel using hypercall. Now how do I
> copy the element between kernel and hypervisor.
> 
> 1. copy_from_guest(hyp_list_head, arg, 1) or
> copy_from_guest(hyp_list_head, arg, <num_of_elements_list>)
> 2. copy_to_guest(arg, hyp_list_head, 1) or copy_to_guest(arg,
> hyp_list_head, <num of element in list>)

The first of these. Copy_{to,from}_guest can copy arrays of structures, but
since this is a linked structure you'd have to do the copy one element at a
time.

> 2nd question:
> I did first one, but first element of list was not accessible in
> hypervisor space, why?

Well, if you are really only copying the list_head, the above should work.

 -- Keir



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

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