Skip to contentSkip to conversation

ARM: mm: fix discard_old_kernel_data

PATCH New Jungseung Lee 1 participant 1 message Oct 21, 2014 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: mm: fix discard_old_kernel_data

L1_CACHE_BYTES could be larger value than real L1 cache line size. In that case, flush_pfn_alias function would omit to flush last bytes as much as L1_CACHE_BYTES - real cache line size.

So fix end address to "to + PAGE_SIZE -1". The bottom bits of the address is LINELEN. that is ignored by mcrr.

---
 arch/arm/mm/copypage-v6.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mm/copypage-v6.c +1 -1
index b9bcc9d..7042334 100644
@@ -62,7 +62,7 @@ static void discard_old_kernel_data(void *kto)
 	__asm__("mcrr	p15, 0, %1, %0, c6	@ 0xec401f06"
 	   :
 	   : "r" (kto),
-	     "r" ((unsigned long)kto + PAGE_SIZE - L1_CACHE_BYTES)
+	     "r" ((unsigned long)kto + PAGE_SIZE - 1)
 	   : "cc");
 }
 
Signature · 1 line
1.9.1