Skip to contentSkip to conversation

Flush the D-cache during copy_user_highpage()

PATCH New Catalin Marinas 2 participants 6 messages Nov 24, 2009 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/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 Russell King - ARM Linux <[email protected]>
Cc Nicolas Pitre <[email protected]>
---
 arch/arm/mm/copypage-v6.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
arch/arm/mm/copypage-v6.c +8 -0
index 4127a7b..841f355 100644
@@ -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);
 }
#1 lore raw

PATCH 1/1 Flush the D-cache during copy_user_highpage()

Quoted 4 lines · Catalin Marinas

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.

Don't we need to do this on ARMv7 as well?

#2 lore raw

PATCH 1/1 Flush the D-cache during copy_user_highpage()

Quoted 7 lines · Russell King - ARM Linux
Quoted 4 lines · Catalin Marinas

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.

Don't we need to do this on ARMv7 as well?

Do you mean an improvement to the patch description?

Signature · 1 line
Catalin
#3 lore raw

PATCH 1/1 Flush the D-cache during copy_user_highpage()

Quoted 10 lines · Catalin Marinas
Quoted 7 lines · Russell King - ARM Linux
Quoted 4 lines · Catalin Marinas

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.

Don't we need to do this on ARMv7 as well?

Do you mean an improvement to the patch description?

Don't worry, I'm being silly - there isn't an ARMv7 version of the copy page functions. Your patch is fine.

#4 lore raw

PATCH 1/1 Flush the D-cache during copy_user_highpage()

Quoted 8 lines · Russell King - ARM Linux
Quoted 7 lines · Catalin Marinas
Quoted 6 lines · Russell King - ARM Linux
Quoted 4 lines · Catalin Marinas

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.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Don't we need to do this on ARMv7 as well?

Do you mean an improvement to the patch description?

Don't worry, I'm being silly - there isn't an ARMv7 version of the copy page functions. Your patch is fine.

So, do you want a pull request, send it to the patch system or you just pick it up from the list?

Signature · 1 line
Catalin
#5 lore raw

PATCH 1/1 Flush the D-cache during copy_user_highpage()

Quoted 11 lines · Catalin Marinas
Quoted 10 lines · Russell King - ARM Linux
Quoted 9 lines · Catalin Marinas
Quoted 7 lines · Russell King - ARM Linux
Quoted 4 lines · Catalin Marinas

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.

Don't we need to do this on ARMv7 as well?

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Do you mean an improvement to the patch description?

Don't worry, I'm being silly - there isn't an ARMv7 version of the copy page functions. Your patch is fine.

So, do you want a pull request, send it to the patch system or you just pick it up from the list?

Patch system please.