summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVegard Nossum <vegard.nossum@gmail.com>2009-02-21 13:52:37 +0100
committerVegard Nossum <vegard.nossum@gmail.com>2009-06-15 12:40:13 +0200
commit9b5cab31897e9e89e36c0c2a89b16b93ff1a971a (patch)
tree8ebc2d3c5e380f24239b108a447a1158ad1f56c7
parent9e730237c2cb479649207da1be2114c28d2fcf51 (diff)
downloadop-kernel-dev-9b5cab31897e9e89e36c0c2a89b16b93ff1a971a.zip
op-kernel-dev-9b5cab31897e9e89e36c0c2a89b16b93ff1a971a.tar.gz
kmemcheck: add hooks for page- and sg-dma-mappings
This is needed for page allocator support to prevent false positives when accessing pages which are dma-mapped. [rebased for mainline inclusion] Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com>
-rw-r--r--arch/x86/include/asm/dma-mapping.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/x86/include/asm/dma-mapping.h b/arch/x86/include/asm/dma-mapping.h
index d57d0c1..b93405b 100644
--- a/arch/x86/include/asm/dma-mapping.h
+++ b/arch/x86/include/asm/dma-mapping.h
@@ -89,8 +89,12 @@ dma_map_sg(struct device *hwdev, struct scatterlist *sg,
{
struct dma_map_ops *ops = get_dma_ops(hwdev);
int ents;
+ struct scatterlist *s;
+ int i;
BUG_ON(!valid_dma_direction(dir));
+ for_each_sg(sg, s, nents, i)
+ kmemcheck_mark_initialized(sg_virt(s), s->length);
ents = ops->map_sg(hwdev, sg, nents, dir, NULL);
debug_dma_map_sg(hwdev, sg, nents, ents, dir);
@@ -202,6 +206,7 @@ static inline dma_addr_t dma_map_page(struct device *dev, struct page *page,
dma_addr_t addr;
BUG_ON(!valid_dma_direction(dir));
+ kmemcheck_mark_initialized(page_address(page) + offset, size);
addr = ops->map_page(dev, page, offset, size, dir, NULL);
debug_dma_map_page(dev, page, offset, size, dir, addr, false);
OpenPOWER on IntegriCloud