From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: Confusion about copy_to/from_guest Date: Mon, 26 Apr 2010 06:33:08 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit 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: Tej , "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On 26/04/2010 03:32, "Tej" 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, ) > 2. copy_to_guest(arg, hyp_list_head, 1) or copy_to_guest(arg, > hyp_list_head, ) 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