diff options
author | Vineet Gupta <vgupta@synopsys.com> | 2015-03-05 14:36:31 +0300 |
---|---|---|
committer | Vineet Gupta <vgupta@synopsys.com> | 2015-10-28 17:01:05 +0300 |
commit | 336e2136e1353db8e9e731c27381ee0735656a8a (patch) | |
tree | e386405627b5e1f68f04a1d4f854f3121b913d45 /arch/arc/mm/cache.c | |
parent | d40846457fc23cd841a60fdc2786e08a8bedb35b (diff) | |
download | linux-336e2136e1353db8e9e731c27381ee0735656a8a.tar.xz |
ARC: mm: preps ahead of HIGHMEM support
Before we plug in highmem support, some of code needs to be ready for it
- copy_user_highpage() needs to be using the kmap_atomic API
- mk_pte() can't assume page_address()
- do_page_fault() can't assume VMALLOC_END is end of kernel vaddr space
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Diffstat (limited to 'arch/arc/mm/cache.c')
-rw-r--r-- | arch/arc/mm/cache.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/arch/arc/mm/cache.c b/arch/arc/mm/cache.c index ae3b772ecc4d..521fb2bf90bd 100644 --- a/arch/arc/mm/cache.c +++ b/arch/arc/mm/cache.c @@ -806,8 +806,8 @@ void flush_anon_page(struct vm_area_struct *vma, struct page *page, void copy_user_highpage(struct page *to, struct page *from, unsigned long u_vaddr, struct vm_area_struct *vma) { - unsigned long kfrom = (unsigned long)page_address(from); - unsigned long kto = (unsigned long)page_address(to); + void *kfrom = kmap_atomic(from); + void *kto = kmap_atomic(to); int clean_src_k_mappings = 0; /* @@ -817,13 +817,16 @@ void copy_user_highpage(struct page *to, struct page *from, * * Note that while @u_vaddr refers to DST page's userspace vaddr, it is * equally valid for SRC page as well + * + * For !VIPT cache, all of this gets compiled out as + * addr_not_cache_congruent() is 0 */ if (page_mapped(from) && addr_not_cache_congruent(kfrom, u_vaddr)) { - __flush_dcache_page(kfrom, u_vaddr); + __flush_dcache_page((unsigned long)kfrom, u_vaddr); clean_src_k_mappings = 1; } - copy_page((void *)kto, (void *)kfrom); + copy_page(kto, kfrom); /* * Mark DST page K-mapping as dirty for a later finalization by @@ -840,11 +843,14 @@ void copy_user_highpage(struct page *to, struct page *from, * sync the kernel mapping back to physical page */ if (clean_src_k_mappings) { - __flush_dcache_page(kfrom, kfrom); + __flush_dcache_page((unsigned long)kfrom, (unsigned long)kfrom); set_bit(PG_dc_clean, &from->flags); } else { clear_bit(PG_dc_clean, &from->flags); } + + kunmap_atomic(kto); + kunmap_atomic(kfrom); } void clear_user_page(void *to, unsigned long u_vaddr, struct page *page) |