lkml.org 
[lkml]   [2008]   [Oct]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
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@citrix.com>
Cc: Jens Axboe <jens.axboe@oracle.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
*/



\
 
 \ /
  Last update: 2008-10-24 23:03    [W:0.062 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site