Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/arm Ensure stores are observed before the 'sev'...



details:   https://anonhg.NetBSD.org/src/rev/e6f8359decbb
branches:  trunk
changeset: 946542:e6f8359decbb
user:      skrll <skrll%NetBSD.org@localhost>
date:      Mon Nov 30 21:06:56 2020 +0000

description:
Ensure stores are observed before the 'sev' instructions.

diffstat:

 sys/arch/arm/arm/cpu_subr.c |  12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diffs (46 lines):

diff -r b642adc07b60 -r e6f8359decbb sys/arch/arm/arm/cpu_subr.c
--- a/sys/arch/arm/arm/cpu_subr.c       Mon Nov 30 20:25:37 2020 +0000
+++ b/sys/arch/arm/arm/cpu_subr.c       Mon Nov 30 21:06:56 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu_subr.c,v 1.1 2020/02/15 08:16:10 skrll Exp $       */
+/*     $NetBSD: cpu_subr.c,v 1.2 2020/11/30 21:06:56 skrll Exp $       */
 
 /*-
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -33,13 +33,15 @@
 #include "opt_multiprocessor.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.1 2020/02/15 08:16:10 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.2 2020/11/30 21:06:56 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
 #include <sys/cpu.h>
 #include <sys/reboot.h>
 
+#include <arm/cpufunc.h>
+
 #ifdef VERBOSE_INIT_ARM
 #define VPRINTF(...)   printf(__VA_ARGS__)
 #else
@@ -86,7 +88,8 @@
        for (size_t n = 0; n < __arraycount(arm_cpu_mbox); n++)
                atomic_or_ulong(&arm_cpu_mbox[n], arm_cpu_hatched[n]);
 
-       __asm __volatile ("sev; sev; sev");
+       dsb(ishst);
+       __asm __volatile ("sev");
 
        /* wait all cpus have done cpu_hatch() */
        for (cpuno = 1; cpuno < ncpu; cpuno++) {
@@ -136,7 +139,8 @@
        /* Notify cpu_boot_secondary_processors that we're done */
        atomic_and_ulong(&arm_cpu_mbox[off], ~bit);
        membar_producer();
-       __asm __volatile("sev; sev; sev");
+       dsb(ishst);
+       __asm __volatile("sev");
 }
 
 #endif



Home | Main Index | Thread Index | Old Index