diff options
author | Doug Chapman <doug.chapman@hp.com> | 2008-11-05 17:57:52 -0500 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2008-11-06 12:28:27 -0500 |
commit | 62ee0540f5e5a804b79cae8b3c0185a85f02436b (patch) | |
tree | 371f35ceddba751ad1f09a78f10559c56c64581e /arch/ia64/kernel | |
parent | 1547a01226bcc3fd575fd5383b8b55476a02b518 (diff) |
[IA64] fix boot panic caused by offline CPUs
This fixes a regression introduced by 2c6e6db41f01b6b4eb98809350827c9678996698
"Minimize per_cpu reservations." That patch incorrectly used information about
what CPUs are possible that was not yet initialized by ACPI. The end result
was that per_cpu structures for offline CPUs were not initialized causing a
NULL pointer reference.
Since we cannot do the full acpi_boot_init() call any earlier, the simplest
fix is to just parse the MADT for SAPIC entries early to find the CPU
info. This should also allow for some cleanup of the code added by the
"Minimize per_cpu reservations". This patch just fixes the regressions, the
cleanup will come in a later patch.
Signed-off-by: Doug Chapman <doug.chapman@hp.com>
Signed-off-by: Alex Chiang <achiang@hp.com>
CC: Robin Holt <holt@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64/kernel')
-rw-r--r-- | arch/ia64/kernel/acpi.c | 29 | ||||
-rw-r--r-- | arch/ia64/kernel/setup.c | 7 |
2 files changed, 28 insertions, 8 deletions
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c index 0635015d0aaa..bd7acc71e8a9 100644 --- a/arch/ia64/kernel/acpi.c +++ b/arch/ia64/kernel/acpi.c | |||
@@ -678,6 +678,30 @@ static int __init acpi_parse_fadt(struct acpi_table_header *table) | |||
678 | return 0; | 678 | return 0; |
679 | } | 679 | } |
680 | 680 | ||
681 | int __init early_acpi_boot_init(void) | ||
682 | { | ||
683 | int ret; | ||
684 | |||
685 | /* | ||
686 | * do a partial walk of MADT to determine how many CPUs | ||
687 | * we have including offline CPUs | ||
688 | */ | ||
689 | if (acpi_table_parse(ACPI_SIG_MADT, acpi_parse_madt)) { | ||
690 | printk(KERN_ERR PREFIX "Can't find MADT\n"); | ||
691 | return 0; | ||
692 | } | ||
693 | |||
694 | ret = acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_SAPIC, | ||
695 | acpi_parse_lsapic, NR_CPUS); | ||
696 | if (ret < 1) | ||
697 | printk(KERN_ERR PREFIX | ||
698 | "Error parsing MADT - no LAPIC entries\n"); | ||
699 | |||
700 | return 0; | ||
701 | } | ||
702 | |||
703 | |||
704 | |||
681 | int __init acpi_boot_init(void) | 705 | int __init acpi_boot_init(void) |
682 | { | 706 | { |
683 | 707 | ||
@@ -701,11 +725,6 @@ int __init acpi_boot_init(void) | |||
701 | printk(KERN_ERR PREFIX | 725 | printk(KERN_ERR PREFIX |
702 | "Error parsing LAPIC address override entry\n"); | 726 | "Error parsing LAPIC address override entry\n"); |
703 | 727 | ||
704 | if (acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_SAPIC, acpi_parse_lsapic, NR_CPUS) | ||
705 | < 1) | ||
706 | printk(KERN_ERR PREFIX | ||
707 | "Error parsing MADT - no LAPIC entries\n"); | ||
708 | |||
709 | if (acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_APIC_NMI, acpi_parse_lapic_nmi, 0) | 728 | if (acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_APIC_NMI, acpi_parse_lapic_nmi, 0) |
710 | < 0) | 729 | < 0) |
711 | printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n"); | 730 | printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n"); |
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c index ae7911702bf8..bf441f49682c 100644 --- a/arch/ia64/kernel/setup.c +++ b/arch/ia64/kernel/setup.c | |||
@@ -561,8 +561,12 @@ setup_arch (char **cmdline_p) | |||
561 | #ifdef CONFIG_ACPI | 561 | #ifdef CONFIG_ACPI |
562 | /* Initialize the ACPI boot-time table parser */ | 562 | /* Initialize the ACPI boot-time table parser */ |
563 | acpi_table_init(); | 563 | acpi_table_init(); |
564 | early_acpi_boot_init(); | ||
564 | # ifdef CONFIG_ACPI_NUMA | 565 | # ifdef CONFIG_ACPI_NUMA |
565 | acpi_numa_init(); | 566 | acpi_numa_init(); |
567 | #ifdef CONFIG_ACPI_HOTPLUG_CPU | ||
568 | prefill_possible_map(); | ||
569 | #endif | ||
566 | per_cpu_scan_finalize((cpus_weight(early_cpu_possible_map) == 0 ? | 570 | per_cpu_scan_finalize((cpus_weight(early_cpu_possible_map) == 0 ? |
567 | 32 : cpus_weight(early_cpu_possible_map)), | 571 | 32 : cpus_weight(early_cpu_possible_map)), |
568 | additional_cpus > 0 ? additional_cpus : 0); | 572 | additional_cpus > 0 ? additional_cpus : 0); |
@@ -853,9 +857,6 @@ void __init | |||
853 | setup_per_cpu_areas (void) | 857 | setup_per_cpu_areas (void) |
854 | { | 858 | { |
855 | /* start_kernel() requires this... */ | 859 | /* start_kernel() requires this... */ |
856 | #ifdef CONFIG_ACPI_HOTPLUG_CPU | ||
857 | prefill_possible_map(); | ||
858 | #endif | ||
859 | } | 860 | } |
860 | 861 | ||
861 | /* | 862 | /* |