From patchwork Thu Jan 27 08:33:57 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nadav Har'El X-Patchwork-Id: 510531 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p0R8Y526012781 for ; Thu, 27 Jan 2011 08:34:05 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752151Ab1A0IeB (ORCPT ); Thu, 27 Jan 2011 03:34:01 -0500 Received: from mtagate7.uk.ibm.com ([194.196.100.167]:39399 "EHLO mtagate7.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751609Ab1A0IeB (ORCPT ); Thu, 27 Jan 2011 03:34:01 -0500 Received: from d06nrmr1806.portsmouth.uk.ibm.com (d06nrmr1806.portsmouth.uk.ibm.com [9.149.39.193]) by mtagate7.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p0R8XxqI028149 for ; Thu, 27 Jan 2011 08:33:59 GMT Received: from d06av03.portsmouth.uk.ibm.com (d06av03.portsmouth.uk.ibm.com [9.149.37.213]) by d06nrmr1806.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p0R8Y2a81761286 for ; Thu, 27 Jan 2011 08:34:02 GMT Received: from d06av03.portsmouth.uk.ibm.com (localhost.localdomain [127.0.0.1]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p0R8XxY7006782 for ; Thu, 27 Jan 2011 01:33:59 -0700 Received: from rice.haifa.ibm.com (rice.haifa.ibm.com [9.148.8.217]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p0R8XvSq006746 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 27 Jan 2011 01:33:58 -0700 Received: from rice.haifa.ibm.com (lnx-nyh.haifa.ibm.com [127.0.0.1]) by rice.haifa.ibm.com (8.14.4/8.14.4) with ESMTP id p0R8XvQB002495; Thu, 27 Jan 2011 10:33:57 +0200 Received: (from nyh@localhost) by rice.haifa.ibm.com (8.14.4/8.14.4/Submit) id p0R8Xv9G002487; Thu, 27 Jan 2011 10:33:57 +0200 Date: Thu, 27 Jan 2011 10:33:57 +0200 Message-Id: <201101270833.p0R8Xv9G002487@rice.haifa.ibm.com> X-Authentication-Warning: rice.haifa.ibm.com: nyh set sender to "Nadav Har'El" using -f Cc: gleb@redhat.com, avi@redhat.com To: kvm@vger.kernel.org From: "Nadav Har'El" References: <1296116987-nyh@il.ibm.com> Subject: [PATCH 08/29] nVMX: Fix local_vcpus_link handling Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 27 Jan 2011 08:34:05 +0000 (UTC) --- .before/arch/x86/kvm/vmx.c 2011-01-26 18:06:03.000000000 +0200 +++ .after/arch/x86/kvm/vmx.c 2011-01-26 18:06:03.000000000 +0200 @@ -616,7 +616,9 @@ static void __vcpu_clear(void *arg) vmcs_clear(vmx->vmcs); if (per_cpu(current_vmcs, cpu) == vmx->vmcs) per_cpu(current_vmcs, cpu) = NULL; - list_del(&vmx->local_vcpus_link); + /* TODO: currently, local_vcpus_link is just for L1 VMCSs */ + if (!is_guest_mode(&vmx->vcpu)) + list_del(&vmx->local_vcpus_link); vmx->vcpu.cpu = -1; vmx->launched = 0; } @@ -1022,8 +1024,10 @@ static void vmx_vcpu_load(struct kvm_vcp kvm_make_request(KVM_REQ_TLB_FLUSH, vcpu); local_irq_disable(); - list_add(&vmx->local_vcpus_link, - &per_cpu(vcpus_on_cpu, cpu)); + /* TODO: currently, local_vcpus_link is just for L1 VMCSs */ + if (!is_guest_mode(&vmx->vcpu)) + list_add(&vmx->local_vcpus_link, + &per_cpu(vcpus_on_cpu, cpu)); local_irq_enable(); /* @@ -1647,7 +1651,9 @@ static void vmclear_local_vcpus(void) list_for_each_entry_safe(vmx, n, &per_cpu(vcpus_on_cpu, cpu), local_vcpus_link) - __vcpu_clear(vmx); + /* TODO: currently, local_vcpus_link is just for L1 VMCSs */ + if (!is_guest_mode(&vmx->vcpu)) + __vcpu_clear(vmx); }