提交 f4281bba 编写于 作者: P Paul Burton 提交者: Ralf Baechle

MIPS: Handle highmem pages in __update_cache

The following patch will expose __update_cache to highmem pages. Handle
them by mapping them in for the duration of the cache maintenance, just
like in __flush_dcache_page. The code for that isn't shared because we
need the page address in __update_cache so sharing became messy. Given
that the entirity is an extra 5 lines, just duplicate it.
Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
Cc: Lars Persson <lars.persson@axis.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jerome Marchand <jmarchan@redhat.com>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Cc: stable <stable@vger.kernel.org> # v4.1+
Patchwork: https://patchwork.linux-mips.org/patch/12721/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
上级 234859e4
...@@ -149,9 +149,17 @@ void __update_cache(struct vm_area_struct *vma, unsigned long address, ...@@ -149,9 +149,17 @@ void __update_cache(struct vm_area_struct *vma, unsigned long address,
return; return;
page = pfn_to_page(pfn); page = pfn_to_page(pfn);
if (page_mapping(page) && Page_dcache_dirty(page)) { if (page_mapping(page) && Page_dcache_dirty(page)) {
addr = (unsigned long) page_address(page); if (PageHighMem(page))
addr = (unsigned long)kmap_atomic(page);
else
addr = (unsigned long)page_address(page);
if (exec || pages_do_alias(addr, address & PAGE_MASK)) if (exec || pages_do_alias(addr, address & PAGE_MASK))
flush_data_cache_page(addr); flush_data_cache_page(addr);
if (PageHighMem(page))
__kunmap_atomic((void *)addr);
ClearPageDcacheDirty(page); ClearPageDcacheDirty(page);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册