aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/ia64/kernel/acpi.c56
-rw-r--r--arch/ia64/kernel/setup.c4
2 files changed, 60 insertions, 0 deletions
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
index d2702c419cf8..34795ede72e0 100644
--- a/arch/ia64/kernel/acpi.c
+++ b/arch/ia64/kernel/acpi.c
@@ -761,6 +761,62 @@ int acpi_map_cpu2node(acpi_handle handle, int cpu, long physid)
761 return (0); 761 return (0);
762} 762}
763 763
764int additional_cpus __initdata = -1;
765
766static __init int setup_additional_cpus(char *s)
767{
768 if (s)
769 additional_cpus = simple_strtol(s, NULL, 0);
770
771 return 0;
772}
773
774early_param("additional_cpus", setup_additional_cpus);
775
776/*
777 * cpu_possible_map should be static, it cannot change as cpu's
778 * are onlined, or offlined. The reason is per-cpu data-structures
779 * are allocated by some modules at init time, and dont expect to
780 * do this dynamically on cpu arrival/departure.
781 * cpu_present_map on the other hand can change dynamically.
782 * In case when cpu_hotplug is not compiled, then we resort to current
783 * behaviour, which is cpu_possible == cpu_present.
784 * - Ashok Raj
785 *
786 * Three ways to find out the number of additional hotplug CPUs:
787 * - If the BIOS specified disabled CPUs in ACPI/mptables use that.
788 * - The user can overwrite it with additional_cpus=NUM
789 * - Otherwise don't reserve additional CPUs.
790 */
791__init void prefill_possible_map(void)
792{
793 int i;
794 int possible, disabled_cpus;
795
796 disabled_cpus = total_cpus - available_cpus;
797 if (additional_cpus == -1) {
798 if (disabled_cpus > 0) {
799 possible = total_cpus;
800 additional_cpus = disabled_cpus;
801 }
802 else {
803 possible = available_cpus;
804 additional_cpus = 0;
805 }
806 } else {
807 possible = available_cpus + additional_cpus;
808 }
809 if (possible > NR_CPUS)
810 possible = NR_CPUS;
811
812 printk(KERN_INFO "SMP: Allowing %d CPUs, %d hotplug CPUs\n",
813 possible,
814 max_t(int, additional_cpus, 0));
815
816 for (i = 0; i < possible; i++)
817 cpu_set(i, cpu_possible_map);
818}
819
764int acpi_map_lsapic(acpi_handle handle, int *pcpu) 820int acpi_map_lsapic(acpi_handle handle, int *pcpu)
765{ 821{
766 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; 822 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
index 35f7835294a3..3258e09278d0 100644
--- a/arch/ia64/kernel/setup.c
+++ b/arch/ia64/kernel/setup.c
@@ -430,6 +430,7 @@ setup_arch (char **cmdline_p)
430 if (early_console_setup(*cmdline_p) == 0) 430 if (early_console_setup(*cmdline_p) == 0)
431 mark_bsp_online(); 431 mark_bsp_online();
432 432
433 parse_early_param();
433#ifdef CONFIG_ACPI 434#ifdef CONFIG_ACPI
434 /* Initialize the ACPI boot-time table parser */ 435 /* Initialize the ACPI boot-time table parser */
435 acpi_table_init(); 436 acpi_table_init();
@@ -688,6 +689,9 @@ void
688setup_per_cpu_areas (void) 689setup_per_cpu_areas (void)
689{ 690{
690 /* start_kernel() requires this... */ 691 /* start_kernel() requires this... */
692#ifdef CONFIG_ACPI_HOTPLUG_CPU
693 prefill_possible_map();
694#endif
691} 695}
692 696
693/* 697/*