aboutsummaryrefslogtreecommitdiffstats
path: root/arch/microblaze/include/asm
diff options
context:
space:
mode:
authorMichal Simek <monstr@monstr.eu>2010-05-24 06:13:24 -0400
committerMichal Simek <monstr@monstr.eu>2010-08-04 04:22:31 -0400
commit6847ba91a190fe41d21779d6b382b47b2f4c50f4 (patch)
treea7d628c0f938259003a35e1b7d2316924768900a /arch/microblaze/include/asm
parente05816679b61e47e90d7455a8f6dc6126dc479e3 (diff)
microblaze: Fix copy_to_user_page macro
copy_to_user_page macro is used in mm/memory.c:access_process_vm function. This function is called from ptrace code (POKETEXT, POKEDATA) which write data to memory. Microblaze handle physical address for caches that's why there is virt_to_phys conversion. There is potential one location which can caused the problem on WB system. The important is take a look at write PTRACEs requests (POKE/TEXT, DATA, USR). Note: Majority of Microblaze PTRACE code is moved to generic location in newer kernel version that's why this solution should work on the newest kernel version too. linux/io.h is in cacheflush because of mm/nommu.c Tested on a WB system - hello world debugging. Signed-off-by: Michal Simek <monstr@monstr.eu>
Diffstat (limited to 'arch/microblaze/include/asm')
-rw-r--r--arch/microblaze/include/asm/cacheflush.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/microblaze/include/asm/cacheflush.h b/arch/microblaze/include/asm/cacheflush.h
index e9bb567e1b0e..7ebd955460d9 100644
--- a/arch/microblaze/include/asm/cacheflush.h
+++ b/arch/microblaze/include/asm/cacheflush.h
@@ -103,8 +103,10 @@ do { \
103 103
104#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ 104#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
105do { \ 105do { \
106 u32 addr = virt_to_phys(dst); \
107 invalidate_icache_range((unsigned) (addr), (unsigned) (addr) + (len));\
106 memcpy((dst), (src), (len)); \ 108 memcpy((dst), (src), (len)); \
107 flush_icache_range((unsigned) (dst), (unsigned) (dst) + (len)); \ 109 flush_dcache_range((unsigned) (addr), (unsigned) (addr) + (len));\
108} while (0) 110} while (0)
109 111
110#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ 112#define copy_from_user_page(vma, page, vaddr, dst, src, len) \