Skip to content

Commit 1832c34

Browse files
Vladimir IsaevVVIsaev
authored andcommitted
ARC: Fix phy address in copy_to_user_page()
ARC's __sync_icache_dcache requires phy address as a first argument, but got virtual. We can't just use __pa here, because it works only for direct-mapped kernel addresses but address provided can be from anywhere. So use page_to_phys + offset to calculate phys address from page structure and virtual address. Signed-off-by: Vladimir Isaev <isaev@synopsys.com>
1 parent da716ab commit 1832c34

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/arc/include/asm/cacheflush.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ static inline int cache_is_vipt_aliasing(void)
118118
do { \
119119
memcpy(dst, src, len); \
120120
if (vma->vm_flags & VM_EXEC) \
121-
__sync_icache_dcache(dst, vaddr, len); \
121+
__sync_icache_dcache(page_to_phys(page) + \
122+
(vaddr & ~PAGE_MASK), vaddr, len); \
122123
} while (0)
123124

124125
#define copy_from_user_page(vma, page, vaddr, dst, src, len) \

0 commit comments

Comments
 (0)