From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Nadav Har'El" Subject: Re: [PATCH 08/31] nVMX: Fix local_vcpus_link handling Date: Tue, 17 May 2011 17:35:32 +0300 Message-ID: <20110517143532.GA2490@fermat.math.technion.ac.il> References: <1305575004-nyh@il.ibm.com> <201105161948.p4GJm1as001742@rice.haifa.ibm.com> <20110517131918.GA3809@amt.cnet> <4DD27998.1040105@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Marcelo Tosatti , kvm@vger.kernel.org, gleb@redhat.comqg To: Avi Kivity Return-path: Received: from mailgw12.technion.ac.il ([132.68.225.12]:24895 "EHLO mailgw12.technion.ac.il" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754849Ab1EQOfi (ORCPT ); Tue, 17 May 2011 10:35:38 -0400 Content-Disposition: inline In-Reply-To: <4DD27998.1040105@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, May 17, 2011, Avi Kivity wrote about "Re: [PATCH 08/31] nVMX: Fix local_vcpus_link handling": > >(local_vcpus_link must be >manipulated with interrupts disabled, BTW). Thanks, I'll look into that. > >What about having a per-CPU VMCS list instead of per-CPU vcpu list? > Perhaps even easier (avoids duplication): > > struct raw_vmcs { > u32 revision_id; > u32 abort; > char data[0]; > }; > > struct vmcs { > struct raw_vmcs *raw_vmcs; > struct list_head local_vmcs_link; > }; > > struct vcpu_vmx { > ... > struct vmcs *vmcs; /* often points at l1_vmcs */ > struct vmcs l1_vmcs; > ... > }; > > static DEFINE_PER_CPU(struct list_head, vmcss_on_cpu); This is an interesting suggestion. My initial plan was to do something similar to this, and I agree it could have been nicer code, but I had to change it after bumping into too many obstacles. For example, currently, vmclear_local_vcpus() not only VMCLEARs the vmcss, it also sets vmx->vcpu.cpu = -1, xmv->launched=0 for the vcpus holding these VMCSs. If we had only a list of VMCSs, how can we mark the vcpus as being not currently loaded (cpu=-1)? -- Nadav Har'El | Tuesday, May 17 2011, 13 Iyyar 5771 nyh@math.technion.ac.il |----------------------------------------- Phone +972-523-790466, ICQ 13349191 |I'm a peripheral visionary: I see into http://nadav.harel.org.il |the future, but mostly off to the sides.