summaryrefslogtreecommitdiffstats
path: root/arch/arm/mm/copypage-v4mc.c
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@rpsys.net>2006-12-30 16:08:50 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2006-12-30 17:05:08 +0000
commit1c9d3df5e88ad7db23f5b22f4341c39722a904a4 (patch)
treedbabefd52a5f8a5f35216bda33f29e4b9b398569 /arch/arm/mm/copypage-v4mc.c
parentb0b1d60a64054697ef828e0565f006cc0f823590 (diff)
downloadlinux-1c9d3df5e88ad7db23f5b22f4341c39722a904a4.tar.bz2
[ARM] 4078/1: Fix ARM copypage cache coherency problems
If PG_dcache_dirty is set for a page, we need to flush the source page before performing any copypage operation using a different virtual address. This fixes the copypage implementations for XScale, StrongARM and ARMv6. This patch fixes segmentation faults seen in the dynamic linker under the usage patterns in glibc 2.4/2.5. Signed-off-by: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mm/copypage-v4mc.c')
-rw-r--r--arch/arm/mm/copypage-v4mc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/arm/mm/copypage-v4mc.c b/arch/arm/mm/copypage-v4mc.c
index 408b05ae6b9b..ded0e96d069d 100644
--- a/arch/arm/mm/copypage-v4mc.c
+++ b/arch/arm/mm/copypage-v4mc.c
@@ -19,6 +19,7 @@
#include <asm/page.h>
#include <asm/pgtable.h>
#include <asm/tlbflush.h>
+#include <asm/cacheflush.h>
#include "mm.h"
@@ -69,6 +70,11 @@ mc_copy_user_page(void *from, void *to)
void v4_mc_copy_user_page(void *kto, const void *kfrom, unsigned long vaddr)
{
+ struct page *page = virt_to_page(kfrom);
+
+ if (test_and_clear_bit(PG_dcache_dirty, &page->flags))
+ __flush_dcache_page(page_mapping(page), page);
+
spin_lock(&minicache_lock);
set_pte_ext(TOP_PTE(0xffff8000), pfn_pte(__pa(kfrom) >> PAGE_SHIFT, minicache_pgprot), 0);