Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3c43f039 authored by Ingo Molnar's avatar Ingo Molnar Committed by Andi Kleen
Browse files

[PATCH] x86: default to physical mode on hotplug CPU kernels



Default to physical mode on hotplug CPU kernels.  Furher simplify and clean up
the APIC initialization code.

Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarAndi Kleen <ak@suse.de>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: Andi Kleen <ak@suse.de>
Cc: "Li, Shaohua" <shaohua.li@intel.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
parent 424df390
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -874,7 +874,7 @@ static void __init acpi_process_madt(void)
				acpi_ioapic = 1;
				acpi_ioapic = 1;


				smp_found_config = 1;
				smp_found_config = 1;
				clustered_apic_check();
				setup_apic_routing();
			}
			}
		}
		}
		if (error == -EINVAL) {
		if (error == -EINVAL) {
+1 −1
Original line number Original line Diff line number Diff line
@@ -477,7 +477,7 @@ static int __init smp_read_mpc(struct mp_config_table *mpc)
		}
		}
		++mpc_record;
		++mpc_record;
	}
	}
	clustered_apic_check();
	setup_apic_routing();
	if (!num_processors)
	if (!num_processors)
		printk(KERN_ERR "SMP mptable: no processors registered!\n");
		printk(KERN_ERR "SMP mptable: no processors registered!\n");
	return num_processors;
	return num_processors;
+3 −13
Original line number Original line Diff line number Diff line
@@ -35,11 +35,8 @@ struct genapic __read_mostly *genapic = &apic_flat;
/*
/*
 * Check the APIC IDs in bios_cpu_apicid and choose the APIC mode.
 * Check the APIC IDs in bios_cpu_apicid and choose the APIC mode.
 */
 */
void __init clustered_apic_check(void)
void __init setup_apic_routing(void)
{
{
	unsigned int i, max_apic = 0;
	u8 id;

#ifdef CONFIG_ACPI
#ifdef CONFIG_ACPI
	/*
	/*
	 * Quirk: some x86_64 machines can only use physical APIC mode
	 * Quirk: some x86_64 machines can only use physical APIC mode
@@ -49,17 +46,10 @@ void __init clustered_apic_check(void)
	if (acpi_gbl_FADT.header.revision > FADT2_REVISION_ID &&
	if (acpi_gbl_FADT.header.revision > FADT2_REVISION_ID &&
			(acpi_gbl_FADT.flags & ACPI_FADT_APIC_PHYSICAL))
			(acpi_gbl_FADT.flags & ACPI_FADT_APIC_PHYSICAL))
		genapic = &apic_physflat;
		genapic = &apic_physflat;
	else
#endif
#endif


	for (i = 0; i < NR_CPUS; i++) {
	if (cpus_weight(cpu_possible_map) <= 8)
		id = bios_cpu_apicid[i];
		if (id == BAD_APICID)
			continue;
		if (id > max_apic)
			max_apic = id;
	}

	if (max_apic < 8)
		genapic = &apic_flat;
		genapic = &apic_flat;
	else
	else
		genapic = &apic_physflat;
		genapic = &apic_physflat;
+1 −1
Original line number Original line Diff line number Diff line
@@ -300,7 +300,7 @@ static int __init smp_read_mpc(struct mp_config_table *mpc)
			}
			}
		}
		}
	}
	}
	clustered_apic_check();
	setup_apic_routing();
	if (!num_processors)
	if (!num_processors)
		printk(KERN_ERR "MPTABLE: no processors registered!\n");
		printk(KERN_ERR "MPTABLE: no processors registered!\n");
	return num_processors;
	return num_processors;
+2 −2
Original line number Original line Diff line number Diff line
@@ -36,7 +36,7 @@ struct genapic {
	void (*init_apic_ldr)(void);
	void (*init_apic_ldr)(void);
	physid_mask_t (*ioapic_phys_id_map)(physid_mask_t map);
	physid_mask_t (*ioapic_phys_id_map)(physid_mask_t map);


	void (*clustered_apic_check)(void);
	void (*setup_apic_routing)(void);
	int (*multi_timer_check)(int apic, int irq);
	int (*multi_timer_check)(int apic, int irq);
	int (*apicid_to_node)(int logical_apicid); 
	int (*apicid_to_node)(int logical_apicid); 
	int (*cpu_to_logical_apicid)(int cpu);
	int (*cpu_to_logical_apicid)(int cpu);
@@ -99,7 +99,7 @@ struct genapic {
	APICFUNC(check_apicid_present) \
	APICFUNC(check_apicid_present) \
	APICFUNC(init_apic_ldr) \
	APICFUNC(init_apic_ldr) \
	APICFUNC(ioapic_phys_id_map) \
	APICFUNC(ioapic_phys_id_map) \
	APICFUNC(clustered_apic_check) \
	APICFUNC(setup_apic_routing) \
	APICFUNC(multi_timer_check) \
	APICFUNC(multi_timer_check) \
	APICFUNC(apicid_to_node) \
	APICFUNC(apicid_to_node) \
	APICFUNC(cpu_to_logical_apicid) \
	APICFUNC(cpu_to_logical_apicid) \
Loading