From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel De Graaf Subject: Re: Grant access to more than one dom Date: Thu, 08 May 2014 15:01:01 -0400 Message-ID: <536BD46D.5050106@tycho.nsa.gov> References: <1005757746.20140417115849@gmail.com> <1397747022.24638.306.camel@kazak.uk.xensource.com> <197873202.20140417123854@gmail.com> <1397751294.24638.308.camel@kazak.uk.xensource.com> <582473149.20140417135713@gmail.com> <53500C5E.10904@tycho.nsa.gov> <33361074.20140417150609@gmail.com> <1746801210.20140508114712@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1746801210.20140508114712@gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Simon Martin Cc: Ian Campbell , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 05/08/2014 11:47 AM, Simon Martin wrote: > Hi Daniel. > >> I'll carry on then. When I have it working and tested I'll send it to >> you so you can have a look. Once everyone is happy I'll see about >> pushing it to a kernel maintainer. > > After being sidetracked into other more boring projects I have now > almost completed this change, however I have some questions. I'm > pretty certain that I must be missing something here. > > For the moment I am only looking at gntalloc.c as it is the one I > need. > > In the add_grefs function you create a couple of list structures > (queue_gref and queue_file) and then splice these onto the end of the > gref_list and gntalloc_file_private_data.list lists. However I'm not > really sure what you are doing here. Can you explain please. The > problems I see are: > > 1.- queue_gref and queue_file are declared on the stack, however they > are then appended to the lists with no memory allocation whatsoever. > What are you expecting to happen here? > > 2.- queue_gref and queue_file are just list structs, i.e. they have > no payload, they are not part of an encapsulating struct, so again, > what are you expecting to happen here? > > Regards. The add_grefs function strings the allocated gntalloc_gref structures onto two linked lists: the list heads are local, but are only used temporarily. If the operation is successful, the list_splice_tail calls wire up the linked lists to permanent structures on the heap; if unsuccessful, they are used to clean up. -- Daniel De Graaf National Security Agency