diff options
author | Vincent Chen <vincentc@andestech.com> | 2018-05-14 04:56:53 -0400 |
---|---|---|
committer | Greentime Hu <greentime@andestech.com> | 2018-05-23 01:26:22 -0400 |
commit | 5b9f95699b2166e06b7d7820c8173fdbff0ddf35 (patch) | |
tree | 1694110e55a861e35815d22ab84cc91076498243 | |
parent | efcc4ea872edaeded28245d9b2ca8b9d8181b7cf (diff) |
nds32: Flush the cache of the page at vmaddr instead of kaddr in flush_anon_page
According to Documentation/cachetlb.txt, the cache of the page at vmaddr
shall be flushed in flush_anon_page instead of the cache of the page at
page_address(page).
Signed-off-by: Vincent Chen <vincentc@andestech.com>
Reviewed-by: Greentime Hu <greentime@andestech.com>
Signed-off-by: Greentime Hu <greentime@andestech.com>
-rw-r--r-- | arch/nds32/mm/cacheflush.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/nds32/mm/cacheflush.c b/arch/nds32/mm/cacheflush.c index 02f25ee39c1d..ae31cd2c21be 100644 --- a/arch/nds32/mm/cacheflush.c +++ b/arch/nds32/mm/cacheflush.c | |||
@@ -274,7 +274,7 @@ void copy_from_user_page(struct vm_area_struct *vma, struct page *page, | |||
274 | void flush_anon_page(struct vm_area_struct *vma, | 274 | void flush_anon_page(struct vm_area_struct *vma, |
275 | struct page *page, unsigned long vaddr) | 275 | struct page *page, unsigned long vaddr) |
276 | { | 276 | { |
277 | unsigned long flags; | 277 | unsigned long kaddr, flags, ktmp; |
278 | if (!PageAnon(page)) | 278 | if (!PageAnon(page)) |
279 | return; | 279 | return; |
280 | 280 | ||
@@ -284,7 +284,12 @@ void flush_anon_page(struct vm_area_struct *vma, | |||
284 | local_irq_save(flags); | 284 | local_irq_save(flags); |
285 | if (vma->vm_flags & VM_EXEC) | 285 | if (vma->vm_flags & VM_EXEC) |
286 | cpu_icache_inval_page(vaddr & PAGE_MASK); | 286 | cpu_icache_inval_page(vaddr & PAGE_MASK); |
287 | cpu_dcache_wbinval_page((unsigned long)page_address(page)); | 287 | kaddr = (unsigned long)page_address(page); |
288 | if (aliasing(vaddr, kaddr)) { | ||
289 | ktmp = kremap0(vaddr, page_to_phys(page)); | ||
290 | cpu_dcache_wbinval_page(ktmp); | ||
291 | kunmap01(ktmp); | ||
292 | } | ||
288 | local_irq_restore(flags); | 293 | local_irq_restore(flags); |
289 | } | 294 | } |
290 | 295 | ||