aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorSuresh Siddha <suresh.b.siddha@intel.com>2009-03-16 20:04:55 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2009-03-17 18:38:59 -0400
commit9d783ba042771284fb4ee5013c3d94220755ae7f (patch)
tree102ec9f89d363589108ae35e4b38c12fc6e2765c /arch
parent0ac2491f57af5644f88383d28809760902d6f4d7 (diff)
x86, x2apic: enable fault handling for intr-remapping
Impact: interface augmentation (not yet used) Enable fault handling flow for intr-remapping aswell. Fault handling code now shared by both dma-remapping and intr-remapping. Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/include/asm/msidef.h1
-rw-r--r--arch/x86/kernel/apic/io_apic.c9
-rw-r--r--arch/x86/kernel/apic/probe_64.c9
3 files changed, 17 insertions, 2 deletions
diff --git a/arch/x86/include/asm/msidef.h b/arch/x86/include/asm/msidef.h
index 6706b3006f13..4cc48af23fef 100644
--- a/arch/x86/include/asm/msidef.h
+++ b/arch/x86/include/asm/msidef.h
@@ -47,6 +47,7 @@
47#define MSI_ADDR_DEST_ID_MASK 0x00ffff0 47#define MSI_ADDR_DEST_ID_MASK 0x00ffff0
48#define MSI_ADDR_DEST_ID(dest) (((dest) << MSI_ADDR_DEST_ID_SHIFT) & \ 48#define MSI_ADDR_DEST_ID(dest) (((dest) << MSI_ADDR_DEST_ID_SHIFT) & \
49 MSI_ADDR_DEST_ID_MASK) 49 MSI_ADDR_DEST_ID_MASK)
50#define MSI_ADDR_EXT_DEST_ID(dest) ((dest) & 0xffffff00)
50 51
51#define MSI_ADDR_IR_EXT_INT (1 << 4) 52#define MSI_ADDR_IR_EXT_INT (1 << 4)
52#define MSI_ADDR_IR_SHV (1 << 3) 53#define MSI_ADDR_IR_SHV (1 << 3)
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 00e6071cefc4..b18a7734d689 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -3294,7 +3294,12 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq, struct msi_ms
3294 } else 3294 } else
3295#endif 3295#endif
3296 { 3296 {
3297 msg->address_hi = MSI_ADDR_BASE_HI; 3297 if (x2apic_enabled())
3298 msg->address_hi = MSI_ADDR_BASE_HI |
3299 MSI_ADDR_EXT_DEST_ID(dest);
3300 else
3301 msg->address_hi = MSI_ADDR_BASE_HI;
3302
3298 msg->address_lo = 3303 msg->address_lo =
3299 MSI_ADDR_BASE_LO | 3304 MSI_ADDR_BASE_LO |
3300 ((apic->irq_dest_mode == 0) ? 3305 ((apic->irq_dest_mode == 0) ?
@@ -3528,7 +3533,7 @@ void arch_teardown_msi_irq(unsigned int irq)
3528 destroy_irq(irq); 3533 destroy_irq(irq);
3529} 3534}
3530 3535
3531#ifdef CONFIG_DMAR 3536#if defined (CONFIG_DMAR) || defined (CONFIG_INTR_REMAP)
3532#ifdef CONFIG_SMP 3537#ifdef CONFIG_SMP
3533static void dmar_msi_set_affinity(unsigned int irq, const struct cpumask *mask) 3538static void dmar_msi_set_affinity(unsigned int irq, const struct cpumask *mask)
3534{ 3539{
diff --git a/arch/x86/kernel/apic/probe_64.c b/arch/x86/kernel/apic/probe_64.c
index 8d7748efe6a8..8297c2b8ed20 100644
--- a/arch/x86/kernel/apic/probe_64.c
+++ b/arch/x86/kernel/apic/probe_64.c
@@ -68,6 +68,15 @@ void __init default_setup_apic_routing(void)
68 apic = &apic_physflat; 68 apic = &apic_physflat;
69 printk(KERN_INFO "Setting APIC routing to %s\n", apic->name); 69 printk(KERN_INFO "Setting APIC routing to %s\n", apic->name);
70 } 70 }
71
72#ifdef CONFIG_X86_X2APIC
73 /*
74 * Now that apic routing model is selected, configure the
75 * fault handling for intr remapping.
76 */
77 if (intr_remapping_enabled)
78 enable_drhd_fault_handling();
79#endif
71} 80}
72 81
73/* Same for both flat and physical. */ 82/* Same for both flat and physical. */