From patchwork Thu Mar 4 15:05:16 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [6/6] x86: Extend validity of bsp_to_cpu Date: Thu, 04 Mar 2010 05:05:16 -0000 From: Marcelo Tosatti X-Patchwork-Id: 46913 Message-Id: <6cb2996cef5e273ef370e690e84b5e1403f5c391.1267715116.git.mtosatti@redhat.com> To: Anthony Liguori Cc: Jan Kiszka , Marcelo Tosatti , qemu-devel@nongnu.org, kvm@vger.kernel.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)