Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 May 2023 09:57:56 -0500
From:      Kyle Evans <kevans@freebsd.org>
To:        Jessica Clarke <jrtc27@freebsd.org>
Cc:        "src-committers@freebsd.org" <src-committers@freebsd.org>,  "dev-commits-src-all@freebsd.org" <dev-commits-src-all@freebsd.org>,  "dev-commits-src-main@freebsd.org" <dev-commits-src-main@freebsd.org>
Subject:   Re: git: ccb59683b983 - main - arm64: add tests for swp/swpb emulation
Message-ID:  <CACNAnaHH5nFDYjscZNfJ%2BN72SziAkznW1JrNZnWXv-QPb5TpYg@mail.gmail.com>
In-Reply-To: <663D9FB2-D1EF-4D51-9FB1-038AF6AA98C0@freebsd.org>
References:  <202305151542.34FFgONF071780@gitrepo.freebsd.org> <663D9FB2-D1EF-4D51-9FB1-038AF6AA98C0@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, May 15, 2023 at 5:00=E2=80=AFPM Jessica Clarke <jrtc27@freebsd.org>=
 wrote:
>
> On 15 May 2023, at 16:42, Kyle Evans <kevans@FreeBSD.org> wrote:
> >
> > The branch main has been updated by kevans:
> >
> > URL: https://cgit.FreeBSD.org/src/commit/?id=3Dccb59683b98360afaf5b5bb6=
41a68fea22c68d0b
> >
> > commit ccb59683b98360afaf5b5bb641a68fea22c68d0b
> > Author:     Kyle Evans <kevans@FreeBSD.org>
> > AuthorDate: 2023-05-15 15:42:16 +0000
> > Commit:     Kyle Evans <kevans@FreeBSD.org>
> > CommitDate: 2023-05-15 15:42:16 +0000
> >
> >    arm64: add tests for swp/swpb emulation
> >
> >    One test is suitable to be hooked up to the build, so I've done this
> >    here.  The other test lives in tools/regression because failure is a
> >    bit more subjective -- generally, one runs it for some unbounded amo=
unt
> >    of time and observe if it eventually exits because two threads acqui=
red
> >    the same mutex.
> >
> >    Reviewed by:    imp, mmel
> >    Sponsored by:   Stormshield
> >    Sponsored by:   Klara, Inc.
> >    Differential Revision:  https://reviews.freebsd.org/D39668
> > ---
> > etc/mtree/BSD.tests.dist                          |   2 +
> > tests/sys/Makefile                                |   1 +
> > tests/sys/compat32/Makefile                       |   6 +
> > tests/sys/compat32/Makefile.inc                   |   4 +
> > tests/sys/compat32/aarch64/Makefile               |  24 ++
> > tests/sys/compat32/aarch64/common.sh              |   9 +
> > tests/sys/compat32/aarch64/swp_cond_test.sh       |  14 +
> > tests/sys/compat32/aarch64/swp_cond_test_impl.S   | 413 +++++++++++++++=
+++++++
> > tests/sys/compat32/aarch64/swp_test.sh            |  14 +
> > tests/sys/compat32/aarch64/swp_test_impl.S        | 216 +++++++++++
> > tools/regression/compat32/aarch64/Makefile        |   4 +
> > tools/regression/compat32/aarch64/swp_test_impl.S | 410 +++++++++++++++=
++++++
> > 12 files changed, 1117 insertions(+)
> >
> > ...
> > diff --git a/tests/sys/compat32/aarch64/Makefile b/tests/sys/compat32/a=
arch64/Makefile
> > new file mode 100644
> > index 000000000000..716182b15d9c
> > --- /dev/null
> > +++ b/tests/sys/compat32/aarch64/Makefile
> > @@ -0,0 +1,24 @@
> > +PACKAGE=3D tests
> > +FILESGROUPS+=3D asmprogs
> > +
> > +ACFLAGS=3D -target armv7-unknown-freebsd${OS_REVISION} -nostdlib -Wl,-=
e -Wl,main -static
>
> This won=E2=80=99t work with GCC, nor will it work with an LLVM built wit=
h only
> AArch64 enabled as a target (e.g. -DWITHOUT_LLVM_TARGET_ALL
> -DWITHOUT_LLVM_TARGET_ARM; latter is needed since we do default to
> enabling ARM if AArch64 is even for a cut-down toolchain so that -m32
> works). This is why the freebsd32 sigcode in arm64 kernels is written
> as hex (with disassembly comments) rather than assembled from proper
> source.
>

Hi,

Just dropping a note that I have still been thinking about this one.
It's half tempting to leave the build infrastructure for the impl
binaries in place (+ fixed for GCC, just to be flexible), but
disconnected with the expectation that the result gets committed
rather than run as part of the build. That's a bit gross, but getting
hex with disassembly comments somewhere in such a way that we can exec
it properly as a 32-bit arm image is also a bit gross.

Thanks,

Kyle Evans



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACNAnaHH5nFDYjscZNfJ%2BN72SziAkznW1JrNZnWXv-QPb5TpYg>