From patchwork Mon Sep 17 08:03:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 1465871 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 5CC6A400EB for ; Mon, 17 Sep 2012 08:04:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754786Ab2IQIDx (ORCPT ); Mon, 17 Sep 2012 04:03:53 -0400 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=FUD4/5DF+LRCjfvhBcYORNDRkHhS8frcHyOz4g8QndA=; b=mwSNVyYA0/lvRtzDmfDTjGMauz81cyjN8AkhwVs00ByLdKxlvV6QqTWIfRYeb71sDH uDIdRm/E9NIquOLLo7SnWzQgz8afDEjvS2T4S23Gh9BPidSbYqPjb3dmqxS2TTpg0vuo jt03XvoOfnHyCwbH9GAkNqiAtf1pCY183ikpr3iqHYz3P8h3KN4L6j+CaOhIsWx0jxFw 0lnhVbY2Ub4pH0bZti3EUXcuZsnPOwyOdXgcvbjYTwaACZjLKfaLwKMCam0LRUaNTeVF jy7dNgQXB/wyXMDAJSgSXU62Scfs0kEyoFO62vhk0Lq2FZO3aFp4hU8I2LHCQeNDeuwE 48dg== Received: by 10.216.237.161 with SMTP id y33mr5420588weq.62.1347869011144; Mon, 17 Sep 2012 01:03:31 -0700 (PDT) Received: from localhost.localdomain ([37.46.33.122]) by mx.google.com with ESMTPS id v3sm16632604wiw.7.2012.09.17.01.03.29 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 17 Sep 2012 01:03:30 -0700 (PDT) From: Sasha Levin To: penberg@kernel.org Cc: asias.hejun@gmail.com, mingo@elte.hu, gorcunov@openvz.org, kvm@vger.kernel.org, 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> X-Mailer: git-send-email 1.7.12 In-Reply-To: <1347869016-17204-1-git-send-email-levinsasha928@gmail.com> References: <1347869016-17204-1-git-send-email-levinsasha928@gmail.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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);