summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-05-25 02:12:53 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-25 17:39:37 +0200
commitf68aa5b445fd00b67588ade611a4efb1a34dadb4 (patch)
treefcc4c8f74e96922d439d37ba045867f8e4952d8a
parentmm/page_alloc.c: prevent unending loop in __alloc_pages_slowpath() (diff)
downloadlinux-f68aa5b445fd00b67588ade611a4efb1a34dadb4.tar.xz
linux-f68aa5b445fd00b67588ade611a4efb1a34dadb4.zip
asm-generic/cacheflush.h: flush icache when copying to user pages
The copy_to_user_page() function is supposed to flush the icache on the memory that was written, but the current asm-generic version lacks that logic. While normally it isn't a big deal as the asm-generic version of icache flushing is a stub, it is a deal for ports that want to use the asm-generic version as a baseline and then overlay its own specific parts (like icache flushing). Signed-off-by: Mike Frysinger <vapier@gentoo.org> Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--include/asm-generic/cacheflush.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/asm-generic/cacheflush.h b/include/asm-generic/cacheflush.h
index 57b5c3c82e86..87bc536ccde3 100644
--- a/include/asm-generic/cacheflush.h
+++ b/include/asm-generic/cacheflush.h
@@ -24,7 +24,10 @@
#define flush_cache_vunmap(start, end) do { } while (0)
#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
- memcpy(dst, src, len)
+ do { \
+ memcpy(dst, src, len); \
+ flush_icache_user_range(vma, page, vaddr, len); \
+ } while (0)
#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
memcpy(dst, src, len)