From patchwork Mon Mar 1 18:10:32 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 46583 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 74F6BB7CEC for ; Tue, 2 Mar 2010 05:17:30 +1100 (EST) Received: from localhost ([127.0.0.1]:40670 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NmABL-0000Yq-78 for incoming@patchwork.ozlabs.org; Mon, 01 Mar 2010 13:17:27 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NmA4r-0003El-AE for qemu-devel@nongnu.org; Mon, 01 Mar 2010 13:10:46 -0500 Received: from [199.232.76.173] (port=44618 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NmA4q-0003DW-4m for qemu-devel@nongnu.org; Mon, 01 Mar 2010 13:10:44 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NmA4k-0008Nt-MH for qemu-devel@nongnu.org; Mon, 01 Mar 2010 13:10:43 -0500 Received: from thoth.sbs.de ([192.35.17.2]:23715) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NmA4i-0008Mx-2f for qemu-devel@nongnu.org; Mon, 01 Mar 2010 13:10:36 -0500 Received: from mail1.siemens.de (localhost [127.0.0.1]) by thoth.sbs.de (8.12.11.20060308/8.12.11) with ESMTP id o21IAXt6020090; Mon, 1 Mar 2010 19:10:34 +0100 Received: from localhost.localdomain (mchn012c.mchp.siemens.de [139.25.109.167] (may be forged)) by mail1.siemens.de (8.12.11.20060308/8.12.11) with ESMTP id o21IAXSV002877; Mon, 1 Mar 2010 19:10:33 +0100 From: Jan Kiszka To: Avi Kivity , Marcelo Tosatti Date: Mon, 1 Mar 2010 19:10:32 +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: qemu-devel@nongnu.org, kvm@vger.kernel.org Subject: [Qemu-devel] [PATCH 4/4] x86: Extend validity of bsp_to_cpu 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, bsp_to_cpu 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 bdc297f..e50a488 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -760,7 +760,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; } static CPUState *pc_new_cpu(const char *cpu_model)