From patchwork Wed Feb 24 14:17:58 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 46125 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 96171B7C7E for ; Thu, 25 Feb 2010 01:48:15 +1100 (EST) Received: from localhost ([127.0.0.1]:50992 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NkIX6-0002Lg-O6 for incoming@patchwork.ozlabs.org; Wed, 24 Feb 2010 09:48:12 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NkIWS-0002JU-AJ for qemu-devel@nongnu.org; Wed, 24 Feb 2010 09:47:32 -0500 Received: from [199.232.76.173] (port=53198 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NkIWR-0002Iz-TQ for qemu-devel@nongnu.org; Wed, 24 Feb 2010 09:47:31 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NkIWQ-0000JW-JL for qemu-devel@nongnu.org; Wed, 24 Feb 2010 09:47:31 -0500 Received: from goliath.siemens.de ([192.35.17.28]:23958) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NkIWQ-0005PW-3y for qemu-devel@nongnu.org; Wed, 24 Feb 2010 09:47:30 -0500 Received: from mail2.siemens.de (localhost [127.0.0.1]) by goliath.siemens.de (8.12.11.20060308/8.12.11) with ESMTP id o1OEHwi9016350; Wed, 24 Feb 2010 15:17:58 +0100 Received: from localhost.localdomain (mchn012c.ww002.siemens.net [139.25.109.167] (may be forged)) by mail2.siemens.de (8.12.11.20060308/8.12.11) with ESMTP id o1OEHvk9006898; Wed, 24 Feb 2010 15:17:58 +0100 From: Jan Kiszka To: Avi Kivity , Marcelo Tosatti Date: Wed, 24 Feb 2010 15:17:58 +0100 Message-Id: <86f919e356c26e17bc85aece207e588f07a3388c.1267021065.git.jan.kiszka@siemens.com> X-Mailer: git-send-email 1.6.0.2 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.4-2.6 Cc: Gleb Natapov , qemu-devel@nongnu.org, kvm@vger.kernel.org Subject: [Qemu-devel] [PATCH v3 10/10] qemu-kvm: Bring qemu_init_vcpu back home X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org There is no need for the this hack anymore, initialization is now robust against reordering as it doesn't try to write the VCPU state on its own. Signed-off-by: Jan Kiszka --- hw/pc.c | 5 ----- target-i386/helper.c | 2 ++ 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/hw/pc.c b/hw/pc.c index 971ae70..a83f96e 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -752,11 +752,6 @@ CPUState *pc_new_cpu(const char *cpu_model) } else { qemu_register_reset((QEMUResetHandler*)cpu_reset, env); } - - /* kvm needs this to run after the apic is initialized. Otherwise, - * it can access invalid state and crash. - */ - qemu_init_vcpu(env); return env; } diff --git a/target-i386/helper.c b/target-i386/helper.c index f9d63f6..f83e8cc 100644 --- a/target-i386/helper.c +++ b/target-i386/helper.c @@ -1953,6 +1953,8 @@ CPUX86State *cpu_x86_init(const char *cpu_model) } mce_init(env); + qemu_init_vcpu(env); + return env; }