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>] [day] [month] [year] [list]
Message-ID: <44cbba39.hVPnfsQ2VLOwT8Gs%ak@suse.de>
Date:	Sat, 29 Jul 2006 21:42:49 +0200
From:	"Andi Kleen" <ak@...e.de>
To:	torvalds@...l.org
Cc:	discuss@...-64.org, linux-kernel@...r.kernel.org
Subject: [PATCH for 2.6.18] [6/8] x86_64: Fix swiotlb=force


It was broken before. But having it is important as possible hardware
bug workaround.

And previously there was no way to force swiotlb if there is another IOMMU.
Side effect is that iommu=force won't force swiotlb anymore even if there
isn't another IOMMU.

Signed-off-by: Andi Kleen <ak@...e.de>

---
 arch/x86_64/kernel/pci-swiotlb.c |    5 +++--
 include/asm-x86_64/swiotlb.h     |    2 ++
 2 files changed, 5 insertions(+), 2 deletions(-)

Index: linux-2.6.18-rc2-git7/arch/x86_64/kernel/pci-swiotlb.c
===================================================================
--- linux-2.6.18-rc2-git7.orig/arch/x86_64/kernel/pci-swiotlb.c
+++ linux-2.6.18-rc2-git7/arch/x86_64/kernel/pci-swiotlb.c
@@ -31,9 +31,10 @@ struct dma_mapping_ops swiotlb_dma_ops =
 void pci_swiotlb_init(void)
 {
 	/* don't initialize swiotlb if iommu=off (no_iommu=1) */
-	if (!iommu_detected && !no_iommu &&
-	    (end_pfn > MAX_DMA32_PFN || force_iommu))
+	if (!iommu_detected && !no_iommu && end_pfn > MAX_DMA32_PFN)
 	       swiotlb = 1;
+	if (swiotlb_force)
+		swiotlb = 1;
 	if (swiotlb) {
 		printk(KERN_INFO "PCI-DMA: Using software bounce buffering for IO (SWIOTLB)\n");
 		swiotlb_init();
Index: linux-2.6.18-rc2-git7/include/asm-x86_64/swiotlb.h
===================================================================
--- linux-2.6.18-rc2-git7.orig/include/asm-x86_64/swiotlb.h
+++ linux-2.6.18-rc2-git7/include/asm-x86_64/swiotlb.h
@@ -42,6 +42,8 @@ extern void swiotlb_free_coherent (struc
 extern int swiotlb_dma_supported(struct device *hwdev, u64 mask);
 extern void swiotlb_init(void);
 
+extern int swiotlb_force;
+
 #ifdef CONFIG_SWIOTLB
 extern int swiotlb;
 #else
-
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