From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] move structures to svm/vmx.c, use untyped arch_data in independent code Date: Thu, 19 Jul 2007 11:30:44 +0300 Message-ID: <469F2134.2030505@qumranet.com> References: <469EAC5A.2070900@codemonkey.ws> <469EBB26.5080106@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, avi-atKUWr5tajDk1uMJSBkQmQ@public.gmane.org To: Paul Turner Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Paul Turner wrote: > On 7/18/07, Anthony Liguori wrote: > >> Paul Turner wrote: >> >>> I mentioned that as a possible solution in the other thread. The >>> memorystructure gets a little uglier in that case since you have to >>> hang the relevant vcpu off kvm_struct, in addition to throwing the >>> container_of macro pretty much everywhere since the arch indep code >>> can only obviously only pass kvm_vcpus, I don't really like the macro >>> approach either I just don't see anything nicer right now.. >>> >> Well, let me show you what I mean: >> > > I considered this approach as well and am happy to refactor it in this > form if that's what Avi wants; I still think it's nicer not to invert > these structures but am relatively ambivalent :) > > As this is the standard way of doing things, and as the zero-length-array idea failed miserably, this is probably the best solution. >>>>> struct vmcs *vmcs; >>>>> >> + struct kvm_vcpu vcpu; >> >> > > In this approach you might as well embed that at the start so that the > arch independent code can still allocate/free, that or move the memory > alloc/dealloc entirely to the arch specific code. Although that > should probably be done anyway with this approach otherwise it's not > clear exactly what is occurring from the arch independent code path's > pov. > Yes, the arch independent stuff should be at the start. [...] People, trim your quotes! -- error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/