aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2010-10-12 10:39:44 -0400
committerThomas Gleixner <tglx@linutronix.de>2010-10-12 10:39:53 -0400
commit8ffcfa4e2d96342180e02dfe1230b97778c52d72 (patch)
tree77255a0235022444fe958ab1092fb352e6222b72
parentb683de2b3cb17bb10fa6fd4af614dc75b5749fe0 (diff)
parentfa47f7e52874683a9659df2f1f143105f676dc0f (diff)
Merge branch 'x86/x2apic' into irq/sparseirq
Reason: Avoid conflicts with the x2apic modifications Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--arch/x86/include/asm/irq_remapping.h27
-rw-r--r--arch/x86/kernel/apic/apic.c3
-rw-r--r--arch/x86/kernel/apic/io_apic.c25
-rw-r--r--arch/x86/kernel/apic/probe_64.c3
-rw-r--r--arch/x86/kernel/smpboot.c4
5 files changed, 34 insertions, 28 deletions
diff --git a/arch/x86/include/asm/irq_remapping.h b/arch/x86/include/asm/irq_remapping.h
index f275e2244505..8d841505344e 100644
--- a/arch/x86/include/asm/irq_remapping.h
+++ b/arch/x86/include/asm/irq_remapping.h
@@ -3,4 +3,31 @@
3 3
4#define IRTE_DEST(dest) ((x2apic_mode) ? dest : dest << 8) 4#define IRTE_DEST(dest) ((x2apic_mode) ? dest : dest << 8)
5 5
6#ifdef CONFIG_INTR_REMAP
7static 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
28static void prepare_irte(struct irte *irte, int vector, unsigned int dest)
29{
30}
31#endif
32
6#endif /* _ASM_X86_IRQ_REMAPPING_H */ 33#endif /* _ASM_X86_IRQ_REMAPPING_H */
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index e3b534cda49a..8cf86fb3b4e3 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -1665,10 +1665,7 @@ int __init APIC_init_uniprocessor(void)
1665 } 1665 }
1666#endif 1666#endif
1667 1667
1668#ifndef CONFIG_SMP
1669 enable_IR_x2apic();
1670 default_setup_apic_routing(); 1668 default_setup_apic_routing();
1671#endif
1672 1669
1673 verify_local_APIC(); 1670 verify_local_APIC();
1674 connect_bsp_APIC(); 1671 connect_bsp_APIC();
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 5aee1d1a306d..fe92916acd2a 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -1377,21 +1377,7 @@ int setup_ioapic_entry(int apic_id, int irq,
1377 if (index < 0) 1377 if (index < 0)
1378 panic("Failed to allocate IRTE for ioapic %d\n", apic_id); 1378 panic("Failed to allocate IRTE for ioapic %d\n", apic_id);
1379 1379
1380 memset(&irte, 0, sizeof(irte)); 1380 prepare_irte(&irte, vector, destination);
1381
1382 irte.present = 1;
1383 irte.dst_mode = apic->irq_dest_mode;
1384 /*
1385 * Trigger mode in the IRTE will always be edge, and the
1386 * actual level or edge trigger will be setup in the IO-APIC
1387 * RTE. This will help simplify level triggered irq migration.
1388 * For more details, see the comments above explainig IO-APIC
1389 * irq migration in the presence of interrupt-remapping.
1390 */
1391 irte.trigger_mode = 0;
1392 irte.dlvry_mode = apic->irq_delivery_mode;
1393 irte.vector = vector;
1394 irte.dest_id = IRTE_DEST(destination);
1395 1381
1396 /* Set source-id of interrupt request */ 1382 /* Set source-id of interrupt request */
1397 set_ioapic_sid(&irte, apic_id); 1383 set_ioapic_sid(&irte, apic_id);
@@ -3335,14 +3321,7 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq,
3335 ir_index = map_irq_to_irte_handle(irq, &sub_handle); 3321 ir_index = map_irq_to_irte_handle(irq, &sub_handle);
3336 BUG_ON(ir_index == -1); 3322 BUG_ON(ir_index == -1);
3337 3323
3338 memset (&irte, 0, sizeof(irte)); 3324 prepare_irte(&irte, cfg->vector, dest);
3339
3340 irte.present = 1;
3341 irte.dst_mode = apic->irq_dest_mode;
3342 irte.trigger_mode = 0; /* edge */
3343 irte.dlvry_mode = apic->irq_delivery_mode;
3344 irte.vector = cfg->vector;
3345 irte.dest_id = IRTE_DEST(dest);
3346 3325
3347 /* Set source-id of interrupt request */ 3326 /* Set source-id of interrupt request */
3348 if (pdev) 3327 if (pdev)
diff --git a/arch/x86/kernel/apic/probe_64.c b/arch/x86/kernel/apic/probe_64.c
index 83e9be4778e2..f9e4e6a54073 100644
--- a/arch/x86/kernel/apic/probe_64.c
+++ b/arch/x86/kernel/apic/probe_64.c
@@ -54,6 +54,9 @@ static int apicid_phys_pkg_id(int initial_apic_id, int index_msb)
54 */ 54 */
55void __init default_setup_apic_routing(void) 55void __init default_setup_apic_routing(void)
56{ 56{
57
58 enable_IR_x2apic();
59
57#ifdef CONFIG_X86_X2APIC 60#ifdef CONFIG_X86_X2APIC
58 if (x2apic_mode 61 if (x2apic_mode
59#ifdef CONFIG_X86_UV 62#ifdef CONFIG_X86_UV
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 8b3bfc4dd708..87a8c6b00f8d 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1109,8 +1109,6 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)
1109 } 1109 }
1110 set_cpu_sibling_map(0); 1110 set_cpu_sibling_map(0);
1111 1111
1112 enable_IR_x2apic();
1113 default_setup_apic_routing();
1114 1112
1115 if (smp_sanity_check(max_cpus) < 0) { 1113 if (smp_sanity_check(max_cpus) < 0) {
1116 printk(KERN_INFO "SMP disabled\n"); 1114 printk(KERN_INFO "SMP disabled\n");
@@ -1118,6 +1116,8 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)
1118 goto out; 1116 goto out;
1119 } 1117 }
1120 1118
1119 default_setup_apic_routing();
1120
1121 preempt_disable(); 1121 preempt_disable();
1122 if (read_apic_id() != boot_cpu_physical_apicid) { 1122 if (read_apic_id() != boot_cpu_physical_apicid) {
1123 panic("Boot APIC ID in local APIC unexpected (%d vs %d)", 1123 panic("Boot APIC ID in local APIC unexpected (%d vs %d)",