Merge branch 'x86-x2apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'x86-x2apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
x86, x2apic: Simplify apic init in SMP and UP builds
x86, intr-remap: Remove IRTE setup duplicate code
x86, intr-remap: Set redirection hint in the IRTE

+34 -28
+27
arch/x86/include/asm/irq_remapping.h
··· 3 3 4 4 #define IRTE_DEST(dest) ((x2apic_mode) ? dest : dest << 8) 5 5 6 + #ifdef CONFIG_INTR_REMAP 7 + static inline void prepare_irte(struct irte *irte, int vector, 8 + unsigned int dest) 9 + { 10 + memset(irte, 0, sizeof(*irte)); 11 + 12 + irte->present = 1; 13 + irte->dst_mode = apic->irq_dest_mode; 14 + /* 15 + * Trigger mode in the IRTE will always be edge, and for IO-APIC, the 16 + * actual level or edge trigger will be setup in the IO-APIC 17 + * RTE. This will help simplify level triggered irq migration. 18 + * For more details, see the comments (in io_apic.c) explainig IO-APIC 19 + * irq migration in the presence of interrupt-remapping. 20 + */ 21 + irte->trigger_mode = 0; 22 + irte->dlvry_mode = apic->irq_delivery_mode; 23 + irte->vector = vector; 24 + irte->dest_id = IRTE_DEST(dest); 25 + irte->redir_hint = 1; 26 + } 27 + #else 28 + static void prepare_irte(struct irte *irte, int vector, unsigned int dest) 29 + { 30 + } 31 + #endif 32 + 6 33 #endif /* _ASM_X86_IRQ_REMAPPING_H */
-3
arch/x86/kernel/apic/apic.c
··· 1665 1665 } 1666 1666 #endif 1667 1667 1668 - #ifndef CONFIG_SMP 1669 - enable_IR_x2apic(); 1670 1668 default_setup_apic_routing(); 1671 - #endif 1672 1669 1673 1670 verify_local_APIC(); 1674 1671 connect_bsp_APIC();
+2 -23
arch/x86/kernel/apic/io_apic.c
··· 1382 1382 if (index < 0) 1383 1383 panic("Failed to allocate IRTE for ioapic %d\n", apic_id); 1384 1384 1385 - memset(&irte, 0, sizeof(irte)); 1386 - 1387 - irte.present = 1; 1388 - irte.dst_mode = apic->irq_dest_mode; 1389 - /* 1390 - * Trigger mode in the IRTE will always be edge, and the 1391 - * actual level or edge trigger will be setup in the IO-APIC 1392 - * RTE. This will help simplify level triggered irq migration. 1393 - * For more details, see the comments above explainig IO-APIC 1394 - * irq migration in the presence of interrupt-remapping. 1395 - */ 1396 - irte.trigger_mode = 0; 1397 - irte.dlvry_mode = apic->irq_delivery_mode; 1398 - irte.vector = vector; 1399 - irte.dest_id = IRTE_DEST(destination); 1385 + prepare_irte(&irte, vector, destination); 1400 1386 1401 1387 /* Set source-id of interrupt request */ 1402 1388 set_ioapic_sid(&irte, apic_id); ··· 3326 3340 ir_index = map_irq_to_irte_handle(irq, &sub_handle); 3327 3341 BUG_ON(ir_index == -1); 3328 3342 3329 - memset (&irte, 0, sizeof(irte)); 3330 - 3331 - irte.present = 1; 3332 - irte.dst_mode = apic->irq_dest_mode; 3333 - irte.trigger_mode = 0; /* edge */ 3334 - irte.dlvry_mode = apic->irq_delivery_mode; 3335 - irte.vector = cfg->vector; 3336 - irte.dest_id = IRTE_DEST(dest); 3343 + prepare_irte(&irte, cfg->vector, dest); 3337 3344 3338 3345 /* Set source-id of interrupt request */ 3339 3346 if (pdev)
+3
arch/x86/kernel/apic/probe_64.c
··· 54 54 */ 55 55 void __init default_setup_apic_routing(void) 56 56 { 57 + 58 + enable_IR_x2apic(); 59 + 57 60 #ifdef CONFIG_X86_X2APIC 58 61 if (x2apic_mode 59 62 #ifdef CONFIG_X86_UV
+2 -2
arch/x86/kernel/smpboot.c
··· 1120 1120 } 1121 1121 set_cpu_sibling_map(0); 1122 1122 1123 - enable_IR_x2apic(); 1124 - default_setup_apic_routing(); 1125 1123 1126 1124 if (smp_sanity_check(max_cpus) < 0) { 1127 1125 printk(KERN_INFO "SMP disabled\n"); 1128 1126 disable_smp(); 1129 1127 goto out; 1130 1128 } 1129 + 1130 + default_setup_apic_routing(); 1131 1131 1132 1132 preempt_disable(); 1133 1133 if (read_apic_id() != boot_cpu_physical_apicid) {