From patchwork Mon Mar 1 17:17:22 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 46576 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 E2374B7D9D for ; Tue, 2 Mar 2010 04:46:15 +1100 (EST) Received: from localhost ([127.0.0.1]:35550 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nm9cT-0003nf-36 for incoming@patchwork.ozlabs.org; Mon, 01 Mar 2010 12:41:25 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nm9Fm-0000FB-An for qemu-devel@nongnu.org; Mon, 01 Mar 2010 12:17:58 -0500 Received: from [199.232.76.173] (port=41212 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nm9Fl-0000Ec-6r for qemu-devel@nongnu.org; Mon, 01 Mar 2010 12:17:57 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Nm9FU-0004Ko-Rn for qemu-devel@nongnu.org; Mon, 01 Mar 2010 12:17:55 -0500 Received: from david.siemens.de ([192.35.17.14]:23126) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Nm9FO-0004Iu-PL for qemu-devel@nongnu.org; Mon, 01 Mar 2010 12:17:36 -0500 Received: from mail2.siemens.de (localhost [127.0.0.1]) by david.siemens.de (8.12.11.20060308/8.12.11) with ESMTP id o21HHULj020541; Mon, 1 Mar 2010 18:17:30 +0100 Received: from localhost.localdomain (mchn012c.mchp.siemens.de [139.25.109.167] (may be forged)) by mail2.siemens.de (8.12.11.20060308/8.12.11) with ESMTP id o21HHUx2000935; Mon, 1 Mar 2010 18:17:30 +0100 From: Jan Kiszka To: Avi Kivity , Marcelo Tosatti Date: Mon, 1 Mar 2010 18:17:22 +0100 Message-Id: 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 v4 03/10] x86: Extend validity of cpu_is_bsp 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 As we hard-wire the BSP to CPU 0 anyway and cpuid_apic_id equals cpu_index, cpu_is_bsp can also be based on the latter directly. This will help an early user of it: KVM while initializing mp_state. Signed-off-by: Jan Kiszka --- hw/pc.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/hw/pc.c b/hw/pc.c index b90a79e..58c32ea 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -767,7 +767,8 @@ static void pc_init_ne2k_isa(NICInfo *nd) int cpu_is_bsp(CPUState *env) { - return env->cpuid_apic_id == 0; + /* We hard-wire the BSP to the first CPU. */ + return env->cpu_index == 0; } CPUState *pc_new_cpu(const char *cpu_model)