Skip to contentSkip to conversation

x86/apic changes for v3.2

GIT PULL Ingo Molnar 1 participant 1 message Oct 26, 2011 x86

lore
Share & tools
lore
#0 lore raw

Linus,

Please pull the latest x86-apic-for-linus git tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-apic-for-linus

Thanks,

Ingo

------------------>
Jan Beulich (1):
apic, i386/bigsmp: Fix false warnings regarding logical APIC ID mismatches

Yinghai Lu (6):
x86, ioapic: Pass struct irq_attr * to setup_ioapic_irq() x86, ioapic: Split up setup_ioapic_entry()
x86, ioapic: Print out irte with right ioapic index x86, ioapic: Factor out print_IO_APIC() to only print one io apic x86, ioapic: Clean up ioapic/apic_id usage
x86/irq: Standardize on CONFIG_SPARSE_IRQ=y

 arch/x86/Kconfig                   |    1 +
 arch/x86/include/asm/apic.h        |    2 +-
 arch/x86/include/asm/irq_vectors.h |   12 +-
 arch/x86/kernel/apic/bigsmp_32.c   |   20 ++-
 arch/x86/kernel/apic/io_apic.c     |  394 ++++++++++++++++++------------------
 arch/x86/kernel/apic/probe_32.c    |   10 +-
 6 files changed, 219 insertions(+), 220 deletions(-)
arch/x86/Kconfig +1 -0
index 6a47bb2..fcd34c3 100644
@@ -64,6 +64,7 @@ config X86
 	select HAVE_TEXT_POKE_SMP
 	select HAVE_GENERIC_HARDIRQS
 	select HAVE_SPARSE_IRQ
+	select SPARSE_IRQ
 	select GENERIC_FIND_FIRST_BIT
 	select GENERIC_IRQ_PROBE
 	select GENERIC_PENDING_IRQ if SMP
arch/x86/include/asm/apic.h +1 -1
index 7b3ca83..9b7273c 100644
@@ -495,7 +495,7 @@ static inline void default_wait_for_init_deassert(atomic_t *deassert)
 	return;
 }
 
-extern struct apic *generic_bigsmp_probe(void);
+extern void generic_bigsmp_probe(void);
 
 
 #ifdef CONFIG_X86_LOCAL_APIC
arch/x86/include/asm/irq_vectors.h +2 -10
index 7e50f06..4b44487 100644
@@ -160,19 +160,11 @@ static inline int invalid_vm86_irq(int irq)
 #define IO_APIC_VECTOR_LIMIT		( 32 * MAX_IO_APICS )
 
 #ifdef CONFIG_X86_IO_APIC
-# ifdef CONFIG_SPARSE_IRQ
-#  define CPU_VECTOR_LIMIT		(64 * NR_CPUS)
-#  define NR_IRQS					\
+# define CPU_VECTOR_LIMIT		(64 * NR_CPUS)
+# define NR_IRQS					\
 	(CPU_VECTOR_LIMIT > IO_APIC_VECTOR_LIMIT ?	\
 		(NR_VECTORS + CPU_VECTOR_LIMIT)  :	\
 		(NR_VECTORS + IO_APIC_VECTOR_LIMIT))
-# else
-#  define CPU_VECTOR_LIMIT		(32 * NR_CPUS)
-#  define NR_IRQS					\
-	(CPU_VECTOR_LIMIT < IO_APIC_VECTOR_LIMIT ?	\
-		(NR_VECTORS + CPU_VECTOR_LIMIT)  :	\
-		(NR_VECTORS + IO_APIC_VECTOR_LIMIT))
-# endif
 #else /* !CONFIG_X86_IO_APIC: */
 # define NR_IRQS			NR_IRQS_LEGACY
 #endif
arch/x86/kernel/apic/bigsmp_32.c +16 -4
index efd737e..521bead 100644
@@ -255,12 +255,24 @@ static struct apic apic_bigsmp = {
 	.x86_32_early_logical_apicid	= bigsmp_early_logical_apicid,
 };
 
-struct apic * __init generic_bigsmp_probe(void)
+void __init generic_bigsmp_probe(void)
 {
-	if (probe_bigsmp())
-		return &apic_bigsmp;
+	unsigned int cpu;
 
-	return NULL;
+	if (!probe_bigsmp())
+		return;
+
+	apic = &apic_bigsmp;
+
+	for_each_possible_cpu(cpu) {
+		if (early_per_cpu(x86_cpu_to_logical_apicid,
+				  cpu) == BAD_APICID)
+			continue;
+		early_per_cpu(x86_cpu_to_logical_apicid, cpu) =
+			bigsmp_early_logical_apicid(cpu);
+	}
+
+	pr_info("Overriding APIC driver with %s\n", apic_bigsmp.name);
 }
 
 apic_driver(apic_bigsmp);
arch/x86/kernel/apic/io_apic.c +197 -197

736 lines not on this page · raw message

arch/x86/kernel/apic/probe_32.c +2 -8
index b5254ad..0787bb3 100644
@@ -200,14 +200,8 @@ void __init default_setup_apic_routing(void)
 	 * - we find more than 8 CPUs in acpi LAPIC listing with xAPIC support
 	 */
 
-	if (!cmdline_apic && apic == &apic_default) {
-		struct apic *bigsmp = generic_bigsmp_probe();
-		if (bigsmp) {
-			apic = bigsmp;
-			printk(KERN_INFO "Overriding APIC driver with %s\n",
-			       apic->name);
-		}
-	}
+	if (!cmdline_apic && apic == &apic_default)
+		generic_bigsmp_probe();
 #endif
 
 	if (apic->setup_apic_routing)