aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/intr_remapping.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-05-01 13:02:50 -0400
committerIngo Molnar <mingo@elte.hu>2009-05-01 13:02:50 -0400
commit4420471f14b79f2a42e4603be7794ea49b68bca4 (patch)
treed391d25458bc0aa86dcf2823fd6c1464883b0533 /drivers/pci/intr_remapping.c
parent15e957d08dd4a841359cfec59ecb74041e0097aa (diff)
parente0e42142bab96404de535cceb85d6533d5ad7942 (diff)
Merge branch 'x86/apic' into irq/numa
Conflicts: arch/x86/kernel/apic/io_apic.c Merge reason: non-trivial interaction between ongoing work in io_apic.c and the NUMA migration feature in the irq tree. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/pci/intr_remapping.c')
-rw-r--r--drivers/pci/intr_remapping.c39
1 files changed, 25 insertions, 14 deletions
diff --git a/drivers/pci/intr_remapping.c b/drivers/pci/intr_remapping.c
index 9eff36a293e..3a0cb0bb059 100644
--- a/drivers/pci/intr_remapping.c
+++ b/drivers/pci/intr_remapping.c
@@ -15,6 +15,14 @@ static struct ioapic_scope ir_ioapic[MAX_IO_APICS];
15static int ir_ioapic_num; 15static int ir_ioapic_num;
16int intr_remapping_enabled; 16int intr_remapping_enabled;
17 17
18static int disable_intremap;
19static __init int setup_nointremap(char *str)
20{
21 disable_intremap = 1;
22 return 0;
23}
24early_param("nointremap", setup_nointremap);
25
18struct irq_2_iommu { 26struct irq_2_iommu {
19 struct intel_iommu *iommu; 27 struct intel_iommu *iommu;
20 u16 irte_index; 28 u16 irte_index;
@@ -420,20 +428,6 @@ static void iommu_set_intr_remapping(struct intel_iommu *iommu, int mode)
420 readl, (sts & DMA_GSTS_IRTPS), sts); 428 readl, (sts & DMA_GSTS_IRTPS), sts);
421 spin_unlock_irqrestore(&iommu->register_lock, flags); 429 spin_unlock_irqrestore(&iommu->register_lock, flags);
422 430
423 if (mode == 0) {
424 spin_lock_irqsave(&iommu->register_lock, flags);
425
426 /* enable comaptiblity format interrupt pass through */
427 cmd = iommu->gcmd | DMA_GCMD_CFI;
428 iommu->gcmd |= DMA_GCMD_CFI;
429 writel(cmd, iommu->reg + DMAR_GCMD_REG);
430
431 IOMMU_WAIT_OP(iommu, DMAR_GSTS_REG,
432 readl, (sts & DMA_GSTS_CFIS), sts);
433
434 spin_unlock_irqrestore(&iommu->register_lock, flags);
435 }
436
437 /* 431 /*
438 * global invalidation of interrupt entry cache before enabling 432 * global invalidation of interrupt entry cache before enabling
439 * interrupt-remapping. 433 * interrupt-remapping.
@@ -513,6 +507,23 @@ end:
513 spin_unlock_irqrestore(&iommu->register_lock, flags); 507 spin_unlock_irqrestore(&iommu->register_lock, flags);
514} 508}
515 509
510int __init intr_remapping_supported(void)
511{
512 struct dmar_drhd_unit *drhd;
513
514 if (disable_intremap)
515 return 0;
516
517 for_each_drhd_unit(drhd) {
518 struct intel_iommu *iommu = drhd->iommu;
519
520 if (!ecap_ir_support(iommu->ecap))
521 return 0;
522 }
523
524 return 1;
525}
526
516int __init enable_intr_remapping(int eim) 527int __init enable_intr_remapping(int eim)
517{ 528{
518 struct dmar_drhd_unit *drhd; 529 struct dmar_drhd_unit *drhd;