From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rusty Russell Subject: Re: [PATCH] KVM: Remove arch specific components from the general code Date: Fri, 27 Jul 2007 09:27:03 +1000 Message-ID: <1185492423.9484.9.camel@localhost.localdomain> References: <20070726042948.5893.58975.stgit@novell1.haskins.net> <1185446238.4895.6.camel@localhost.localdomain> <46A87FDD.7060308@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Avi Kivity Return-path: In-Reply-To: <46A87FDD.7060308-atKUWr5tajBWk0Htik3J/w@public.gmane.org> 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 On Thu, 2007-07-26 at 14:05 +0300, Avi Kivity wrote: > Rusty Russell wrote: > > Great minds think alike. This is a little rough, but I decided to send > > it out tonight because it would make your life easier... > > What about my life? Which patch should I apply first? Such are the responsibilities of command, Avi. (Actually, the normal way is to send us both away to create a combined patch set, and thus make it Not Your Problem). > > === > > Dynamically allocate vcpus > > > > This patch converts the vcpus array in "struct kvm" to a linked list > > of VCPUs, and changes the "vcpu_create" and "vcpu_setup" hooks into > > one "vcpu_create" call which does the allocation and initialization of > > the vcpu (calling back into the kvm_vcpu_init core helper). > > Linked list? So that the in-kernel apic code has to traverse a list, > making sure the cpu still knows how to transfer dirty cache lines for > every vcpu? > > A good old fashioned pointer array will suit just fine. So the in-kernel apic code has to traverse every element in the array? That is clearly better because? We get to place an artificial maximum and keep a ceiling variable like the existing code does? > > + spin_lock(&kvm->lock); > > + /* What do we care if they create duplicate CPU ids? But be nice. */ > > > > Oh, we care. Esp. the apic code. Yeah, I left the check although it's currently unneeded, but I still don't think we should care. We shouldn't use the cpu_id internally, but use pointers. Sure, the guest might get confused, by that's not the kvm module's problem. Thanks, Rusty. ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/