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: <4902371A.5050303@goop.org>
Date:	Fri, 24 Oct 2008 13:59:06 -0700
From:	Jeremy Fitzhardinge <jeremy@...p.org>
To:	FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>
CC:	linux-kernel@...r.kernel.org, mingo@...e.hu, jens.axboe@...cle.com
Subject: [PATCH 2/2] x86: replace BIO_VMERGE_BOUNDARY with BIOVEC_PHYS_MERGEABLE

The bio common code no longer uses BIO_VMERGE_BOUNDARY, so replace it
with BIOVEC_PHYS_MERGEABLE.  Also make iommu_bio_merge a boolean
rather than a size, as befits its use.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@...rix.com>
Cc: Jens Axboe <jens.axboe@...cle.com>
---
 arch/x86/include/asm/io.h    |    8 +++++++-
 arch/x86/include/asm/io_64.h |    2 --
 arch/x86/kernel/pci-dma.c    |    4 ++--
 3 files changed, 9 insertions(+), 5 deletions(-)

===================================================================
--- a/arch/x86/kernel/pci-dma.c
+++ b/arch/x86/kernel/pci-dma.c
@@ -33,7 +33,7 @@
 
 /* This tells the BIO block layer to assume merging. Default to off
    because we cannot guarantee merging later. */
-int iommu_bio_merge __read_mostly = 0;
+bool iommu_bio_merge __read_mostly = false;
 EXPORT_SYMBOL(iommu_bio_merge);
 
 dma_addr_t bad_dma_address __read_mostly = 0;
@@ -189,7 +189,7 @@
 		}
 
 		if (!strncmp(p, "biomerge", 8)) {
-			iommu_bio_merge = 4096;
+			iommu_bio_merge = true;
 			iommu_merge = 1;
 			force_iommu = 1;
 		}
===================================================================
--- a/arch/x86/include/asm/io.h
+++ b/arch/x86/include/asm/io.h
@@ -4,6 +4,7 @@
 #define ARCH_HAS_IOREMAP_WC
 
 #include <linux/compiler.h>
+#include <linux/types.h>
 
 #define build_mmio_read(name, size, type, reg, barrier) \
 static inline type name(const volatile void __iomem *addr) \
@@ -59,12 +60,17 @@
 #define writeq writeq
 #endif
 
-extern int iommu_bio_merge;
+extern bool iommu_bio_merge;
 
 #ifdef CONFIG_X86_32
 # include "io_32.h"
 #else
 # include "io_64.h"
+#endif
+
+#ifdef CONFIG_X86_64
+#define BIOVEC_PHYS_MERGEABLE(vec1, vec2)				\
+	(iommu_bio_merge && __BIOVEC_PHYS_MERGEABLE(vec1, vec2))
 #endif
 
 extern void *xlate_dev_mem_ptr(unsigned long phys);
===================================================================
--- a/arch/x86/include/asm/io_64.h
+++ b/arch/x86/include/asm/io_64.h
@@ -232,8 +232,6 @@
 
 #define flush_write_buffers()
 
-#define BIO_VMERGE_BOUNDARY iommu_bio_merge
-
 /*
  * Convert a virtual cached pointer to an uncached pointer
  */


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