Skip to contentSkip to conversation

arm: fix flush_pfn_alias

PATCH RESEND New Jungseung Lee 1 participant 1 message Nov 20, 2014 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 arm: fix flush_pfn_alias

L1_CACHE_BYTES could be larger 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/flush.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mm/flush.c +1 -1
index 265b836..34b66af 100644
@@ -33,7 +33,7 @@ static void flush_pfn_alias(unsigned long pfn, unsigned long vaddr)
 	asm(	"mcrr	p15, 0, %1, %0, c14\n"
 	"	mcr	p15, 0, %2, c7, c10, 4"
 	    :
-	    : "r" (to), "r" (to + PAGE_SIZE - L1_CACHE_BYTES), "r" (zero)
+	    : "r" (to), "r" (to + PAGE_SIZE - 1), "r" (zero)
 	    : "cc");
 }
 
Signature · 1 line
1.9.1