Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Flush the BP cache just before starting APs so that...



details:   https://anonhg.NetBSD.org/src/rev/ec8fd8c7d8e1
branches:  trunk
changeset: 997611:ec8fd8c7d8e1
user:      skrll <skrll%NetBSD.org@localhost>
date:      Sat Mar 16 10:05:40 2019 +0000

description:
Flush the BP cache just before starting APs so that cache coherency starts
with a correct view.

diffstat:

 sys/arch/arm/arm32/arm32_boot.c               |  10 ++++++++--
 sys/arch/evbarm/fdt/fdt_machdep.c             |   7 +++++--
 sys/arch/evbarm/nitrogen6/nitrogen6_machdep.c |   7 +++++--
 sys/arch/evbarm/zynq/zynq_machdep.c           |   7 +++++--
 4 files changed, 23 insertions(+), 8 deletions(-)

diffs (115 lines):

diff -r aa6041b74d14 -r ec8fd8c7d8e1 sys/arch/arm/arm32/arm32_boot.c
--- a/sys/arch/arm/arm32/arm32_boot.c   Sat Mar 16 08:03:03 2019 +0000
+++ b/sys/arch/arm/arm32/arm32_boot.c   Sat Mar 16 10:05:40 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: arm32_boot.c,v 1.32 2019/01/27 02:08:37 pgoyette Exp $ */
+/*     $NetBSD: arm32_boot.c,v 1.33 2019/03/16 10:05:40 skrll Exp $    */
 
 /*
  * Copyright (c) 2002, 2003, 2005  Genetec Corporation.  All rights reserved.
@@ -122,7 +122,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: arm32_boot.c,v 1.32 2019/01/27 02:08:37 pgoyette Exp $");
+__KERNEL_RCSID(1, "$NetBSD: arm32_boot.c,v 1.33 2019/03/16 10:05:40 skrll Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_cputypes.h"
@@ -324,6 +324,12 @@
 
 #ifdef MULTIPROCESSOR
        mutex_init(&cpu_hatch_lock, MUTEX_DEFAULT, IPL_NONE);
+
+       /*
+        * Ensure BP cache is flushed to memory so that APs start cache
+        * coherency with correct view.
+        */
+       cpu_dcache_wbinv_all();
 #endif
 
        VPRINTF("done.\n");
diff -r aa6041b74d14 -r ec8fd8c7d8e1 sys/arch/evbarm/fdt/fdt_machdep.c
--- a/sys/arch/evbarm/fdt/fdt_machdep.c Sat Mar 16 08:03:03 2019 +0000
+++ b/sys/arch/evbarm/fdt/fdt_machdep.c Sat Mar 16 10:05:40 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_machdep.c,v 1.58 2019/01/31 13:26:21 skrll Exp $ */
+/* $NetBSD: fdt_machdep.c,v 1.59 2019/03/16 10:05:40 skrll Exp $ */
 
 /*-
  * Copyright (c) 2015-2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.58 2019/01/31 13:26:21 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.59 2019/03/16 10:05:40 skrll Exp $");
 
 #include "opt_machdep.h"
 #include "opt_bootconfig.h"
@@ -545,6 +545,9 @@
        u_int sp = initarm_common(KERNEL_VM_BASE, KERNEL_VM_SIZE, fdt_physmem,
             nfdt_physmem);
 
+       /*
+        * initarm_commmon flushes cache if required before AP start
+        */
        error = 0;
        if ((boothowto & RB_MD1) == 0) {
                VPRINTF("mpstart\n");
diff -r aa6041b74d14 -r ec8fd8c7d8e1 sys/arch/evbarm/nitrogen6/nitrogen6_machdep.c
--- a/sys/arch/evbarm/nitrogen6/nitrogen6_machdep.c     Sat Mar 16 08:03:03 2019 +0000
+++ b/sys/arch/evbarm/nitrogen6/nitrogen6_machdep.c     Sat Mar 16 10:05:40 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nitrogen6_machdep.c,v 1.15 2019/01/21 07:46:40 skrll Exp $     */
+/*     $NetBSD: nitrogen6_machdep.c,v 1.16 2019/03/16 10:05:40 skrll Exp $     */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nitrogen6_machdep.c,v 1.15 2019/01/21 07:46:40 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nitrogen6_machdep.c,v 1.16 2019/03/16 10:05:40 skrll Exp $");
 
 #include "opt_evbarm_boardtype.h"
 #include "opt_arm_debug.h"
@@ -386,6 +386,9 @@
 #endif
        u_int sp = initarm_common(KERNEL_VM_BASE, KERNEL_VM_SIZE, bp, nbp);
 
+       /*
+        * initarm_commmon flushes cache if required before AP start
+        */
        VPRINTF("mpstart\n");
        nitrogen6_mpstart();
 
diff -r aa6041b74d14 -r ec8fd8c7d8e1 sys/arch/evbarm/zynq/zynq_machdep.c
--- a/sys/arch/evbarm/zynq/zynq_machdep.c       Sat Mar 16 08:03:03 2019 +0000
+++ b/sys/arch/evbarm/zynq/zynq_machdep.c       Sat Mar 16 10:05:40 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: zynq_machdep.c,v 1.8 2019/01/31 13:06:10 skrll Exp $   */
+/*     $NetBSD: zynq_machdep.c,v 1.9 2019/03/16 10:05:40 skrll Exp $   */
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: zynq_machdep.c,v 1.8 2019/01/31 13:06:10 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zynq_machdep.c,v 1.9 2019/03/16 10:05:40 skrll Exp $");
 
 #include "opt_evbarm_boardtype.h"
 #include "opt_arm_debug.h"
@@ -340,6 +340,9 @@
 
        u_int sp = initarm_common(KERNEL_VM_BASE, KERNEL_VM_SIZE, NULL, 0);
 
+       /*
+        * initarm_commmon flushes cache if required before AP start
+        */
        VPRINTF("mpstart\n");
        zynq_mpstart();
 



Home | Main Index | Thread Index | Old Index