Skip to content

Commit 8a95db3

Browse files
KAGA-KOKOjgross1
authored andcommitted
x86/xen/smp_pv: Register the boot CPU APIC properly
The topology core expects the boot APIC to be registered from earhy APIC detection first and then again when the firmware tables are evaluated. This is used for detecting the real BSP CPU on a kexec kernel. The recent conversion of XEN/PV to register fake APIC IDs failed to register the boot CPU APIC correctly as it only registers it once. This causes the BSP detection mechanism to trigger wrongly: CPU topo: Boot CPU APIC ID not the first enumerated APIC ID: 0 > 1 Additionally this results in one CPU being ignored. Register the boot CPU APIC twice so that the XEN/PV fake enumeration behaves like real firmware. Reported-by: Juergen Gross <[email protected]> Fixes: e753070 ("x86/xen/smp_pv: Register fake APICs") Signed-off-by: Thomas Gleixner <[email protected]> Tested-by: Juergen Gross <[email protected]> Reviewed-by: Juergen Gross <[email protected]> Link: https://lore.kernel.org/r/87a5l8s2fg.ffs@tglx Signed-off-by: Juergen Gross <[email protected]>
1 parent e67572c commit 8a95db3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/x86/xen/smp_pv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,9 @@ static void __init xen_pv_smp_config(void)
154154
u32 apicid = 0;
155155
int i;
156156

157-
topology_register_boot_apic(apicid++);
157+
topology_register_boot_apic(apicid);
158158

159-
for (i = 1; i < nr_cpu_ids; i++)
159+
for (i = 0; i < nr_cpu_ids; i++)
160160
topology_register_apic(apicid++, CPU_ACPIID_INVALID, true);
161161

162162
/* Pretend to be a proper enumerated system */

0 commit comments

Comments
 (0)