diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-21 16:54:05 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-21 16:54:05 -0400 |
| commit | 5fe8321b8886d814e65952d74b207fe59e1096ea (patch) | |
| tree | fbba395994b436562a9b03175947fb2534a0becf | |
| parent | 709d9f54cc1847a2d24224ffedec7fd4d0f3c714 (diff) | |
| parent | fa47f7e52874683a9659df2f1f143105f676dc0f (diff) | |
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
| -rw-r--r-- | arch/x86/include/asm/irq_remapping.h | 27 | ||||
| -rw-r--r-- | arch/x86/kernel/apic/apic.c | 3 | ||||
| -rw-r--r-- | arch/x86/kernel/apic/io_apic.c | 25 | ||||
| -rw-r--r-- | arch/x86/kernel/apic/probe_64.c | 3 | ||||
| -rw-r--r-- | arch/x86/kernel/smpboot.c | 4 |
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 | ||
| 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 | #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 f1e78940d908..9508811e8448 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c | |||
| @@ -1382,21 +1382,7 @@ int setup_ioapic_entry(int apic_id, int irq, | |||
| 1382 | if (index < 0) | 1382 | if (index < 0) |
| 1383 | panic("Failed to allocate IRTE for ioapic %d\n", apic_id); | 1383 | panic("Failed to allocate IRTE for ioapic %d\n", apic_id); |
| 1384 | 1384 | ||
| 1385 | memset(&irte, 0, sizeof(irte)); | 1385 | prepare_irte(&irte, vector, destination); |
| 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); | ||
| 1400 | 1386 | ||
| 1401 | /* Set source-id of interrupt request */ | 1387 | /* Set source-id of interrupt request */ |
| 1402 | set_ioapic_sid(&irte, apic_id); | 1388 | set_ioapic_sid(&irte, apic_id); |
| @@ -3340,14 +3326,7 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq, | |||
| 3340 | ir_index = map_irq_to_irte_handle(irq, &sub_handle); | 3326 | ir_index = map_irq_to_irte_handle(irq, &sub_handle); |
| 3341 | BUG_ON(ir_index == -1); | 3327 | BUG_ON(ir_index == -1); |
| 3342 | 3328 | ||
| 3343 | memset (&irte, 0, sizeof(irte)); | 3329 | prepare_irte(&irte, cfg->vector, dest); |
| 3344 | |||
| 3345 | irte.present = 1; | ||
| 3346 | irte.dst_mode = apic->irq_dest_mode; | ||
| 3347 | irte.trigger_mode = 0; /* edge */ | ||
| 3348 | irte.dlvry_mode = apic->irq_delivery_mode; | ||
| 3349 | irte.vector = cfg->vector; | ||
| 3350 | irte.dest_id = IRTE_DEST(dest); | ||
| 3351 | 3330 | ||
| 3352 | /* Set source-id of interrupt request */ | 3331 | /* Set source-id of interrupt request */ |
| 3353 | if (pdev) | 3332 | 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 | */ |
| 55 | void __init default_setup_apic_routing(void) | 55 | void __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 a3df9f830037..2ced73ba048c 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
| @@ -1120,8 +1120,6 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus) | |||
| 1120 | } | 1120 | } |
| 1121 | set_cpu_sibling_map(0); | 1121 | set_cpu_sibling_map(0); |
| 1122 | 1122 | ||
| 1123 | enable_IR_x2apic(); | ||
| 1124 | default_setup_apic_routing(); | ||
| 1125 | 1123 | ||
| 1126 | if (smp_sanity_check(max_cpus) < 0) { | 1124 | if (smp_sanity_check(max_cpus) < 0) { |
| 1127 | printk(KERN_INFO "SMP disabled\n"); | 1125 | printk(KERN_INFO "SMP disabled\n"); |
| @@ -1129,6 +1127,8 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus) | |||
| 1129 | goto out; | 1127 | goto out; |
| 1130 | } | 1128 | } |
| 1131 | 1129 | ||
| 1130 | default_setup_apic_routing(); | ||
| 1131 | |||
| 1132 | preempt_disable(); | 1132 | preempt_disable(); |
| 1133 | if (read_apic_id() != boot_cpu_physical_apicid) { | 1133 | if (read_apic_id() != boot_cpu_physical_apicid) { |
| 1134 | panic("Boot APIC ID in local APIC unexpected (%d vs %d)", | 1134 | panic("Boot APIC ID in local APIC unexpected (%d vs %d)", |
