From: Catalin Marinas Date: Tue, 24 Nov 2009 17:54:07 +0000 (+0100) Subject: ARM: 5794/1: Flush the D-cache during copy_user_highpage() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=115b22474eb1905da2f606a057da3455833333d3;p=mv-sheeva.git ARM: 5794/1: Flush the D-cache during copy_user_highpage() The I and D caches for copy-on-write pages on processors with write-allocate caches become incoherent causing problems on application relying on CoW for text pages (dynamic linker relocating symbols in a text page). This patch flushes the D-cache for such pages. Cc: Nicolas Pitre Signed-off-by: Catalin Marinas Signed-off-by: Russell King --- diff --git a/arch/arm/mm/copypage-v6.c b/arch/arm/mm/copypage-v6.c index 4127a7bddfe..841f355319b 100644 --- a/arch/arm/mm/copypage-v6.c +++ b/arch/arm/mm/copypage-v6.c @@ -41,6 +41,14 @@ static void v6_copy_user_highpage_nonaliasing(struct page *to, kfrom = kmap_atomic(from, KM_USER0); kto = kmap_atomic(to, KM_USER1); copy_page(kto, kfrom); +#ifdef CONFIG_HIGHMEM + /* + * kmap_atomic() doesn't set the page virtual address, and + * kunmap_atomic() takes care of cache flushing already. + */ + if (page_address(to) != NULL) +#endif + __cpuc_flush_dcache_page(kto); kunmap_atomic(kto, KM_USER1); kunmap_atomic(kfrom, KM_USER0); }