x86/acpi fixes for 4.11
Linus,
please pull the latest x86-acpi-for-linus git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-acpi-for-linus
This update deals with the fallout of the recent work to make cpuid/node mappings persistent. It turned out that the boot time ACPI based mapping tripped over ACPI inconsistencies and caused regressions. It's partially reverted and the fragile part replaced by an implementation which makes the mapping persistent when a CPU goes online for the first time.
Thanks,
tglx
------------------>
Dou Liyang (5):
Revert "x86/acpi: Set persistent cpuid <-> nodeid mapping when booting" Revert"x86/acpi: Enable MADT APIs to return disabled apicids" x86/acpi: Restore the order of CPU IDs
acpi/processor: Implement DEVICE operator for processor enumeration acpi/processor: Check for duplicate processor ids at hotplug time
arch/x86/kernel/acpi/boot.c | 9 ++- arch/x86/kernel/apic/apic.c | 26 +++------ drivers/acpi/acpi_processor.c | 57 +++++++++++++----- drivers/acpi/bus.c | 1 - drivers/acpi/processor_core.c | 133 +++++++----------------------------------- include/linux/acpi.h | 5 +- 6 files changed, 79 insertions(+), 152 deletions(-)
arch/x86/kernel/acpi/boot.c +7 -2
@@ -179,10 +179,15 @@ static int acpi_register_lapic(int id, u32 acpiid, u8 enabled)return -EINVAL ; } +if (!enabled) { + ++disabled_cpus; +return -EINVAL ; + } +if (boot_cpu_physical_apicid !=-1U ) ver = boot_cpu_apic_version; - cpu =__generic_processor_info (id, ver, enabled); + cpu =generic_processor_info (id, ver);if (cpu >=0 )early_per_cpu (x86_cpu_to_acpiid, cpu) = acpiid;
@@ -710,7 +715,7 @@ static void __init acpi_set_irq_model_ioapic(void)#ifdef CONFIG_ACPI_HOTPLUG_CPU #include <acpi/processor.h> -int acpi_map_cpu2node (acpi_handle handle,int cpu,int physid) +static int acpi_map_cpu2node (acpi_handle handle,int cpu,int physid) {#ifdef CONFIG_ACPI_NUMA int nid;
arch/x86/kernel/apic/apic.c +7 -19
@@ -2063,7 +2063,7 @@ static int allocate_logical_cpuid(int apicid)return nr_logical_cpuids++; } -int __generic_processor_info (int apicid,int version,bool enabled) +int generic_processor_info (int apicid,int version) {int cpu, max = nr_cpu_ids; bool boot_cpu_detected = physid_isset(boot_cpu_physical_apicid,
@@ -2121,11 +2121,9 @@ int __generic_processor_info(int apicid, int version, bool enabled)if (num_processors >= nr_cpu_ids) {int thiscpu = max + disabled_cpus; -if (enabled) { -pr_warning ("APIC: NR_CPUS/possible_cpus limit of %i " -"reached. Processor %d/0x%x ignored.\n" , - max, thiscpu, apicid); - } +pr_warning ("APIC: NR_CPUS/possible_cpus limit of %i " +"reached. Processor %d/0x%x ignored.\n" , + max, thiscpu, apicid); disabled_cpus++;return -EINVAL ;
@@ -2177,23 +2175,13 @@ int __generic_processor_info(int apicid, int version, bool enabled) apic->x86_32_early_logical_apicid (cpu);#endif set_cpu_possible (cpu, true); - -if (enabled) { - num_processors++; -physid_set (apicid, phys_cpu_present_map); -set_cpu_present (cpu, true); - }else { - disabled_cpus++; - } +physid_set (apicid, phys_cpu_present_map); +set_cpu_present (cpu, true); + num_processors++;return cpu; } -int generic_processor_info (int apicid,int version) -{ -return __generic_processor_info (apicid, version, true); -} -int hard_smp_processor_id (void ) {return read_apic_id ();
drivers/acpi/acpi_processor.c +42 -15
101 lines not on this page · raw message
drivers/acpi/bus.c +0 -1
@@ -1249,7 +1249,6 @@ static int __init acpi_init(void)acpi_wakeup_device_init ();acpi_debugger_init ();acpi_setup_sb_notify_handler (); -acpi_set_processor_mapping ();return 0 ; }
drivers/acpi/processor_core.c +22 -111
232 lines not on this page · raw message
include/linux/acpi.h +1 -4
@@ -287,18 +287,15 @@ static inline bool invalid_phys_cpuid(phys_cpuid_t phys_id) }/* Validate the processor object's proc_id */ -bool acpi_processor_validate_proc_id (int proc_id); +bool acpi_duplicate_processor_id (int proc_id);#ifdef CONFIG_ACPI_HOTPLUG_CPU /* Arch dependent functions for cpu hotplug support */ int acpi_map_cpu (acpi_handle handle,phys_cpuid_t physid,u32 acpi_id,int *pcpu);int acpi_unmap_cpu (int cpu); -int acpi_map_cpu2node (acpi_handle handle,int cpu,int physid);#endif /* CONFIG_ACPI_HOTPLUG_CPU */ -void acpi_set_processor_mapping (void ); -#ifdef CONFIG_ACPI_HOTPLUG_IOAPIC int acpi_get_ioapic_id (acpi_handle handle,u32 gsi_base,u64 *phys_addr);#endif