Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Sep 2017 03:43:22 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 222234] head -r323246 aarch64 (Pine64+ 2GB) boot time context, sometimes: acquiring blockable sleep lock with spinlock or critical section held
Message-ID:  <bug-222234-8-n3bD75RZFM@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-222234-8@https.bugs.freebsd.org/bugzilla/>
References:  <bug-222234-8@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D222234

--- Comment #4 from Mark Millard <markmi@dsl-only.net> ---
(In reply to Mark Millard from comment #2)

There appears to be another potential
example of the lack of dsb before sev
for aarch64:

identcpu.c has:

void
identify_cpu(void)
{
. . .
        if (cpu !=3D 0) {
                /*
                 * This code must run on one cpu at a time, but we are
                 * not scheduling on the current core so implement a
                 * simple spinlock.
                 */
                while (atomic_cmpset_acq_int(&ident_lock, 0, 1) =3D=3D 0)
                        __asm __volatile("wfe" ::: "memory");
. . .
                /* Wake up the other CPUs */
                atomic_store_rel_int(&ident_lock, 0);
                __asm __volatile("sev" ::: "memory");
        }
}

vs. as shown in the patch for release_aps :

# svnlite diff /usr/src/sys/arm64/arm64/mp_machdep.c=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20
                           Index: /usr/src/sys/arm64/arm64/mp_machdep.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- /usr/src/sys/arm64/arm64/mp_machdep.c       (revision 323246)
+++ /usr/src/sys/arm64/arm64/mp_machdep.c       (working copy)
@@ -236,7 +236,9 @@

        atomic_store_rel_int(&aps_ready, 1);
        /* Wake up the other CPUs */
-       __asm __volatile("sev");
+       __asm __volatile(
+           "dsb  ish   \n"
+           "sev        \n");

        printf("Release APs\n");


One difference vs. the origin release_aps
text is the notation:

 ::: "memory"

in identify_cpu . I'm not expert in the relevant
notation and its usage/intent.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-222234-8-n3bD75RZFM>