lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-a553b142b8effbfcbba24ebbf8c07a1a86d32ce6@git.kernel.org>
Date:	Fri, 16 May 2014 06:33:43 -0700
From:	tip-bot for Thomas Gleixner <tipbot@...or.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org, grant.likely@...aro.org,
	hpa@...or.com, mingo@...nel.org, joro@...tes.org,
	peterz@...radead.org, tony.luck@...el.com, fenghua.yu@...el.com,
	tglx@...utronix.de
Subject: [tip:irq/core] iommu: dmar: Provide arch specific irq allocation

Commit-ID:  a553b142b8effbfcbba24ebbf8c07a1a86d32ce6
Gitweb:     http://git.kernel.org/tip/a553b142b8effbfcbba24ebbf8c07a1a86d32ce6
Author:     Thomas Gleixner <tglx@...utronix.de>
AuthorDate: Wed, 7 May 2014 15:44:11 +0000
Committer:  Thomas Gleixner <tglx@...utronix.de>
CommitDate: Fri, 16 May 2014 14:05:19 +0200

iommu: dmar: Provide arch specific irq allocation

ia64 and x86 share this driver. x86 is moving to a different irq
allocation and ia64 keeps its private irq_create/destroy stuff.

Use macros to redirect to one or the other. Yes, macros to avoid
include hell.

Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Reviewed-by: Grant Likely <grant.likely@...aro.org>
Cc: Tony Luck <tony.luck@...el.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Fenghua Yu <fenghua.yu@...el.com>
Acked-by: Joerg Roedel <joro@...tes.org>
Cc: x86@...nel.org
Cc: linux-ia64@...r.kernel.org
Cc: iommu@...ts.linux-foundation.org
Link: http://lkml.kernel.org/r/20140507154336.372289825@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
---
 arch/ia64/include/asm/irq_remapping.h | 2 ++
 arch/x86/include/asm/irq_remapping.h  | 3 +++
 drivers/iommu/dmar.c                  | 6 +++---
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/arch/ia64/include/asm/irq_remapping.h b/arch/ia64/include/asm/irq_remapping.h
index a8687b1..e3b3556 100644
--- a/arch/ia64/include/asm/irq_remapping.h
+++ b/arch/ia64/include/asm/irq_remapping.h
@@ -1,4 +1,6 @@
 #ifndef __IA64_INTR_REMAPPING_H
 #define __IA64_INTR_REMAPPING_H
 #define irq_remapping_enabled 0
+#define dmar_alloc_hwirq	create_irq
+#define dmar_free_hwirq		destroy_irq
 #endif
diff --git a/arch/x86/include/asm/irq_remapping.h b/arch/x86/include/asm/irq_remapping.h
index d806b22..b7747c4 100644
--- a/arch/x86/include/asm/irq_remapping.h
+++ b/arch/x86/include/asm/irq_remapping.h
@@ -103,4 +103,7 @@ static inline bool setup_remapped_irq(int irq,
 }
 #endif /* CONFIG_IRQ_REMAP */
 
+#define dmar_alloc_hwirq()	irq_alloc_hwirq(-1)
+#define dmar_free_hwirq		irq_free_hwirq
+
 #endif /* __X86_IRQ_REMAPPING_H */
diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c
index 3ce1f62..9a4f05e 100644
--- a/drivers/iommu/dmar.c
+++ b/drivers/iommu/dmar.c
@@ -994,7 +994,7 @@ static void free_iommu(struct intel_iommu *iommu)
 	if (iommu->irq) {
 		free_irq(iommu->irq, iommu);
 		irq_set_handler_data(iommu->irq, NULL);
-		destroy_irq(iommu->irq);
+		dmar_free_hwirq(iommu->irq);
 	}
 
 	if (iommu->qi) {
@@ -1550,7 +1550,7 @@ int dmar_set_interrupt(struct intel_iommu *iommu)
 	if (iommu->irq)
 		return 0;
 
-	irq = create_irq();
+	irq = dmar_alloc_hwirq();
 	if (irq <= 0) {
 		pr_err("IOMMU: no free vectors\n");
 		return -EINVAL;
@@ -1563,7 +1563,7 @@ int dmar_set_interrupt(struct intel_iommu *iommu)
 	if (ret) {
 		irq_set_handler_data(irq, NULL);
 		iommu->irq = 0;
-		destroy_irq(irq);
+		dmar_free_hwirq(irq);
 		return ret;
 	}
 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ