diff options
author | Paul Mundt <lethal@linux-sh.org> | 2009-08-04 16:02:43 +0900 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-08-04 16:02:43 +0900 |
commit | c0fe478dbb14fd32e71d1383dbe302b54ce94134 (patch) | |
tree | 65bf8762df2a02d01a7f1326c67c078a98c51c39 /arch/sh/mm | |
parent | b5eb10ae901fa797c19accb684825f0e36ecbe0f (diff) |
sh: Provide __flush_anon_page().
This provides a __flush_anon_page() that handles both the aliasing and
non-aliasing cases. This fixes up some crashes with heavy
get_user_pages() users.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/mm')
-rw-r--r-- | arch/sh/mm/pg-mmu.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/sh/mm/pg-mmu.c b/arch/sh/mm/pg-mmu.c index a9ede7bae52..027c4d83fb8 100644 --- a/arch/sh/mm/pg-mmu.c +++ b/arch/sh/mm/pg-mmu.c @@ -157,3 +157,20 @@ void __update_cache(struct vm_area_struct *vma, } } } + +void __flush_anon_page(struct page *page, unsigned long vmaddr) +{ + unsigned long addr = (unsigned long) page_address(page); + + if (pages_do_alias(addr, vmaddr)) { + if (boot_cpu_data.dcache.n_aliases && page_mapped(page) && + !test_bit(PG_dcache_dirty, &page->flags)) { + void *kaddr; + + kaddr = kmap_coherent(page, vmaddr); + __flush_wback_region((void *)kaddr, PAGE_SIZE); + kunmap_coherent(); + } else + __flush_wback_region((void *)addr, PAGE_SIZE); + } +} |