From patchwork Thu Mar 4 15:05:16 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 46913 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 87910B7C48 for ; Fri, 5 Mar 2010 02:15:47 +1100 (EST) Received: from localhost ([127.0.0.1]:49975 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NnCm7-0005Vr-PO for incoming@patchwork.ozlabs.org; Thu, 04 Mar 2010 10:15:43 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NnCdH-0002TM-Oh for qemu-devel@nongnu.org; Thu, 04 Mar 2010 10:06:36 -0500 Received: from [199.232.76.173] (port=44321 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NnCdG-0002Sr-Mk for qemu-devel@nongnu.org; Thu, 04 Mar 2010 10:06:34 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NnCd9-0000ey-TY for qemu-devel@nongnu.org; Thu, 04 Mar 2010 10:06:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36708) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NnCd8-0000eb-PR for qemu-devel@nongnu.org; Thu, 04 Mar 2010 10:06:27 -0500 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o24F6O4P029178 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 4 Mar 2010 10:06:25 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o24F6N5f020683; Thu, 4 Mar 2010 10:06:24 -0500 Received: from amt.cnet (vpn-11-217.rdu.redhat.com [10.11.11.217]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o24F6LUD028972; Thu, 4 Mar 2010 10:06:22 -0500 Received: from amt.cnet (amt.cnet [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id 2681B68A9F6; Thu, 4 Mar 2010 12:05:57 -0300 (BRT) Received: (from marcelo@localhost) by amt.cnet (8.14.3/8.14.3/Submit) id o24F5s22028138; Thu, 4 Mar 2010 12:05:54 -0300 From: Marcelo Tosatti To: Anthony Liguori Date: Thu, 4 Mar 2010 12:05:16 -0300 Message-Id: <6cb2996cef5e273ef370e690e84b5e1403f5c391.1267715116.git.mtosatti@redhat.com> In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Jan Kiszka , Marcelo Tosatti , qemu-devel@nongnu.org, kvm@vger.kernel.org Subject: [Qemu-devel] [PATCH 6/6] 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 From: Jan Kiszka 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 Signed-off-by: Marcelo Tosatti --- 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)