Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86: acpi use cpu_physical_id

This is from an earlier message from Christoph Lameter:

processor_core.c currently tries to determine the apicid by special casing
for IA64 and x86. The desired information is readily available via

cpu_physical_id()

on IA64, i386 and x86_64.

Signed-off-by: Christoph Lameter <clameter@sgi.com>

Additionally, boot_cpu_id needed to be exported to fix compile errors in
dma code when !CONFIG_SMP.

Signed-off-by: Mike Travis <travis@sgi.com>
Cc: Andi Kleen <ak@suse.de>
Cc: Christoph Lameter <clameter@sgi.com>
Cc: "Siddha, Suresh B" <suresh.b.siddha@intel.com>
Cc: Len Brown <lenb@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Mike Travis and committed by
Thomas Gleixner
71b31233 b6278470

+3 -7
+2
arch/x86/kernel/mpparse_64.c
··· 57 57 58 58 /* Processor that is doing the boot up */ 59 59 unsigned int boot_cpu_id = -1U; 60 + EXPORT_SYMBOL(boot_cpu_id); 61 + 60 62 /* Internal processor count */ 61 63 unsigned int num_processors __cpuinitdata = 0; 62 64
+1 -7
drivers/acpi/processor_core.c
··· 421 421 return 0; 422 422 } 423 423 424 - #ifdef CONFIG_IA64 425 - #define arch_cpu_to_apicid ia64_cpu_to_sapicid 426 - #else 427 - #define arch_cpu_to_apicid x86_cpu_to_apicid 428 - #endif 429 - 430 424 static int map_madt_entry(u32 acpi_id) 431 425 { 432 426 unsigned long madt_end, entry; ··· 494 500 return apic_id; 495 501 496 502 for (i = 0; i < NR_CPUS; ++i) { 497 - if (arch_cpu_to_apicid[i] == apic_id) 503 + if (cpu_physical_id(i) == apic_id) 498 504 return i; 499 505 } 500 506 return -1;