From patchwork Wed Feb 24 14:17:51 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [v3,03/10] x86: Extend validity of cpu_is_bsp Date: Wed, 24 Feb 2010 04:17:51 -0000 From: Jan Kiszka X-Patchwork-Id: 46122 Message-Id: <3666c1bbf6d5e39f2e93dd47a7599df2a1431b60.1267021065.git.jan.kiszka@siemens.com> To: Avi Kivity , Marcelo Tosatti Cc: Gleb Natapov , qemu-devel@nongnu.org, kvm@vger.kernel.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 9055866..8b5af35 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -732,7 +732,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)