From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 08/29] nVMX: Fix local_vcpus_link handling Date: Sun, 30 Jan 2011 12:08:20 +0200 Message-ID: <4D453894.4040706@redhat.com> References: <1296116987-nyh@il.ibm.com> <201101270833.p0R8Xv9G002487@rice.haifa.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, gleb@redhat.com To: "Nadav Har'El" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:58972 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751286Ab1A3KIZ (ORCPT ); Sun, 30 Jan 2011 05:08:25 -0500 In-Reply-To: <201101270833.p0R8Xv9G002487@rice.haifa.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: On 01/27/2011 10:33 AM, Nadav Har'El wrote: > In VMX, before we bring down a CPU we must VMCLEAR all VMCSs loaded on it > because (at least in theory) the processor might not have written all of its > content back to memory. Since a patch from June 26, 2008, this is done using > a per-cpu "vcpus_on_cpu" linked list of vcpus loaded on each CPU. > > The problem is that with nested VMX, we no longer have the concept of a > vcpu being loaded on a cpu: A vcpu has multiple VMCSs (one for L1, others for > each L2), and each of those may be have been last loaded on a different cpu. > > This trivial patch changes the code to keep on vcpus_on_cpu only L1 VMCSs. > This fixes crashes on L1 shutdown caused by incorrectly maintaing the linked > lists. > > It is not a complete solution, though. It doesn't flush the inactive L1 or L2 > VMCSs loaded on a CPU which is being shutdown. Doing this correctly will > probably require replacing the vcpu linked list by a link list of "saved_vcms" > objects (VMCS, cpu and launched), and it is left as a TODO. > It looks like the right thing is a structure that represents the common things between 02 and 02 vmcses: - pointer to memory - cpu - linked list entries for vcpus_on_vcpu (to be renamed vmcses_on_cpu) You could then use vcpu_clear() in the previous patch. -- error compiling committee.c: too many arguments to function