From patchwork Mon Jun 8 07:58:58 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 28578 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n587xAUO032089 for ; Mon, 8 Jun 2009 07:59:10 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753228AbZFHH7E (ORCPT ); Mon, 8 Jun 2009 03:59:04 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752621AbZFHH7E (ORCPT ); Mon, 8 Jun 2009 03:59:04 -0400 Received: from mx2.redhat.com ([66.187.237.31]:42340 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752261AbZFHH7C (ORCPT ); Mon, 8 Jun 2009 03:59:02 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n587x1dY008487; Mon, 8 Jun 2009 03:59:01 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n587x0Ot032539; Mon, 8 Jun 2009 03:59:00 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n587wwGI008841; Mon, 8 Jun 2009 03:58:59 -0400 Received: from balrog.qumranet.com (dhcp-1-197.tlv.redhat.com [10.35.1.197]) by cleopatra.tlv.redhat.com (Postfix) with ESMTP id 8FE17250ABF; Mon, 8 Jun 2009 10:58:58 +0300 (IDT) Message-ID: <4A2CC4C2.4050901@redhat.com> Date: Mon, 08 Jun 2009 10:58:58 +0300 From: Avi Kivity User-Agent: Thunderbird 2.0.0.21 (X11/20090320) MIME-Version: 1.0 To: Linus Torvalds CC: KVM list , linux-kernel Subject: [GIT PULL] KVM fix for 2.6.30-rc8 X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Linus, if it's not too late, please pull git://git.kernel.org/pub/scm/virt/kvm/kvm.git kvm-updates/2.6.30 this fixes a crash during reboot with the kvm modules loaded if CONFIG_SMP is selected. If you merge the larger cpumask initializing allocator, you can drop this. Avi Kivity (1): KVM: Explicity initialize cpus_hardware_enabled virt/kvm/kvm_main.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) commit a4c0364be3f43d3e17fe19270f8b3d64881606e6 Author: Avi Kivity Date: Sat Jun 6 12:34:39 2009 +0300 KVM: Explicity initialize cpus_hardware_enabled Under CONFIG_MAXSMP, cpus_hardware_enabled is allocated from the heap and not statically initialized. This causes a crash on reboot when kvm thinks vmx is enabled on random nonexistent cpus and accesses nonexistent percpu lists. Fix by explicitly clearing the variable. Cc: stable@kernel.org Reported-and-tested-by: Yinghai Lu Signed-off-by: Avi Kivity diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 1ecbe23..4293528 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -2305,6 +2305,7 @@ int kvm_init(void *opaque, unsigned int vcpu_size, r = -ENOMEM; goto out_free_0; } + cpumask_clear(cpus_hardware_enabled); r = kvm_arch_hardware_setup(); if (r < 0)