Commit 5b9f9569 authored by Vincent Chen's avatar Vincent Chen Committed by Greentime Hu

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: default avatarVincent Chen <vincentc@andestech.com>
Reviewed-by: default avatarGreentime Hu <greentime@andestech.com>
Signed-off-by: default avatarGreentime Hu <greentime@andestech.com>
parent efcc4ea8
...@@ -274,7 +274,7 @@ void copy_from_user_page(struct vm_area_struct *vma, struct page *page, ...@@ -274,7 +274,7 @@ void copy_from_user_page(struct vm_area_struct *vma, struct page *page,
void flush_anon_page(struct vm_area_struct *vma, void flush_anon_page(struct vm_area_struct *vma,
struct page *page, unsigned long vaddr) struct page *page, unsigned long vaddr)
{ {
unsigned long flags; unsigned long kaddr, flags, ktmp;
if (!PageAnon(page)) if (!PageAnon(page))
return; return;
...@@ -284,7 +284,12 @@ void flush_anon_page(struct vm_area_struct *vma, ...@@ -284,7 +284,12 @@ void flush_anon_page(struct vm_area_struct *vma,
local_irq_save(flags); local_irq_save(flags);
if (vma->vm_flags & VM_EXEC) if (vma->vm_flags & VM_EXEC)
cpu_icache_inval_page(vaddr & PAGE_MASK); cpu_icache_inval_page(vaddr & PAGE_MASK);
cpu_dcache_wbinval_page((unsigned long)page_address(page)); kaddr = (unsigned long)page_address(page);
if (aliasing(vaddr, kaddr)) {
ktmp = kremap0(vaddr, page_to_phys(page));
cpu_dcache_wbinval_page(ktmp);
kunmap01(ktmp);
}
local_irq_restore(flags); local_irq_restore(flags);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment