Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm In idcache_wbinv_range if the range size is big...



details:   https://anonhg.NetBSD.org/src/rev/f245b9589402
branches:  trunk
changeset: 825375:f245b9589402
user:      skrll <skrll%NetBSD.org@localhost>
date:      Wed Jul 12 07:22:31 2017 +0000

description:
In idcache_wbinv_range if the range size is bigger than the dcache size
then call idcache_wbinv_all

Avoids a problem with large ranges as seen in
port-evbarm/52169: setting dtrace module to load cause Pi to hang on boot

diffstat:

 sys/arch/arm/arm/cpufunc_asm_arm11x6.S |  12 ++++++++++--
 sys/arch/arm/arm32/genassym.cf         |   5 ++++-
 2 files changed, 14 insertions(+), 3 deletions(-)

diffs (53 lines):

diff -r c6dc5aa3681d -r f245b9589402 sys/arch/arm/arm/cpufunc_asm_arm11x6.S
--- a/sys/arch/arm/arm/cpufunc_asm_arm11x6.S    Wed Jul 12 07:18:40 2017 +0000
+++ b/sys/arch/arm/arm/cpufunc_asm_arm11x6.S    Wed Jul 12 07:22:31 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpufunc_asm_arm11x6.S,v 1.7 2014/07/30 13:31:17 skrll Exp $    */
+/*     $NetBSD: cpufunc_asm_arm11x6.S,v 1.8 2017/07/12 07:22:31 skrll Exp $    */
 
 /*
  * Copyright (c) 2007 Microsoft
@@ -63,7 +63,7 @@
 #include <machine/asm.h>
 #include <arm/locore.h>
 
-RCSID("$NetBSD: cpufunc_asm_arm11x6.S,v 1.7 2014/07/30 13:31:17 skrll Exp $")
+RCSID("$NetBSD: cpufunc_asm_arm11x6.S,v 1.8 2017/07/12 07:22:31 skrll Exp $")
 
 #if 0
 #define Invalidate_I_cache(Rtmp1, Rtmp2) \
@@ -164,6 +164,11 @@
 END(arm11x6_icache_sync_range)
 
 ENTRY_NP(arm11x6_idcache_wbinv_range)
+       ldr     r2, .Larm_pcache
+       ldr     r2, [r2, #DCACHE_SIZE]
+       cmp     r1, r2
+       bge     arm11x6_idcache_wbinv_all
+
        add     r1, r1, r0
        sub     r1, r1, #1
        /* Erratum ARM1136 371025, workaround #2 */
@@ -212,3 +217,6 @@
        bne     1b
        RET
 END(arm11x6_sleep)
+
+.Larm_pcache:
+       .word arm_pcache
diff -r c6dc5aa3681d -r f245b9589402 sys/arch/arm/arm32/genassym.cf
--- a/sys/arch/arm/arm32/genassym.cf    Wed Jul 12 07:18:40 2017 +0000
+++ b/sys/arch/arm/arm32/genassym.cf    Wed Jul 12 07:22:31 2017 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: genassym.cf,v 1.74 2015/06/09 08:09:24 skrll Exp $
+#      $NetBSD: genassym.cf,v 1.75 2017/07/12 07:22:31 skrll Exp $
 
 # Copyright (c) 1982, 1990 The Regents of the University of California.
 # All rights reserved.
@@ -251,3 +251,6 @@
 define M_NEXT                          offsetof(struct mbuf, m_next)
 define IP_SRC                          offsetof(struct ip, ip_src)
 define IP_DST                          offsetof(struct ip, ip_dst)
+
+# Cache information
+define DCACHE_SIZE             offsetof(struct arm_cache_info, dcache_size)



Home | Main Index | Thread Index | Old Index