From: Sasha Levin Subject: [PATCH 7/8] kvm tools: fix SMP Date: Mon, 17 Sep 2012 10:03:35 +0200 Message-ID: <1347869016-17204-7-git-send-email-levinsasha928@gmail.com> References: <1347869016-17204-1-git-send-email-levinsasha928@gmail.com> Cc: asias.hejun@gmail.com, mingo@elte.hu, gorcunov@openvz.org, kvm@vger.kernel.org, Sasha Levin To: penberg@kernel.org Return-path: Received: from mail-wg0-f44.google.com ([74.125.82.44]:47887 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754780Ab2IQIDc (ORCPT ); Mon, 17 Sep 2012 04:03:32 -0400 Received: by wgbdr13 with SMTP id dr13so5589754wgb.1 for ; Mon, 17 Sep 2012 01:03:31 -0700 (PDT) In-Reply-To: <1347869016-17204-1-git-send-email-levinsasha928@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: We accidently broke SMP when we moved mptable init to before we initialize the vcpu count, that means that we always built smptable which was not properly initialized for the given configuration. Instead of initializing mptable as part of the kvm arch initialization, let it be initialized on it's own in the firmware initialization level. Signed-off-by: Sasha Levin --- tools/kvm/x86/kvm.c | 14 ++------------ tools/kvm/x86/mptable.c | 2 ++ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/tools/kvm/x86/kvm.c b/tools/kvm/x86/kvm.c index e636d43..ecada45 100644 --- a/tools/kvm/x86/kvm.c +++ b/tools/kvm/x86/kvm.c @@ -342,27 +342,17 @@ bool load_bzimage(struct kvm *kvm, int fd_kernel, */ int kvm__arch_setup_firmware(struct kvm *kvm) { - int r; - /* standart minimal configuration */ setup_bios(kvm); /* FIXME: SMP, ACPI and friends here */ - /* MP table */ - r = mptable__init(kvm); - - return r; + return 0; } int kvm__arch_free_firmware(struct kvm *kvm) { - int r; - - /* MP table */ - r = mptable__exit(kvm); - - return r; + return 0; } void kvm__arch_periodic_poll(struct kvm *kvm) diff --git a/tools/kvm/x86/mptable.c b/tools/kvm/x86/mptable.c index 12bdcf8..ea8c6e8 100644 --- a/tools/kvm/x86/mptable.c +++ b/tools/kvm/x86/mptable.c @@ -280,8 +280,10 @@ int mptable__init(struct kvm *kvm) return 0; } +firmware_init(mptable__init); int mptable__exit(struct kvm *kvm) { return 0; } +firmware_exit(mptable__exit); -- 1.7.12