summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShiraz Hashim <shashim@codeaurora.org>2015-06-25 16:45:24 +0530
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-22 11:14:11 -0700
commitb89acf2719e06e4f231daef3de20b49063b5ffb5 (patch)
treea8e1dce4c9a4ac79b2425f3a513d14e4a7c0f7fc
parent0a2980a12bb4f509168f6721e99d6d1ee6099f60 (diff)
arm: dma-mapping: flush highmem mappings
DMA allocations with no kernel mapping are likely protected as well. Stale highmem mappings in such cases with cache-able attributes may lead to speculative fetch ,as highmem mappings are not cleared out. Hence flush out unused highmem mappings explicitly when allocation request with no kernel mapping is requested. Change-Id: Ic1de633c6364eaa1b6d5b0932f2cfe17d64d920e Signed-off-by: Shiraz Hashim <shashim@codeaurora.org>
-rw-r--r--arch/arm/mm/dma-mapping.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index dd7820f5110a..9932ba9a59f4 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -610,6 +610,10 @@ static void *__alloc_from_contiguous(struct device *dev, size_t size,
* clients trying to use the address incorrectly
*/
ptr = (void *)NO_KERNEL_MAPPING_DUMMY;
+
+ /* also flush out the stale highmem mappings */
+ kmap_flush_unused();
+ kmap_atomic_flush_unused();
} else {
ptr = __dma_alloc_remap(page, size, GFP_KERNEL, prot,
caller);