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: <1433513463-19128-14-git-send-email-joro@8bytes.org>
Date:	Fri,  5 Jun 2015 16:10:59 +0200
From:	Joerg Roedel <joro@...tes.org>
To:	iommu@...ts.linux-foundation.org
Cc:	zhen-hual@...com, bhe@...hat.com, dwmw2@...radead.org,
	vgoyal@...hat.com, dyoung@...hat.com, alex.williamson@...hat.com,
	ddutile@...hat.com, ishii.hironobu@...fujitsu.com,
	indou.takao@...fujitsu.com, bhelgaas@...gle.com, doug.hatch@...com,
	jerry.hoemann@...com, tom.vaden@...com, li.zhang6@...com,
	lisa.mitchell@...com, billsumnerlinux@...il.com, rwright@...com,
	linux-kernel@...r.kernel.org, linux-pci@...r.kernel.org,
	kexec@...ts.infradead.org, joro@...tes.org, jroedel@...e.de
Subject: [PATCH 13/17] iommu/vt-d: Split up iommu_set_irq_remapping

From: Joerg Roedel <jroedel@...e.de>

Split out the part that enables irq remapping into the new
function iommu_enable_irq_remapping. This allows to program
the irq remapping table to the hardware without enabling irq
remapping.

Tested-by: Baoquan He <bhe@...hat.com>
Signed-off-by: Joerg Roedel <jroedel@...e.de>
---
 drivers/iommu/intel_irq_remapping.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/intel_irq_remapping.c b/drivers/iommu/intel_irq_remapping.c
index 35d73f6..c3d1e63 100644
--- a/drivers/iommu/intel_irq_remapping.c
+++ b/drivers/iommu/intel_irq_remapping.c
@@ -440,9 +440,9 @@ static int set_msi_sid(struct irte *irte, struct pci_dev *dev)
 
 static void iommu_set_irq_remapping(struct intel_iommu *iommu, int mode)
 {
+	unsigned long flags;
 	u64 addr;
 	u32 sts;
-	unsigned long flags;
 
 	addr = virt_to_phys((void *)iommu->ir_table->base);
 
@@ -463,6 +463,12 @@ static void iommu_set_irq_remapping(struct intel_iommu *iommu, int mode)
 	 * interrupt-remapping.
 	 */
 	qi_global_iec(iommu);
+}
+
+static void iommu_enable_irq_remapping(struct intel_iommu *iommu)
+{
+	unsigned long flags;
+	u32 sts;
 
 	raw_spin_lock_irqsave(&iommu->register_lock, flags);
 
@@ -700,8 +706,10 @@ static int __init intel_enable_irq_remapping(void)
 				iommu->ir_table->base_old_phys,
 				INTR_REMAP_TABLE_ENTRIES*sizeof(struct irte));
 			__iommu_load_old_irte(iommu);
-		} else
+		} else {
 			iommu_set_irq_remapping(iommu, eim_mode);
+			iommu_enable_irq_remapping(iommu);
+		}
 
 		setup = true;
 	}
@@ -939,6 +947,7 @@ static int reenable_irq_remapping(int eim)
 
 		/* Set up interrupt remapping for iommu.*/
 		iommu_set_irq_remapping(iommu, eim);
+		iommu_enable_irq_remapping(iommu);
 		setup = true;
 	}
 
@@ -1257,6 +1266,7 @@ static int dmar_ir_add(struct dmar_drhd_unit *dmaru, struct intel_iommu *iommu)
 		ir_remove_ioapic_hpet_scope(iommu);
 	} else {
 		iommu_set_irq_remapping(iommu, eim);
+		iommu_enable_irq_remapping(iommu);
 	}
 
 	return ret;
-- 
1.9.1

--
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