mirror of
https://git.proxmox.com/git/qemu
synced 2025-08-14 17:47:33 +00:00
x86: Extend validity of bsp_to_cpu
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 <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
This commit is contained in:
parent
ea64305139
commit
6cb2996cef
3
hw/pc.c
3
hw/pc.c
@ -760,7 +760,8 @@ static void pc_init_ne2k_isa(NICInfo *nd)
|
|||||||
|
|
||||||
int cpu_is_bsp(CPUState *env)
|
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)
|
static CPUState *pc_new_cpu(const char *cpu_model)
|
||||||
|
Loading…
Reference in New Issue
Block a user