Commit be0d03f1 authored by Vivek Goyal's avatar Vivek Goyal Committed by Linus Torvalds

[PATCH] i386 kdump boot cpu physical apicid fix

o Kdump second kernel boot fails after a system crash if second kernel
  is UP and acpi=off and if crash occurred on a non-boot cpu.

o Issue here is that MP tables report boot cpu lapic id as 0 but second
  kernel is booting on a different processor and MP table data is stale
  in this context. Hence apic_id_registered() check fails in setup_local_APIC()
  when called from APIC_init_uniprocessor().

o Problem is not seen if ACPI is enabled as in that case
  boot_cpu_physical_apicid is read from the LAPIC.

o Problem is not seen with SMP kernels as well because in this case also
  boot_cpu_physical_apicid is read from LAPIC. (smp_boot_cpus()).

o The problem is fixed by reading boot_cpu_physical_apicid from LAPIC
  if it is a UP kernel and CRASH_DUMP is enabled.
Signed-off-by: default avatarVivek Goyal <vgoyal@in.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 5daa3ba0
......@@ -1341,6 +1341,14 @@ int __init APIC_init_uniprocessor (void)
connect_bsp_APIC();
/*
* Hack: In case of kdump, after a crash, kernel might be booting
* on a cpu with non-zero lapic id. But boot_cpu_physical_apicid
* might be zero if read from MP tables. Get it from LAPIC.
*/
#ifdef CONFIG_CRASH_DUMP
boot_cpu_physical_apicid = GET_APIC_ID(apic_read(APIC_ID));
#endif
phys_cpu_present_map = physid_mask_of_physid(boot_cpu_physical_apicid);
setup_local_APIC();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment