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-next>] [day] [month] [year] [list]
Message-Id: <20240403234548.989061-1-jacob.jun.pan@linux.intel.com>
Date: Wed,  3 Apr 2024 16:45:47 -0700
From: Jacob Pan <jacob.jun.pan@...ux.intel.com>
To: sivanich@....com,
	Thomas Gleixner <tglx@...utronix.de>,
	LKML <linux-kernel@...r.kernel.org>,
	iommu@...ts.linux.dev,
	"Lu Baolu" <baolu.lu@...ux.intel.com>,
	Joerg Roedel <joro@...tes.org>
Cc: "Tian, Kevin" <kevin.tian@...el.com>,
	Yi Liu <yi.l.liu@...el.com>,
	steve.wahl@....com,
	russ.anderson@....com,
	Peter Zijlstra <peterz@...radead.org>,
	"Will Deacon" <will@...nel.org>,
	"Robin Murphy" <robin.murphy@....com>,
	Jacob Pan <jacob.jun.pan@...ux.intel.com>
Subject: [PATCH 1/2] iommu/vt-d: Rename fault IRQ variable

Originally, DMAR fault IRQ was the only source of interrupts for VT-d
itself, thus simply named 'irq'. Newer interrupt sources were added later
for page requests and perfmon with proper names, i.e. pr_irq and perf_irq.

Rename the fault IRQ to reflect its usage. This avoids confusion when
programming MSI messages for the three possible sources.

Signed-off-by: Jacob Pan <jacob.jun.pan@...ux.intel.com>
---
 drivers/iommu/intel/dmar.c  | 16 ++++++++--------
 drivers/iommu/intel/iommu.h |  2 +-
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/iommu/intel/dmar.c b/drivers/iommu/intel/dmar.c
index 36d7427b1202..ab325af93f71 100644
--- a/drivers/iommu/intel/dmar.c
+++ b/drivers/iommu/intel/dmar.c
@@ -1175,15 +1175,15 @@ static void free_iommu(struct intel_iommu *iommu)
 
 	free_iommu_pmu(iommu);
 
-	if (iommu->irq) {
+	if (iommu->fault_irq) {
 		if (iommu->pr_irq) {
 			free_irq(iommu->pr_irq, iommu);
 			dmar_free_hwirq(iommu->pr_irq);
 			iommu->pr_irq = 0;
 		}
-		free_irq(iommu->irq, iommu);
-		dmar_free_hwirq(iommu->irq);
-		iommu->irq = 0;
+		free_irq(iommu->fault_irq, iommu);
+		dmar_free_hwirq(iommu->fault_irq);
+		iommu->fault_irq = 0;
 	}
 
 	if (iommu->qi) {
@@ -1918,7 +1918,7 @@ static const char *dmar_get_fault_reason(u8 fault_reason, int *fault_type)
 
 static inline int dmar_msi_reg(struct intel_iommu *iommu, int irq)
 {
-	if (iommu->irq == irq)
+	if (iommu->fault_irq == irq)
 		return DMAR_FECTL_REG;
 	else if (iommu->pr_irq == irq)
 		return DMAR_PECTL_REG;
@@ -2105,12 +2105,12 @@ int dmar_set_interrupt(struct intel_iommu *iommu)
 	/*
 	 * Check if the fault interrupt is already initialized.
 	 */
-	if (iommu->irq)
+	if (iommu->fault_irq)
 		return 0;
 
 	irq = dmar_alloc_hwirq(iommu->seq_id, iommu->node, iommu);
 	if (irq > 0) {
-		iommu->irq = irq;
+		iommu->fault_irq = irq;
 	} else {
 		pr_err("No free IRQ vectors\n");
 		return -EINVAL;
@@ -2143,7 +2143,7 @@ int __init enable_drhd_fault_handling(void)
 		/*
 		 * Clear any previous faults.
 		 */
-		dmar_fault(iommu->irq, iommu);
+		dmar_fault(iommu->fault_irq, iommu);
 		fault_status = readl(iommu->reg + DMAR_FSTS_REG);
 		writel(fault_status, iommu->reg + DMAR_FSTS_REG);
 	}
diff --git a/drivers/iommu/intel/iommu.h b/drivers/iommu/intel/iommu.h
index 404d2476a877..deebd4817d27 100644
--- a/drivers/iommu/intel/iommu.h
+++ b/drivers/iommu/intel/iommu.h
@@ -699,7 +699,7 @@ struct intel_iommu {
 	int		seq_id;	/* sequence id of the iommu */
 	int		agaw; /* agaw of this iommu */
 	int		msagaw; /* max sagaw of this iommu */
-	unsigned int	irq, pr_irq, perf_irq;
+	unsigned int	fault_irq, pr_irq, perf_irq;
 	u16		segment;     /* PCI segment# */
 	unsigned char 	name[13];    /* Device Name */
 
-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ