All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH for post 6.0 v1 00/25] testing/next (hexagon/tricore/test cc)
@ 2021-04-19 14:54 Alex Bennée
  2021-04-19 14:54 ` [PATCH v1 01/25] checkpatch: Fix use of uninitialized value Alex Bennée
                   ` (25 more replies)
  0 siblings, 26 replies; 47+ messages in thread
From: Alex Bennée @ 2021-04-19 14:54 UTC (permalink / raw)
  To: qemu-devel
  Cc: fam, berrange, f4bug, stefanha, crosa, pbonzini,
	Alex Bennée, aurelien

Hi,

This is the current state of my testing tree in preparation for the
opening of the flood gates once 6.0 is out of the door. It includes
fixes for 3 areas:

  - updates to the docker scripting to support pre-built images,
    specifically for hexagon

  - some tweaks to tcg/configure.sh to deal with disabling local
    compiler usage.

  - a series of patches adding support for Tricore TCG tests

I'm also carrying Greg's tweak to checkpatch. Currently the following
have not got reviews:
  
 - tests/tcg: don't iterate through other arch compilers
 - docker: Add Hexagon image
 - tests/docker: add "fetch" sub-command
 - tests/docker: allow "update" to add the current user
 - tests/docker: make executable an optional argument to "update"
 - tests/docker: fix copying of executable in "update"

Alessandro Di Federico (2):
  docker: Add Hexagon image
  tests/tcg: Use Hexagon Docker image

Alex Bennée (6):
  tests/docker: fix copying of executable in "update"
  tests/docker: make executable an optional argument to "update"
  tests/docker: allow "update" to add the current user
  tests/docker: add "fetch" sub-command
  gitlab: add build-user-hexagon test
  tests/tcg: don't iterate through other arch compilers

Andrew Melnychenko (1):
  tests/docker: Added libbpf library to the docker files.

Bastian Koppelmann (15):
  tests/tcg: Add docker_as and docker_ld cmds
  tests/tcg: Run timeout cmds using --foreground
  hw/tricore: Add testdevice for tests in tests/tcg/
  tests/tcg/tricore: Add build infrastructure
  configure: Emit HOST_CC to config-host.mak
  tests/tcg/tricore: Add macros to create tests and first test 'abs'
  tests/tcg/tricore: Add bmerge test
  tests/tcg/tricore: Add clz test
  tests/tcg/tricore: Add dvstep test
  tests/tcg/tricore: Add fadd test
  tests/tcg/tricore: Add fmul test
  tests/tcg/tricore: Add ftoi test
  tests/tcg/tricore: Add madd test
  tests/tcg/tricore: Add msub test
  tests/tcg/tricore: Add muls test

Greg Kurz (1):
  checkpatch: Fix use of uninitialized value

 configure                                     |   1 +
 include/hw/tricore/tricore_testdevice.h       |  38 ++++
 tests/tcg/tricore/macros.h                    | 129 +++++++++++++
 hw/tricore/tricore_testboard.c                |   8 +
 hw/tricore/tricore_testdevice.c               |  82 ++++++++
 .gitlab-ci.yml                                |  11 ++
 MAINTAINERS                                   |   3 +
 hw/tricore/meson.build                        |   1 +
 scripts/checkpatch.pl                         |   1 +
 tests/docker/Makefile.include                 |  24 ++-
 tests/docker/docker.py                        |  78 +++++---
 tests/docker/dockerfiles/alpine.docker        |   1 +
 tests/docker/dockerfiles/centos8.docker       |   1 +
 .../dockerfiles/debian-hexagon-cross.docker   |  44 +++++
 .../build-toolchain.sh                        | 141 ++++++++++++++
 tests/docker/dockerfiles/fedora.docker        |   1 +
 tests/tcg/Makefile.qemu                       |  15 ++
 tests/tcg/Makefile.target                     |   5 +-
 tests/tcg/configure.sh                        | 175 +++++++++---------
 tests/tcg/tricore/Makefile.softmmu-target     |  26 +++
 .../tcg/tricore/Makefile.softmmu-target.orig  |  25 +++
 tests/tcg/tricore/link.ld                     |  60 ++++++
 tests/tcg/tricore/test_abs.S                  |   7 +
 tests/tcg/tricore/test_bmerge.S               |   8 +
 tests/tcg/tricore/test_clz.S                  |   9 +
 tests/tcg/tricore/test_dvstep.S               |  15 ++
 tests/tcg/tricore/test_fadd.S                 |  16 ++
 tests/tcg/tricore/test_fmul.S                 |   8 +
 tests/tcg/tricore/test_ftoi.S                 |  10 +
 tests/tcg/tricore/test_madd.S                 |  11 ++
 tests/tcg/tricore/test_msub.S                 |   9 +
 tests/tcg/tricore/test_muls.S                 |   9 +
 32 files changed, 858 insertions(+), 114 deletions(-)
 create mode 100644 include/hw/tricore/tricore_testdevice.h
 create mode 100644 tests/tcg/tricore/macros.h
 create mode 100644 hw/tricore/tricore_testdevice.c
 create mode 100644 tests/docker/dockerfiles/debian-hexagon-cross.docker
 create mode 100755 tests/docker/dockerfiles/debian-hexagon-cross.docker.d/build-toolchain.sh
 create mode 100644 tests/tcg/tricore/Makefile.softmmu-target
 create mode 100644 tests/tcg/tricore/Makefile.softmmu-target.orig
 create mode 100644 tests/tcg/tricore/link.ld
 create mode 100644 tests/tcg/tricore/test_abs.S
 create mode 100644 tests/tcg/tricore/test_bmerge.S
 create mode 100644 tests/tcg/tricore/test_clz.S
 create mode 100644 tests/tcg/tricore/test_dvstep.S
 create mode 100644 tests/tcg/tricore/test_fadd.S
 create mode 100644 tests/tcg/tricore/test_fmul.S
 create mode 100644 tests/tcg/tricore/test_ftoi.S
 create mode 100644 tests/tcg/tricore/test_madd.S
 create mode 100644 tests/tcg/tricore/test_msub.S
 create mode 100644 tests/tcg/tricore/test_muls.S

-- 
2.20.1



^ permalink raw reply	[flat|nested] 47+ messages in thread

* [PATCH  v1 01/25] checkpatch: Fix use of uninitialized value
  2021-04-19 14:54 [PATCH for post 6.0 v1 00/25] testing/next (hexagon/tricore/test cc) Alex Bennée
@ 2021-04-19 14:54 ` Alex Bennée
  2021-04-19 14:54 ` [PATCH v1 02/25] tests/docker: fix copying of executable in "update" Alex Bennée
                   ` (24 subsequent siblings)
  25 siblings, 0 replies; 47+ messages in thread
From: Alex Bennée @ 2021-04-19 14:54 UTC (permalink / raw)
  To: qemu-devel
  Cc: fam, Isaku Yamahata, berrange, f4bug, Greg Kurz, stefanha, crosa,
	pbonzini, Alex Bennée, aurelien

From: Greg Kurz <groug@kaod.org>

checkfilename() doesn't always set $acpi_testexpected. Fix the following
warning:

Use of uninitialized value $acpi_testexpected in string eq at
 ./scripts/checkpatch.pl line 1529.

Fixes: d2f1af0e4120 ("checkpatch: don't emit warning on newly created acpi data files")
Signed-off-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Isaku Yamahata <isaku.yamahata@intel.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Cc: isaku.yamahata@intel.com
Message-Id: <20210408164610.14229-1-alex.bennee@linaro.org>
Message-Id: <161786467973.295167.5612704777283969903.stgit@bahia.lan>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 scripts/checkpatch.pl | 1 +
 1 file changed, 1 insertion(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 8f7053ec9b..3d185cceac 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1532,6 +1532,7 @@ sub process {
 		     ($line =~ /\{\s*([\w\/\.\-]*)\s*\=\>\s*([\w\/\.\-]*)\s*\}/ &&
 		      (defined($1) || defined($2)))) &&
                       !(($realfile ne '') &&
+                        defined($acpi_testexpected) &&
                         ($realfile eq $acpi_testexpected))) {
 			$reported_maintainer_file = 1;
 			WARN("added, moved or deleted file(s), does MAINTAINERS need updating?\n" . $herecurr);
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH v1 02/25] tests/docker: fix copying of executable in "update"
  2021-04-19 14:54 [PATCH for post 6.0 v1 00/25] testing/next (hexagon/tricore/test cc) Alex Bennée
  2021-04-19 14:54 ` [PATCH v1 01/25] checkpatch: Fix use of uninitialized value Alex Bennée
@ 2021-04-19 14:54 ` Alex Bennée
  2021-04-23 17:35   ` Willian Rampazzo
  2021-04-19 14:54 ` [PATCH v1 03/25] tests/docker: make executable an optional argument to "update" Alex Bennée
                   ` (23 subsequent siblings)
  25 siblings, 1 reply; 47+ messages in thread
From: Alex Bennée @ 2021-04-19 14:54 UTC (permalink / raw)
  To: qemu-devel
  Cc: fam, Thomas Huth, berrange, f4bug, Wainer dos Santos Moschetta,
	Willian Rampazzo, stefanha, crosa, pbonzini, Alex Bennée,
	aurelien

We have the same symlink chasing problem when doing an "update"
operation. Fix that.

Based-on: 5e33f7fead ("tests/docker: better handle symlinked libs")
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 tests/docker/docker.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/tests/docker/docker.py b/tests/docker/docker.py
index d28df4c140..0435a55d10 100755
--- a/tests/docker/docker.py
+++ b/tests/docker/docker.py
@@ -548,7 +548,14 @@ def run(self, args, argv):
         libs = _get_so_libs(args.executable)
         if libs:
             for l in libs:
-                tmp_tar.add(os.path.realpath(l), arcname=l)
+                so_path = os.path.dirname(l)
+                name = os.path.basename(l)
+                real_l = os.path.realpath(l)
+                try:
+                    tmp_tar.add(real_l, arcname="%s/%s" % (so_path, name))
+                except FileNotFoundError:
+                    print("Couldn't add %s/%s to archive" % (so_path, name))
+                    pass
 
         # Create a Docker buildfile
         df = StringIO()
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH v1 03/25] tests/docker: make executable an optional argument to "update"
  2021-04-19 14:54 [PATCH for post 6.0 v1 00/25] testing/next (hexagon/tricore/test cc) Alex Bennée
  2021-04-19 14:54 ` [PATCH v1 01/25] checkpatch: Fix use of uninitialized value Alex Bennée
  2021-04-19 14:54 ` [PATCH v1 02/25] tests/docker: fix copying of executable in "update" Alex Bennée
@ 2021-04-19 14:54 ` Alex Bennée
  2021-04-23 17:37   ` Willian Rampazzo
  2021-04-19 14:54 ` [PATCH v1 04/25] tests/docker: allow "update" to add the current user Alex Bennée
                   ` (22 subsequent siblings)
  25 siblings, 1 reply; 47+ messages in thread
From: Alex Bennée @ 2021-04-19 14:54 UTC (permalink / raw)
  To: qemu-devel
  Cc: fam, Thomas Huth, berrange, f4bug, Wainer dos Santos Moschetta,
	Willian Rampazzo, stefanha, crosa, pbonzini, Alex Bennée,
	aurelien

We're going to extend the abilities of the command shortly.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

---
v2
  - fix indention issue
---
 tests/docker/Makefile.include |  2 +-
 tests/docker/docker.py        | 56 ++++++++++++++++++-----------------
 2 files changed, 30 insertions(+), 28 deletions(-)

diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
index 9f464cb92c..820423d718 100644
--- a/tests/docker/Makefile.include
+++ b/tests/docker/Makefile.include
@@ -248,7 +248,7 @@ docker-run: docker-qemu-src
 	$(if $(EXECUTABLE),						\
 		$(call quiet-command,					\
 			$(DOCKER_SCRIPT) update 			\
-			$(IMAGE) $(EXECUTABLE),				\
+			$(IMAGE) --executable $(EXECUTABLE),		\
 			"  COPYING $(EXECUTABLE) to $(IMAGE)"))
 	$(call quiet-command,						\
 		$(DOCKER_SCRIPT) run 					\
diff --git a/tests/docker/docker.py b/tests/docker/docker.py
index 0435a55d10..9b3425fec2 100755
--- a/tests/docker/docker.py
+++ b/tests/docker/docker.py
@@ -523,7 +523,7 @@ class UpdateCommand(SubCommand):
     def args(self, parser):
         parser.add_argument("tag",
                             help="Image Tag")
-        parser.add_argument("executable",
+        parser.add_argument("--executable",
                             help="Executable to copy")
 
     def run(self, args, argv):
@@ -532,35 +532,37 @@ def run(self, args, argv):
         tmp = tempfile.NamedTemporaryFile(suffix="dckr.tar.gz")
         tmp_tar = TarFile(fileobj=tmp, mode='w')
 
-        # Add the executable to the tarball, using the current
-        # configured binfmt_misc path. If we don't get a path then we
-        # only need the support libraries copied
-        ff, enabled = _check_binfmt_misc(args.executable)
-
-        if not enabled:
-            print("binfmt_misc not enabled, update disabled")
-            return 1
-
-        if ff:
-            tmp_tar.add(args.executable, arcname=ff)
-
-        # Add any associated libraries
-        libs = _get_so_libs(args.executable)
-        if libs:
-            for l in libs:
-                so_path = os.path.dirname(l)
-                name = os.path.basename(l)
-                real_l = os.path.realpath(l)
-                try:
-                    tmp_tar.add(real_l, arcname="%s/%s" % (so_path, name))
-                except FileNotFoundError:
-                    print("Couldn't add %s/%s to archive" % (so_path, name))
-                    pass
-
         # Create a Docker buildfile
         df = StringIO()
         df.write(u"FROM %s\n" % args.tag)
-        df.write(u"ADD . /\n")
+
+        if args.executable:
+            # Add the executable to the tarball, using the current
+            # configured binfmt_misc path. If we don't get a path then we
+            # only need the support libraries copied
+            ff, enabled = _check_binfmt_misc(args.executable)
+
+            if not enabled:
+                print("binfmt_misc not enabled, update disabled")
+                return 1
+
+            if ff:
+                tmp_tar.add(args.executable, arcname=ff)
+
+            # Add any associated libraries
+            libs = _get_so_libs(args.executable)
+            if libs:
+                for l in libs:
+                    so_path = os.path.dirname(l)
+                    name = os.path.basename(l)
+                    real_l = os.path.realpath(l)
+                    try:
+                        tmp_tar.add(real_l, arcname="%s/%s" % (so_path, name))
+                    except FileNotFoundError:
+                        print("Couldn't add %s/%s to archive" % (so_path, name))
+                        pass
+
+            df.write(u"ADD . /\n")
 
         df_bytes = BytesIO(bytes(df.getvalue(), "UTF-8"))
 
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH v1 04/25] tests/docker: allow "update" to add the current user
  2021-04-19 14:54 [PATCH for post 6.0 v1 00/25] testing/next (hexagon/tricore/test cc) Alex Bennée
                   ` (2 preceding siblings ...)
  2021-04-19 14:54 ` [PATCH v1 03/25] tests/docker: make executable an optional argument to "update" Alex Bennée
@ 2021-04-19 14:54 ` Alex Bennée
  2021-04-23 18:35   ` Willian Rampazzo
  2021-04-19 14:54 ` [PATCH v1 05/25] tests/docker: add "fetch" sub-command Alex Bennée
                   ` (21 subsequent siblings)
  25 siblings, 1 reply; 47+ messages in thread
From: Alex Bennée @ 2021-04-19 14:54 UTC (permalink / raw)
  To: qemu-devel
  Cc: fam, Thomas Huth, berrange, f4bug, Wainer dos Santos Moschetta,
	Willian Rampazzo, stefanha, crosa, pbonzini, Alex Bennée,
	aurelien

The current user functionality is used for cross compiling to avoid
complications with permissions when building test programs. However
for images that come from the registry we still need the ability to
add the user after the fact.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 tests/docker/docker.py | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/tests/docker/docker.py b/tests/docker/docker.py
index 9b3425fec2..7a14058801 100755
--- a/tests/docker/docker.py
+++ b/tests/docker/docker.py
@@ -517,7 +517,7 @@ def run(self, args, argv):
 
 
 class UpdateCommand(SubCommand):
-    """ Update a docker image with new executables. Args: <tag> <executable>"""
+    """ Update a docker image. Args: <tag> <actions>"""
     name = "update"
 
     def args(self, parser):
@@ -525,6 +525,9 @@ def args(self, parser):
                             help="Image Tag")
         parser.add_argument("--executable",
                             help="Executable to copy")
+        parser.add_argument("--add-current-user", "-u", dest="user",
+                            action="store_true",
+                            help="Add the current user to image's passwd")
 
     def run(self, args, argv):
         # Create a temporary tarball with our whole build context and
@@ -564,6 +567,13 @@ def run(self, args, argv):
 
             df.write(u"ADD . /\n")
 
+        if args.user:
+            uid = os.getuid()
+            uname = getpwuid(uid).pw_name
+            df.write("\n")
+            df.write("RUN id %s 2>/dev/null || useradd -u %d -U %s" %
+                     (uname, uid, uname))
+
         df_bytes = BytesIO(bytes(df.getvalue(), "UTF-8"))
 
         df_tar = TarInfo(name="Dockerfile")
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH  v1 05/25] tests/docker: add "fetch" sub-command
  2021-04-19 14:54 [PATCH for post 6.0 v1 00/25] testing/next (hexagon/tricore/test cc) Alex Bennée
                   ` (3 preceding siblings ...)
  2021-04-19 14:54 ` [PATCH v1 04/25] tests/docker: allow "update" to add the current user Alex Bennée
@ 2021-04-19 14:54 ` Alex Bennée
  2021-04-23 18:37   ` Willian Rampazzo
  2021-04-19 14:54 ` [PATCH v1 06/25] docker: Add Hexagon image Alex Bennée
                   ` (20 subsequent siblings)
  25 siblings, 1 reply; 47+ messages in thread
From: Alex Bennée @ 2021-04-19 14:54 UTC (permalink / raw)
  To: qemu-devel
  Cc: fam, Thomas Huth, berrange, f4bug, Wainer dos Santos Moschetta,
	Willian Rampazzo, stefanha, crosa, pbonzini, Alex Bennée,
	aurelien

This simply wraps up fetching a build from the registry and tagging it
as the local build.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 tests/docker/docker.py | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/tests/docker/docker.py b/tests/docker/docker.py
index 7a14058801..4d9bb7c7ed 100755
--- a/tests/docker/docker.py
+++ b/tests/docker/docker.py
@@ -515,6 +515,23 @@ def run(self, args, argv):
 
         return 0
 
+class FetchCommand(SubCommand):
+    """ Fetch a docker image from the registry. Args: <tag> <registry>"""
+    name = "fetch"
+
+    def args(self, parser):
+        parser.add_argument("tag",
+                            help="Local tag for image")
+        parser.add_argument("registry",
+                            help="Docker registry")
+
+    def run(self, args, argv):
+        dkr = Docker()
+        dkr.command(cmd="pull", quiet=args.quiet,
+                    argv=["%s/%s" % (args.registry, args.tag)])
+        dkr.command(cmd="tag", quiet=args.quiet,
+                    argv=["%s/%s" % (args.registry, args.tag), args.tag])
+
 
 class UpdateCommand(SubCommand):
     """ Update a docker image. Args: <tag> <actions>"""
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH  v1 06/25] docker: Add Hexagon image
  2021-04-19 14:54 [PATCH for post 6.0 v1 00/25] testing/next (hexagon/tricore/test cc) Alex Bennée
                   ` (4 preceding siblings ...)
  2021-04-19 14:54 ` [PATCH v1 05/25] tests/docker: add "fetch" sub-command Alex Bennée
@ 2021-04-19 14:54 ` Alex Bennée
  2021-04-23 18:41   ` Willian Rampazzo
  2021-04-23 22:25   ` Philippe Mathieu-Daudé
  2021-04-19 14:54 ` [PATCH v1 07/25] tests/tcg: Use Hexagon Docker image Alex Bennée
                   ` (19 subsequent siblings)
  25 siblings, 2 replies; 47+ messages in thread
From: Alex Bennée @ 2021-04-19 14:54 UTC (permalink / raw)
  To: qemu-devel
  Cc: fam, Alessandro Di Federico, Thomas Huth, berrange, Brian Cain,
	f4bug, Wainer dos Santos Moschetta, Willian Rampazzo, stefanha,
	crosa, pbonzini, Alex Bennée, aurelien

From: Alessandro Di Federico <ale@rev.ng>

This image is a little special because it takes a long time to build.
As such most users don't want to be doing that and just pull random
binaries from the ether as intended by the container gods. This
involves someone with credentials and a beefy machine running:

  make docker-image-debian-hexagon-cross V=1 NOCACHE=1 J=30
  docker tag qemu/debian-hexagon-cross registry.gitlab.com/qemu-project/qemu/qemu/debian-hexagon-cross
  docker push registry.gitlab.com/qemu-project/qemu/qemu/debian-hexagon-cross

With a suitable binary in the "cloud" a normal user will run:

  make docker-image-debian-hexagon-cross

or have it run for them through the dependency mechanism of our
over-engineered makefiles and get the binary they wanted. There are a
few wrinkles of course including needing to tweak the final image to
have the credentials of the user so we can actually do our cross
compiles.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Cc: Alessandro Di Federico <ale@rev.ng>
Cc: Philippe Mathieu-Daudé <f4bug@amsat.org>
Cc: Brian Cain <bcain@quicinc.com>

---
vAJB:
  - dropped all r-b/sob due to rewrite
  - split into a multi-stage dockerfile
  - make dockerfile standalone
  - play fugly make games
v2
  - update LLVM version per BN7PR02MB4194DF5752EF3BADE858018DB8799@BN7PR02MB4194.namprd02.prod.outlook.com
---
 MAINTAINERS                                   |   2 +
 tests/docker/Makefile.include                 |  22 +++
 .../dockerfiles/debian-hexagon-cross.docker   |  44 ++++++
 .../build-toolchain.sh                        | 141 ++++++++++++++++++
 4 files changed, 209 insertions(+)
 create mode 100644 tests/docker/dockerfiles/debian-hexagon-cross.docker
 create mode 100755 tests/docker/dockerfiles/debian-hexagon-cross.docker.d/build-toolchain.sh

diff --git a/MAINTAINERS b/MAINTAINERS
index 36055f14c5..26c901527e 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -197,6 +197,8 @@ F: linux-user/hexagon/
 F: tests/tcg/hexagon/
 F: disas/hexagon.c
 F: default-configs/targets/hexagon-linux-user.mak
+F: docker/dockerfiles/debian-hexagon-cross.docker
+F: docker/dockerfiles/debian-hexagon-cross.docker.d/build-toolchain.sh
 
 HPPA (PA-RISC) TCG CPUs
 M: Richard Henderson <richard.henderson@linaro.org>
diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
index 820423d718..8967ecf118 100644
--- a/tests/docker/Makefile.include
+++ b/tests/docker/Makefile.include
@@ -148,6 +148,28 @@ docker-image-debian-s390x-cross: docker-image-debian10
 docker-image-debian-sh4-cross: docker-image-debian10
 docker-image-debian-sparc64-cross: docker-image-debian10
 
+#
+# The build rule for hexagon-cross is special in so far for most of
+# the time we don't want to build it. While dockers caching does avoid
+# this most of the time sometimes we want to force the issue.
+#
+docker-image-debian-hexagon-cross: $(DOCKER_FILES_DIR)/debian-hexagon-cross.docker
+	$(if $(NOCACHE), 								\
+		$(call quiet-command,							\
+			$(DOCKER_SCRIPT) build -t qemu/debian-hexagon-cross -f $< 	\
+			$(if $V,,--quiet) --no-cache 					\
+			--registry $(DOCKER_REGISTRY) --extra-files			\
+			$(DOCKER_FILES_DIR)/debian-hexagon-cross.docker.d/build-toolchain.sh, \
+			"BUILD", "debian-hexagon-cross"),				\
+		$(call quiet-command,							\
+			$(DOCKER_SCRIPT) fetch $(if $V,,--quiet)			\
+				qemu/debian-hexagon-cross $(DOCKER_REGISTRY),		\
+			"FETCH", "debian-hexagon-cross")				\
+		$(call quiet-command,							\
+			$(DOCKER_SCRIPT) update $(if $V,,--quiet) 			\
+				qemu/debian-hexagon-cross --add-current-user,		\
+			"PREPARE", "debian-hexagon-cross"))
+
 # Specialist build images, sometimes very limited tools
 docker-image-debian-tricore-cross: docker-image-debian10
 docker-image-debian-all-test-cross: docker-image-debian10
diff --git a/tests/docker/dockerfiles/debian-hexagon-cross.docker b/tests/docker/dockerfiles/debian-hexagon-cross.docker
new file mode 100644
index 0000000000..1d19e8f29c
--- /dev/null
+++ b/tests/docker/dockerfiles/debian-hexagon-cross.docker
@@ -0,0 +1,44 @@
+#
+# Docker Hexagon cross-compiler target
+#
+# This docker target is used for building hexagon tests. As it also
+# needs to be able to build QEMU itself in CI we include it's
+# build-deps. It is also a "stand-alone" image so as not to be
+# triggered by re-builds on other base images given it takes a long
+# time to build.
+#
+FROM qemu/debian10
+
+# Install common build utilities
+RUN apt update && \
+    DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata && \
+    DEBIAN_FRONTEND=noninteractive eatmydata \
+    apt install -y --no-install-recommends \
+        bison \
+        cmake \
+        flex \
+        lld \
+        rsync \
+        wget
+
+ENV TOOLCHAIN_INSTALL /usr/local
+ENV ROOTFS /usr/local
+
+ENV LLVM_URL https://github.com/llvm/llvm-project/archive/bfcd21876adc3498065e4da92799f613e730d475.tar.gz
+ENV MUSL_URL https://github.com/quic/musl/archive/aff74b395fbf59cd7e93b3691905aa1af6c0778c.tar.gz
+ENV LINUX_URL https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.6.18.tar.xz
+
+ADD build-toolchain.sh /root/hexagon-toolchain/build-toolchain.sh
+
+RUN cd /root/hexagon-toolchain && ./build-toolchain.sh
+
+FROM debian:buster-slim
+# Duplicate deb line as deb-src
+RUN cat /etc/apt/sources.list | sed "s/^deb\ /deb-src /" >> /etc/apt/sources.list
+# Install QEMU build deps for use in CI
+RUN apt update && \
+    DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata && \
+    DEBIAN_FRONTEND=noninteractive eatmydata \
+    apt build-dep -yy --arch-only qemu
+COPY --from=0 /usr/local /usr/local
+ENV PATH $PATH:/usr/local/bin/
diff --git a/tests/docker/dockerfiles/debian-hexagon-cross.docker.d/build-toolchain.sh b/tests/docker/dockerfiles/debian-hexagon-cross.docker.d/build-toolchain.sh
new file mode 100755
index 0000000000..19b1c9f83e
--- /dev/null
+++ b/tests/docker/dockerfiles/debian-hexagon-cross.docker.d/build-toolchain.sh
@@ -0,0 +1,141 @@
+#!/bin/bash
+
+set -e
+
+BASE=$(readlink -f ${PWD})
+
+TOOLCHAIN_INSTALL=$(readlink -f "$TOOLCHAIN_INSTALL")
+ROOTFS=$(readlink -f "$ROOTFS")
+
+TOOLCHAIN_BIN=${TOOLCHAIN_INSTALL}/bin
+HEX_SYSROOT=${TOOLCHAIN_INSTALL}/hexagon-unknown-linux-musl
+HEX_TOOLS_TARGET_BASE=${HEX_SYSROOT}/usr
+
+function cdp() {
+  DIR="$1"
+  mkdir -p "$DIR"
+  cd "$DIR"
+}
+
+function fetch() {
+  DIR="$1"
+  URL="$2"
+  TEMP="$(readlink -f "$PWD/tmp.tar.gz")"
+  wget --quiet "$URL" -O "$TEMP"
+  cdp "$DIR"
+  tar xaf "$TEMP" --strip-components=1
+  rm "$TEMP"
+  cd -
+}
+
+build_llvm_clang() {
+  fetch "$BASE/llvm-project" "$LLVM_URL"
+  cdp "$BASE/build-llvm"
+
+  cmake -G Ninja \
+    -DCMAKE_BUILD_TYPE=Release \
+    -DCMAKE_INSTALL_PREFIX=${TOOLCHAIN_INSTALL} \
+    -DLLVM_ENABLE_LLD=ON \
+    -DLLVM_TARGETS_TO_BUILD="Hexagon" \
+    -DLLVM_ENABLE_PROJECTS="clang;lld" \
+    "$BASE/llvm-project/llvm"
+  ninja all install
+  cd ${TOOLCHAIN_BIN}
+  ln -sf clang hexagon-unknown-linux-musl-clang
+  ln -sf clang++ hexagon-unknown-linux-musl-clang++
+  ln -sf llvm-ar hexagon-unknown-linux-musl-ar
+  ln -sf llvm-objdump hexagon-unknown-linux-musl-objdump
+  ln -sf llvm-objcopy hexagon-unknown-linux-musl-objcopy
+  ln -sf llvm-readelf hexagon-unknown-linux-musl-readelf
+  ln -sf llvm-ranlib hexagon-unknown-linux-musl-ranlib
+
+  # workaround for now:
+  cat <<EOF > hexagon-unknown-linux-musl.cfg
+-G0 --sysroot=${HEX_SYSROOT}
+EOF
+}
+
+build_clang_rt() {
+  cdp "$BASE/build-clang_rt"
+  cmake -G Ninja \
+    -DCMAKE_BUILD_TYPE=Release \
+    -DLLVM_CONFIG_PATH="$BASE/build-llvm/bin/llvm-config" \
+    -DCMAKE_ASM_FLAGS="-G0 -mlong-calls -fno-pic --target=hexagon-unknown-linux-musl " \
+    -DCMAKE_SYSTEM_NAME=Linux \
+    -DCMAKE_C_COMPILER="${TOOLCHAIN_BIN}/hexagon-unknown-linux-musl-clang" \
+    -DCMAKE_ASM_COMPILER="${TOOLCHAIN_BIN}/hexagon-unknown-linux-musl-clang" \
+    -DCMAKE_INSTALL_PREFIX=${HEX_TOOLS_TARGET_BASE} \
+    -DCMAKE_CROSSCOMPILING=ON \
+    -DCMAKE_C_COMPILER_FORCED=ON \
+    -DCMAKE_CXX_COMPILER_FORCED=ON \
+    -DCOMPILER_RT_BUILD_BUILTINS=ON \
+    -DCOMPILER_RT_BUILTINS_ENABLE_PIC=OFF \
+    -DCMAKE_SIZEOF_VOID_P=4 \
+    -DCOMPILER_RT_OS_DIR= \
+    -DCAN_TARGET_hexagon=1 \
+    -DCAN_TARGET_x86_64=0 \
+    -DCOMPILER_RT_SUPPORTED_ARCH=hexagon \
+    -DLLVM_ENABLE_PROJECTS="compiler-rt" \
+    "$BASE/llvm-project/compiler-rt"
+  ninja install-compiler-rt
+}
+
+build_musl_headers() {
+  fetch "$BASE/musl" "$MUSL_URL"
+  cd "$BASE/musl"
+  make clean
+  CC=${TOOLCHAIN_BIN}/hexagon-unknown-linux-musl-clang \
+    CROSS_COMPILE=hexagon-unknown-linux-musl \
+    LIBCC=${HEX_TOOLS_TARGET_BASE}/lib/libclang_rt.builtins-hexagon.a \
+    CROSS_CFLAGS="-G0 -O0 -mv65 -fno-builtin -fno-rounding-math --target=hexagon-unknown-linux-musl" \
+    ./configure --target=hexagon --prefix=${HEX_TOOLS_TARGET_BASE}
+  PATH=${TOOLCHAIN_BIN}:$PATH make CROSS_COMPILE= install-headers
+
+  cd ${HEX_SYSROOT}/..
+  ln -sf hexagon-unknown-linux-musl hexagon
+}
+
+build_kernel_headers() {
+  fetch "$BASE/linux" "$LINUX_URL"
+  mkdir -p "$BASE/build-linux"
+  cd "$BASE/linux"
+  make O=../build-linux ARCH=hexagon \
+   KBUILD_CFLAGS_KERNEL="-mlong-calls" \
+   CC=${TOOLCHAIN_BIN}/hexagon-unknown-linux-musl-clang \
+   LD=${TOOLCHAIN_BIN}/ld.lld \
+   KBUILD_VERBOSE=1 comet_defconfig
+  make mrproper
+
+  cd "$BASE/build-linux"
+  make \
+    ARCH=hexagon \
+    CC=${TOOLCHAIN_BIN}/clang \
+    INSTALL_HDR_PATH=${HEX_TOOLS_TARGET_BASE} \
+    V=1 \
+    headers_install
+}
+
+build_musl() {
+  cd "$BASE/musl"
+  make clean
+  CROSS_COMPILE=hexagon-unknown-linux-musl- \
+    AR=llvm-ar \
+    RANLIB=llvm-ranlib \
+    STRIP=llvm-strip \
+    CC=clang \
+    LIBCC=${HEX_TOOLS_TARGET_BASE}/lib/libclang_rt.builtins-hexagon.a \
+    CFLAGS="-G0 -O0 -mv65 -fno-builtin -fno-rounding-math --target=hexagon-unknown-linux-musl" \
+    ./configure --target=hexagon --prefix=${HEX_TOOLS_TARGET_BASE}
+  PATH=${TOOLCHAIN_BIN}/:$PATH make CROSS_COMPILE= install
+  cd ${HEX_TOOLS_TARGET_BASE}/lib
+  ln -sf libc.so ld-musl-hexagon.so
+  ln -sf ld-musl-hexagon.so ld-musl-hexagon.so.1
+  cdp ${HEX_TOOLS_TARGET_BASE}/../lib
+  ln -sf ../usr/lib/ld-musl-hexagon.so.1
+}
+
+build_llvm_clang
+build_kernel_headers
+build_musl_headers
+build_clang_rt
+build_musl
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH  v1 07/25] tests/tcg: Use Hexagon Docker image
  2021-04-19 14:54 [PATCH for post 6.0 v1 00/25] testing/next (hexagon/tricore/test cc) Alex Bennée
                   ` (5 preceding siblings ...)
  2021-04-19 14:54 ` [PATCH v1 06/25] docker: Add Hexagon image Alex Bennée
@ 2021-04-19 14:54 ` Alex Bennée
  2021-04-23 22:23   ` Philippe Mathieu-Daudé
  2021-04-19 14:54 ` [PATCH v1 08/25] gitlab: add build-user-hexagon test Alex Bennée
                   ` (18 subsequent siblings)
  25 siblings, 1 reply; 47+ messages in thread
From: Alex Bennée @ 2021-04-19 14:54 UTC (permalink / raw)
  To: qemu-devel
  Cc: fam, Alessandro Di Federico, berrange, f4bug, stefanha, crosa,
	pbonzini, Alex Bennée, aurelien

From: Alessandro Di Federico <ale@rev.ng>

[PMD: Split from 'Add Hexagon Docker image' patch]

Signed-off-by: Alessandro Di Federico <ale@rev.ng>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20210228222314.304787-5-f4bug@amsat.org>
Message-Id: <20210305092328.31792-6-alex.bennee@linaro.org>
---
 tests/tcg/configure.sh | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/tcg/configure.sh b/tests/tcg/configure.sh
index fa1a4261a4..8b97cc9a19 100755
--- a/tests/tcg/configure.sh
+++ b/tests/tcg/configure.sh
@@ -128,6 +128,10 @@ for target in $target_list; do
       container_image=fedora-cris-cross
       container_cross_cc=cris-linux-gnu-gcc
       ;;
+    hexagon-*)
+      container_image=debian-hexagon-cross
+      container_cross_cc=hexagon-unknown-linux-musl-clang
+      ;;
     hppa-*)
       container_hosts=x86_64
       container_image=debian-hppa-cross
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH  v1 08/25] gitlab: add build-user-hexagon test
  2021-04-19 14:54 [PATCH for post 6.0 v1 00/25] testing/next (hexagon/tricore/test cc) Alex Bennée
                   ` (6 preceding siblings ...)
  2021-04-19 14:54 ` [PATCH v1 07/25] tests/tcg: Use Hexagon Docker image Alex Bennée
@ 2021-04-19 14:54 ` Alex Bennée
  2021-04-23 18:38   ` Willian Rampazzo
                     ` (2 more replies)
  2021-04-19 14:54 ` [PATCH v1 09/25] tests/tcg: don't iterate through other arch compilers Alex Bennée
                   ` (17 subsequent siblings)
  25 siblings, 3 replies; 47+ messages in thread
From: Alex Bennée @ 2021-04-19 14:54 UTC (permalink / raw)
  To: qemu-devel
  Cc: fam, Thomas Huth, berrange, f4bug, Wainer dos Santos Moschetta,
	Willian Rampazzo, stefanha, crosa, pbonzini, Alex Bennée,
	aurelien

We special case this as the container with the cross compiler for the
tests takes so long to build it is manually uploaded into the
registry.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
Message-Id: <20210305092328.31792-7-alex.bennee@linaro.org>
---
 .gitlab-ci.yml | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 52d65d6c04..87d1172b03 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -413,6 +413,17 @@ build-user-static:
     CONFIGURE_ARGS: --disable-tools --disable-system --static
     MAKE_CHECK_ARGS: check-tcg
 
+# Because the hexagon cross-compiler takes so long to build we don't rely
+# on the CI system to build it and hence this job has no dependency
+# declared. The image is manually uploaded.
+build-user-hexagon:
+  <<: *native_build_job_definition
+  variables:
+    IMAGE: debian-hexagon-cross
+    TARGETS: hexagon-linux-user
+    CONFIGURE_ARGS: --disable-tools --disable-docs --enable-debug-tcg
+    MAKE_CHECK_ARGS: check-tcg
+
 # Only build the softmmu targets we have check-tcg tests for
 build-some-softmmu:
   <<: *native_build_job_definition
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH v1 09/25] tests/tcg: don't iterate through other arch compilers
  2021-04-19 14:54 [PATCH for post 6.0 v1 00/25] testing/next (hexagon/tricore/test cc) Alex Bennée
                   ` (7 preceding siblings ...)
  2021-04-19 14:54 ` [PATCH v1 08/25] gitlab: add build-user-hexagon test Alex Bennée
@ 2021-04-19 14:54 ` Alex Bennée
  2021-04-19 14:54 ` [PATCH v1 10/25] tests/docker: Added libbpf library to the docker files Alex Bennée
                   ` (16 subsequent siblings)
  25 siblings, 0 replies; 47+ messages in thread
From: Alex Bennée @ 2021-04-19 14:54 UTC (permalink / raw)
  To: qemu-devel
  Cc: fam, berrange, f4bug, stefanha, crosa, pbonzini,
	Alex Bennée, aurelien

There should only be one compiler per architecture. Those cases where
the same compiler can deal with a different architecture should be
explicitly set for both cross_cc and docker configurations. Otherwise
you get strangeness like:

  --cross-cc-aarch64=/bin/false

causing the logic to attempt to use a locally available
arm-linux-gnueabihf-gcc rather than forcing the use of the docker
image which is what is implied by the command line option.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 tests/tcg/configure.sh | 148 ++++++++++++++++-------------------------
 1 file changed, 59 insertions(+), 89 deletions(-)

diff --git a/tests/tcg/configure.sh b/tests/tcg/configure.sh
index 8b97cc9a19..bfe9619217 100755
--- a/tests/tcg/configure.sh
+++ b/tests/tcg/configure.sh
@@ -74,35 +74,6 @@ fi
 
 for target in $target_list; do
   arch=${target%%-*}
-  case $arch in
-    arm|armeb)
-      arches=arm
-      ;;
-    aarch64|aarch64_be)
-      arches="aarch64 arm"
-      ;;
-    mips*)
-      arches=mips
-      ;;
-    ppc*)
-      arches=ppc
-      ;;
-    sh4|sh4eb)
-      arches=sh4
-      ;;
-    x86_64)
-      arches="x86_64 i386"
-      ;;
-    xtensa|xtensaeb)
-      arches=xtensa
-      ;;
-    alpha|cris|hexagon|hppa|i386|lm32|microblaze|microblazeel|m68k|openrisc|riscv64|s390x|sh4|sparc64)
-      arches=$target
-      ;;
-    *)
-      continue
-      ;;
-  esac
 
   container_image=
   case $target in
@@ -235,70 +206,69 @@ for target in $target_list; do
   echo "CROSS_CC_GUEST_CFLAGS=$target_compiler_cflags" >> $config_target_mak
 
   got_cross_cc=no
-  for i in $arch $arches; do
-    if eval test "x\${cross_cc_$i+yes}" != xyes; then
-      continue
-    fi
 
-    eval "target_compiler=\${cross_cc_$i}"
-    if ! has $target_compiler; then
-      continue
-    fi
-    write_c_skeleton
-    if ! do_compiler "$target_compiler" $target_compiler_cflags -o $TMPE $TMPC -static ; then
-      # For host systems we might get away with building without -static
-      if ! do_compiler "$target_compiler" $target_compiler_cflags -o $TMPE $TMPC ; then
-        continue
-      fi
-      echo "CROSS_CC_GUEST_STATIC=y" >> $config_target_mak
-    else
-      echo "CROSS_CC_GUEST_STATIC=y" >> $config_target_mak
-    fi
-    echo "CROSS_CC_GUEST=$target_compiler" >> $config_target_mak
+  if eval test "x\${cross_cc_$arch}" != xyes; then
+      eval "target_compiler=\${cross_cc_$arch}"
 
-    # Test for compiler features for optional tests. We only do this
-    # for cross compilers because ensuring the docker containers based
-    # compilers is a requirememt for adding a new test that needs a
-    # compiler feature.
-    case $target in
-        aarch64-*)
-            if do_compiler "$target_compiler" $target_compiler_cflags \
-               -march=armv8.1-a+sve -o $TMPE $TMPC; then
-                echo "CROSS_CC_HAS_SVE=y" >> $config_target_mak
-            fi
-            if do_compiler "$target_compiler" $target_compiler_cflags \
-               -march=armv8.3-a -o $TMPE $TMPC; then
-                echo "CROSS_CC_HAS_ARMV8_3=y" >> $config_target_mak
-            fi
-            if do_compiler "$target_compiler" $target_compiler_cflags \
-               -mbranch-protection=standard -o $TMPE $TMPC; then
-                echo "CROSS_CC_HAS_ARMV8_BTI=y" >> $config_target_mak
-            fi
-            if do_compiler "$target_compiler" $target_compiler_cflags \
-               -march=armv8.5-a+memtag -o $TMPE $TMPC; then
-                echo "CROSS_CC_HAS_ARMV8_MTE=y" >> $config_target_mak
-            fi
-        ;;
-        ppc*)
-            if do_compiler "$target_compiler" $target_compiler_cflags \
-               -mpower8-vector -o $TMPE $TMPC; then
-                echo "CROSS_CC_HAS_POWER8_VECTOR=y" >> $config_target_mak
-            fi
-        ;;
-        i386-linux-user)
-            if do_compiler "$target_compiler" $target_compiler_cflags \
-                -Werror -fno-pie -o $TMPE $TMPC; then
-                echo "CROSS_CC_HAS_I386_NOPIE=y" >> $config_target_mak
-            fi
-        ;;
-    esac
+      if has $target_compiler; then
+          write_c_skeleton
+          if ! do_compiler "$target_compiler" $target_compiler_cflags \
+                 -o $TMPE $TMPC -static ; then
+              # For host systems we might get away with building without -static
+              if do_compiler "$target_compiler" $target_compiler_cflags \
+                     -o $TMPE $TMPC ; then
+                  got_cross_cc=yes
+                  echo "CROSS_CC_GUEST_STATIC=y" >> $config_target_mak
+                  echo "CROSS_CC_GUEST=$target_compiler" >> $config_target_mak
+              fi
+          else
+              got_cross_cc=yes
+              echo "CROSS_CC_GUEST_STATIC=y" >> $config_target_mak
+              echo "CROSS_CC_GUEST=$target_compiler" >> $config_target_mak
+          fi
+      fi
+  fi
 
-    enabled_cross_compilers="$enabled_cross_compilers $target_compiler"
-    got_cross_cc=yes
-    break
-  done
+  if test $got_cross_cc = yes; then
+      # Test for compiler features for optional tests. We only do this
+      # for cross compilers because ensuring the docker containers based
+      # compilers is a requirememt for adding a new test that needs a
+      # compiler feature.
 
-  if test $got_cross_cc = no && test "$container" != no && test -n "$container_image"; then
+      case $target in
+          aarch64-*)
+              if do_compiler "$target_compiler" $target_compiler_cflags \
+                             -march=armv8.1-a+sve -o $TMPE $TMPC; then
+                  echo "CROSS_CC_HAS_SVE=y" >> $config_target_mak
+              fi
+              if do_compiler "$target_compiler" $target_compiler_cflags \
+                             -march=armv8.3-a -o $TMPE $TMPC; then
+                  echo "CROSS_CC_HAS_ARMV8_3=y" >> $config_target_mak
+              fi
+              if do_compiler "$target_compiler" $target_compiler_cflags \
+                             -mbranch-protection=standard -o $TMPE $TMPC; then
+                  echo "CROSS_CC_HAS_ARMV8_BTI=y" >> $config_target_mak
+              fi
+              if do_compiler "$target_compiler" $target_compiler_cflags \
+                             -march=armv8.5-a+memtag -o $TMPE $TMPC; then
+                  echo "CROSS_CC_HAS_ARMV8_MTE=y" >> $config_target_mak
+              fi
+              ;;
+          ppc*)
+              if do_compiler "$target_compiler" $target_compiler_cflags \
+                             -mpower8-vector -o $TMPE $TMPC; then
+                  echo "CROSS_CC_HAS_POWER8_VECTOR=y" >> $config_target_mak
+              fi
+              ;;
+          i386-linux-user)
+              if do_compiler "$target_compiler" $target_compiler_cflags \
+                             -Werror -fno-pie -o $TMPE $TMPC; then
+                  echo "CROSS_CC_HAS_I386_NOPIE=y" >> $config_target_mak
+              fi
+              ;;
+      esac
+  elif test $got_cross_cc = no && test "$container" != no && \
+          test -n "$container_image"; then
       for host in $container_hosts; do
           if test "$host" = "$ARCH"; then
               echo "DOCKER_IMAGE=$container_image" >> $config_target_mak
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH v1 10/25] tests/docker: Added libbpf library to the docker files.
  2021-04-19 14:54 [PATCH for post 6.0 v1 00/25] testing/next (hexagon/tricore/test cc) Alex Bennée
                   ` (8 preceding siblings ...)
  2021-04-19 14:54 ` [PATCH v1 09/25] tests/tcg: don't iterate through other arch compilers Alex Bennée
@ 2021-04-19 14:54 ` Alex Bennée
  2021-04-23 18:39   ` Willian Rampazzo
  2021-04-23 22:30   ` Philippe Mathieu-Daudé
  2021-04-19 14:54 ` [PATCH v1 11/25] tests/tcg: Add docker_as and docker_ld cmds Alex Bennée
                   ` (15 subsequent siblings)
  25 siblings, 2 replies; 47+ messages in thread
From: Alex Bennée @ 2021-04-19 14:54 UTC (permalink / raw)
  To: qemu-devel
  Cc: fam, Andrew Melnychenko, berrange, f4bug,
	Wainer dos Santos Moschetta, Willian Rampazzo, stefanha, crosa,
	Thomas Huth, pbonzini, Alex Bennée, aurelien

From: Andrew Melnychenko <andrew@daynix.com>

The series of patches for eBPF RSS adds libbpf dependency for qemu.
https://lists.gnu.org/archive/html/qemu-devel/2021-03/msg08887.html

With this patch, libbpf added:
  Alpine - added libbpf-dev
  Centos 8 - added libbpf-devel
  Fedora - added libbpf-devel

Signed-off-by: Andrew Melnychenko <andrew@daynix.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20210406082947.672708-2-andrew@daynix.com>
---
 tests/docker/dockerfiles/alpine.docker  | 1 +
 tests/docker/dockerfiles/centos8.docker | 1 +
 tests/docker/dockerfiles/fedora.docker  | 1 +
 3 files changed, 3 insertions(+)

diff --git a/tests/docker/dockerfiles/alpine.docker b/tests/docker/dockerfiles/alpine.docker
index d63a269aef..998a7584ed 100644
--- a/tests/docker/dockerfiles/alpine.docker
+++ b/tests/docker/dockerfiles/alpine.docker
@@ -19,6 +19,7 @@ ENV PACKAGES \
 	gnutls-dev \
 	gtk+3.0-dev \
 	libaio-dev \
+	libbpf-dev \
 	libcap-ng-dev \
 	libjpeg-turbo-dev \
 	libnfs-dev \
diff --git a/tests/docker/dockerfiles/centos8.docker b/tests/docker/dockerfiles/centos8.docker
index a8c6c528b0..efc1349cc8 100644
--- a/tests/docker/dockerfiles/centos8.docker
+++ b/tests/docker/dockerfiles/centos8.docker
@@ -14,6 +14,7 @@ ENV PACKAGES \
     git \
     glib2-devel \
     libaio-devel \
+    libbpf-devel \
     libepoxy-devel \
     libfdt-devel \
     libgcrypt-devel \
diff --git a/tests/docker/dockerfiles/fedora.docker b/tests/docker/dockerfiles/fedora.docker
index 915fdc1845..483f2d9f83 100644
--- a/tests/docker/dockerfiles/fedora.docker
+++ b/tests/docker/dockerfiles/fedora.docker
@@ -32,6 +32,7 @@ ENV PACKAGES \
     libcurl-devel \
     libepoxy-devel \
     libfdt-devel \
+    libbpf-devel \
     libiscsi-devel \
     libjpeg-devel \
     libpmem-devel \
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH  v1 11/25] tests/tcg: Add docker_as and docker_ld cmds
  2021-04-19 14:54 [PATCH for post 6.0 v1 00/25] testing/next (hexagon/tricore/test cc) Alex Bennée
                   ` (9 preceding siblings ...)
  2021-04-19 14:54 ` [PATCH v1 10/25] tests/docker: Added libbpf library to the docker files Alex Bennée
@ 2021-04-19 14:54 ` Alex Bennée
  2021-04-23 22:31   ` Philippe Mathieu-Daudé
  2021-04-19 14:54 ` [PATCH v1 12/25] tests/tcg: Run timeout cmds using --foreground Alex Bennée
                   ` (14 subsequent siblings)
  25 siblings, 1 reply; 47+ messages in thread
From: Alex Bennée @ 2021-04-19 14:54 UTC (permalink / raw)
  To: qemu-devel
  Cc: fam, berrange, Bastian Koppelmann, f4bug, stefanha, crosa,
	pbonzini, Alex Bennée, aurelien

From: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>

At least for the TriCore target no easily available c compiler exists.
Thus we need to rely on "as" and "ld". This allows us to run them
through the docker image. We don't test the generation capabilities of
docker images as they are assumed to work.

Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
[AJB: fix quoting, only handle docker & clear, test -n, tweak commit msg]
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 tests/tcg/Makefile.qemu | 15 +++++++++++++++
 tests/tcg/configure.sh  | 17 ++++++++++++++++-
 2 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/tests/tcg/Makefile.qemu b/tests/tcg/Makefile.qemu
index a56564660c..2c4617516b 100644
--- a/tests/tcg/Makefile.qemu
+++ b/tests/tcg/Makefile.qemu
@@ -22,6 +22,8 @@ quiet-@ = $(if $(V),,@)
 quiet-command = $(quiet-@)$(call quiet-command-run,$1,$2,$3)
 
 CROSS_CC_GUEST:=
+CROSS_AS_GUEST:=
+CROSS_LD_GUEST:=
 DOCKER_IMAGE:=
 
 -include tests/tcg/config-$(TARGET).mak
@@ -42,6 +44,7 @@ cross-build-guest-tests:
 	$(call quiet-command, \
 	   (mkdir -p tests/tcg/$(TARGET) && cd tests/tcg/$(TARGET) && \
 	    $(MAKE) -f $(TCG_MAKE) TARGET="$(TARGET)" CC="$(CROSS_CC_GUEST)" \
+			AS="$(CROSS_AS_GUEST)" LD="$(CROSS_LD_GUEST)" \
 			SRC_PATH="$(SRC_PATH)" BUILD_STATIC=$(CROSS_CC_GUEST_STATIC) \
 			EXTRA_CFLAGS="$(CROSS_CC_GUEST_CFLAGS)"), \
 	"BUILD","$(TARGET) guest-tests with $(CROSS_CC_GUEST)")
@@ -59,11 +62,23 @@ DOCKER_COMPILE_CMD="$(DOCKER_SCRIPT) cc \
 		-i qemu/$(DOCKER_IMAGE) \
 		-s $(SRC_PATH) -- "
 
+DOCKER_AS_CMD="$(DOCKER_SCRIPT) cc \
+		--cc $(DOCKER_CROSS_AS_GUEST) \
+		-i qemu/$(DOCKER_IMAGE) \
+		-s $(SRC_PATH) -- "
+
+DOCKER_LD_CMD="$(DOCKER_SCRIPT) cc \
+		--cc $(DOCKER_CROSS_LD_GUEST) \
+		-i qemu/$(DOCKER_IMAGE) \
+		-s $(SRC_PATH) -- "
+
+
 .PHONY: docker-build-guest-tests
 docker-build-guest-tests: docker-image-$(DOCKER_IMAGE)
 	$(call quiet-command, \
 	  (mkdir -p tests/tcg/$(TARGET) && cd tests/tcg/$(TARGET) && \
 	   $(MAKE) -f $(TCG_MAKE) TARGET="$(TARGET)" CC=$(DOCKER_COMPILE_CMD) \
+			AS=$(DOCKER_AS_CMD) LD=$(DOCKER_LD_CMD) \
 			SRC_PATH="$(SRC_PATH)" BUILD_STATIC=y \
 			EXTRA_CFLAGS="$(CROSS_CC_GUEST_CFLAGS)"), \
 	"BUILD","$(TARGET) guest-tests with docker qemu/$(DOCKER_IMAGE)")
diff --git a/tests/tcg/configure.sh b/tests/tcg/configure.sh
index bfe9619217..9f304b6c5a 100755
--- a/tests/tcg/configure.sh
+++ b/tests/tcg/configure.sh
@@ -75,7 +75,13 @@ fi
 for target in $target_list; do
   arch=${target%%-*}
 
+  # reset all container fields
   container_image=
+  container_hosts=
+  container_cross_cc=
+  container_cross_as=
+  container_cross_ld=
+
   case $target in
     aarch64-*)
       # We don't have any bigendian build tools so we only use this for AArch64
@@ -272,7 +278,16 @@ for target in $target_list; do
       for host in $container_hosts; do
           if test "$host" = "$ARCH"; then
               echo "DOCKER_IMAGE=$container_image" >> $config_target_mak
-              echo "DOCKER_CROSS_CC_GUEST=$container_cross_cc" >> $config_target_mak
+              echo "DOCKER_CROSS_CC_GUEST=$container_cross_cc" >> \
+                   $config_target_mak
+              if test -n "$container_cross_as"; then
+                  echo "DOCKER_CROSS_AS_GUEST=$container_cross_as" >> \
+                      $config_target_mak
+              fi
+              if test -n "$container_cross_ld"; then
+                  echo "DOCKER_CROSS_LD_GUEST=$container_cross_ld" >> \
+                      $config_target_mak
+              fi
           fi
       done
   fi
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH  v1 12/25] tests/tcg: Run timeout cmds using --foreground
  2021-04-19 14:54 [PATCH for post 6.0 v1 00/25] testing/next (hexagon/tricore/test cc) Alex Bennée
                   ` (10 preceding siblings ...)
  2021-04-19 14:54 ` [PATCH v1 11/25] tests/tcg: Add docker_as and docker_ld cmds Alex Bennée
@ 2021-04-19 14:54 ` Alex Bennée
  2021-04-19 14:54 ` [PATCH v1 13/25] hw/tricore: Add testdevice for tests in tests/tcg/ Alex Bennée
                   ` (13 subsequent siblings)
  25 siblings, 0 replies; 47+ messages in thread
From: Alex Bennée @ 2021-04-19 14:54 UTC (permalink / raw)
  To: qemu-devel
  Cc: fam, berrange, Bastian Koppelmann, f4bug, stefanha, crosa,
	pbonzini, Alex Bennée, aurelien

From: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>

when trying to run successful short tests from the Makefile timeout would not
terminate. Rather it would wait until the time runs out. Excerpt from the
manpage:

--foreground
    when not running timeout directly from a shell prompt,
    allow COMMAND to read from the TTY and get TTY signals; in this mode, chil‐
    dren of COMMAND will not be timed out

Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20210305170045.869437-3-kbastian@mail.uni-paderborn.de>
---
 tests/tcg/Makefile.target | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/tcg/Makefile.target b/tests/tcg/Makefile.target
index cab8c6b3a2..b29fae4630 100644
--- a/tests/tcg/Makefile.target
+++ b/tests/tcg/Makefile.target
@@ -43,9 +43,10 @@ quiet-command = $(if $(V),$1,$(if $(2),@printf "  %-7s %s\n" $2 $3 && $1, @$1))
 
 # $1 = test name, $2 = cmd, $3 = desc
 ifdef CONFIG_USER_ONLY
-run-test = $(call quiet-command, timeout $(TIMEOUT) $2 > $1.out,"TEST",$3)
+run-test = $(call quiet-command, timeout --foreground $(TIMEOUT) $2 > $1.out, \
+	"TEST",$3)
 else
-run-test = $(call quiet-command, timeout $(TIMEOUT) $2,"TEST",$3)
+run-test = $(call quiet-command, timeout --foreground $(TIMEOUT) $2,"TEST",$3)
 endif
 
 # $1 = test name, $2 = reference
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH  v1 13/25] hw/tricore: Add testdevice for tests in tests/tcg/
  2021-04-19 14:54 [PATCH for post 6.0 v1 00/25] testing/next (hexagon/tricore/test cc) Alex Bennée
                   ` (11 preceding siblings ...)
  2021-04-19 14:54 ` [PATCH v1 12/25] tests/tcg: Run timeout cmds using --foreground Alex Bennée
@ 2021-04-19 14:54 ` Alex Bennée
  2021-04-26  9:37   ` Philippe Mathieu-Daudé
  2021-04-19 14:54 ` [PATCH v1 14/25] tests/tcg/tricore: Add build infrastructure Alex Bennée
                   ` (12 subsequent siblings)
  25 siblings, 1 reply; 47+ messages in thread
From: Alex Bennée @ 2021-04-19 14:54 UTC (permalink / raw)
  To: qemu-devel
  Cc: fam, berrange, Bastian Koppelmann, f4bug, stefanha, crosa,
	pbonzini, Alex Bennée, aurelien

From: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>

this device is used to verify the correctness of regression tests by
allowing guests to write their exit status to this device. This is then
used by qemu to exit using the written status.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20210305170045.869437-4-kbastian@mail.uni-paderborn.de>
---
 include/hw/tricore/tricore_testdevice.h | 38 ++++++++++++
 hw/tricore/tricore_testboard.c          |  8 +++
 hw/tricore/tricore_testdevice.c         | 82 +++++++++++++++++++++++++
 hw/tricore/meson.build                  |  1 +
 4 files changed, 129 insertions(+)
 create mode 100644 include/hw/tricore/tricore_testdevice.h
 create mode 100644 hw/tricore/tricore_testdevice.c

diff --git a/include/hw/tricore/tricore_testdevice.h b/include/hw/tricore/tricore_testdevice.h
new file mode 100644
index 0000000000..2c56c51bcb
--- /dev/null
+++ b/include/hw/tricore/tricore_testdevice.h
@@ -0,0 +1,38 @@
+/*
+ *  Copyright (c) 2018-2021  Bastian Koppelmann Paderborn University
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#ifndef HW_TRICORE_TESTDEV_H
+#define HW_TRICORE_TESTDEV_H
+
+#include "hw/sysbus.h"
+#include "hw/hw.h"
+
+#define TYPE_TRICORE_TESTDEVICE "tricore_testdevice"
+#define TRICORE_TESTDEVICE(obj) \
+    OBJECT_CHECK(TriCoreTestDeviceState, (obj), TYPE_TRICORE_TESTDEVICE)
+
+typedef struct {
+    /* <private> */
+    SysBusDevice parent_obj;
+
+    /* <public> */
+    MemoryRegion iomem;
+
+} TriCoreTestDeviceState;
+
+#endif
diff --git a/hw/tricore/tricore_testboard.c b/hw/tricore/tricore_testboard.c
index 12ea1490fd..9791986a3e 100644
--- a/hw/tricore/tricore_testboard.c
+++ b/hw/tricore/tricore_testboard.c
@@ -28,6 +28,7 @@
 #include "exec/address-spaces.h"
 #include "elf.h"
 #include "hw/tricore/tricore.h"
+#include "hw/tricore/tricore_testdevice.h"
 #include "qemu/error-report.h"
 
 
@@ -57,6 +58,7 @@ static void tricore_testboard_init(MachineState *machine, int board_id)
 {
     TriCoreCPU *cpu;
     CPUTriCoreState *env;
+    TriCoreTestDeviceState *test_dev;
 
     MemoryRegion *sysmem = get_system_memory();
     MemoryRegion *ext_cram = g_new(MemoryRegion, 1);
@@ -88,6 +90,12 @@ static void tricore_testboard_init(MachineState *machine, int board_id)
     memory_region_add_subregion(sysmem, 0xf0050000, pcp_data);
     memory_region_add_subregion(sysmem, 0xf0060000, pcp_text);
 
+    test_dev = g_new(TriCoreTestDeviceState, 1);
+    object_initialize(test_dev, sizeof(TriCoreTestDeviceState),
+                      TYPE_TRICORE_TESTDEVICE);
+    memory_region_add_subregion(sysmem, 0xf0000000, &test_dev->iomem);
+
+
     tricoretb_binfo.ram_size = machine->ram_size;
     tricoretb_binfo.kernel_filename = machine->kernel_filename;
 
diff --git a/hw/tricore/tricore_testdevice.c b/hw/tricore/tricore_testdevice.c
new file mode 100644
index 0000000000..a1563aa568
--- /dev/null
+++ b/hw/tricore/tricore_testdevice.c
@@ -0,0 +1,82 @@
+/*
+ *  Copyright (c) 2018-2021 Bastian Koppelmann Paderborn University
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "qemu/osdep.h"
+#include "hw/sysbus.h"
+#include "hw/qdev-properties.h"
+#include "hw/tricore/tricore_testdevice.h"
+
+static void tricore_testdevice_write(void *opaque, hwaddr offset,
+                                      uint64_t value, unsigned size)
+{
+    exit(value);
+}
+
+static uint64_t tricore_testdevice_read(void *opaque, hwaddr offset,
+                                         unsigned size)
+{
+    return 0xdeadbeef;
+}
+
+static void tricore_testdevice_reset(DeviceState *dev)
+{
+}
+
+static const MemoryRegionOps tricore_testdevice_ops = {
+    .read = tricore_testdevice_read,
+    .write = tricore_testdevice_write,
+    .valid = {
+        .min_access_size = 4,
+        .max_access_size = 4,
+    },
+    .endianness = DEVICE_NATIVE_ENDIAN,
+};
+
+static void tricore_testdevice_init(Object *obj)
+{
+    TriCoreTestDeviceState *s = TRICORE_TESTDEVICE(obj);
+   /* map memory */
+    memory_region_init_io(&s->iomem, OBJECT(s), &tricore_testdevice_ops, s,
+                          "tricore_testdevice", 0x4);
+}
+
+static Property tricore_testdevice_properties[] = {
+    DEFINE_PROP_END_OF_LIST()
+};
+
+static void tricore_testdevice_class_init(ObjectClass *klass, void *data)
+{
+    DeviceClass *dc = DEVICE_CLASS(klass);
+
+    device_class_set_props(dc, tricore_testdevice_properties);
+    dc->reset = tricore_testdevice_reset;
+}
+
+static const TypeInfo tricore_testdevice_info = {
+    .name          = TYPE_TRICORE_TESTDEVICE,
+    .parent        = TYPE_SYS_BUS_DEVICE,
+    .instance_size = sizeof(TriCoreTestDeviceState),
+    .instance_init = tricore_testdevice_init,
+    .class_init    = tricore_testdevice_class_init,
+};
+
+static void tricore_testdevice_register_types(void)
+{
+    type_register_static(&tricore_testdevice_info);
+}
+
+type_init(tricore_testdevice_register_types)
diff --git a/hw/tricore/meson.build b/hw/tricore/meson.build
index 77ff6fd137..47e36bb077 100644
--- a/hw/tricore/meson.build
+++ b/hw/tricore/meson.build
@@ -1,5 +1,6 @@
 tricore_ss = ss.source_set()
 tricore_ss.add(when: 'CONFIG_TRICORE', if_true: files('tricore_testboard.c'))
+tricore_ss.add(when: 'CONFIG_TRICORE', if_true: files('tricore_testdevice.c'))
 tricore_ss.add(when: 'CONFIG_TRIBOARD', if_true: files('triboard.c'))
 tricore_ss.add(when: 'CONFIG_TC27X_SOC', if_true: files('tc27x_soc.c'))
 
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH  v1 14/25] tests/tcg/tricore: Add build infrastructure
  2021-04-19 14:54 [PATCH for post 6.0 v1 00/25] testing/next (hexagon/tricore/test cc) Alex Bennée
                   ` (12 preceding siblings ...)
  2021-04-19 14:54 ` [PATCH v1 13/25] hw/tricore: Add testdevice for tests in tests/tcg/ Alex Bennée
@ 2021-04-19 14:54 ` Alex Bennée
  2021-04-19 14:54 ` [PATCH v1 15/25] configure: Emit HOST_CC to config-host.mak Alex Bennée
                   ` (11 subsequent siblings)
  25 siblings, 0 replies; 47+ messages in thread
From: Alex Bennée @ 2021-04-19 14:54 UTC (permalink / raw)
  To: qemu-devel
  Cc: fam, berrange, Bastian Koppelmann, f4bug, stefanha, crosa,
	pbonzini, Alex Bennée, aurelien

From: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>

this includes the Makefile and linker script to build all the tests.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20210305170045.869437-5-kbastian@mail.uni-paderborn.de>
---
 MAINTAINERS                               |  1 +
 tests/tcg/tricore/Makefile.softmmu-target | 15 ++++++
 tests/tcg/tricore/link.ld                 | 60 +++++++++++++++++++++++
 3 files changed, 76 insertions(+)
 create mode 100644 tests/tcg/tricore/Makefile.softmmu-target
 create mode 100644 tests/tcg/tricore/link.ld

diff --git a/MAINTAINERS b/MAINTAINERS
index 26c901527e..cf1119bd8e 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -378,6 +378,7 @@ S: Maintained
 F: target/tricore/
 F: hw/tricore/
 F: include/hw/tricore/
+F: tests/tcg/tricore/
 
 Multiarch Linux User Tests
 M: Alex Bennée <alex.bennee@linaro.org>
diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/Makefile.softmmu-target
new file mode 100644
index 0000000000..d64a99b95f
--- /dev/null
+++ b/tests/tcg/tricore/Makefile.softmmu-target
@@ -0,0 +1,15 @@
+TESTS_PATH = $(SRC_PATH)/tests/tcg/tricore
+
+LDFLAGS = -T$(TESTS_PATH)/link.ld
+ASFLAGS =
+
+QEMU_OPTS += -M tricore_testboard -nographic -kernel
+
+%.pS: $(TESTS_PATH)/%.S
+	$(HOST_CC) -E -o $@ $<
+
+%.o: %.pS
+	$(AS) $(ASFLAGS) -o $@ $<
+
+%.tst: %.o
+	$(LD) $(LDFLAGS) $< -o $@
diff --git a/tests/tcg/tricore/link.ld b/tests/tcg/tricore/link.ld
new file mode 100644
index 0000000000..364bcdc00a
--- /dev/null
+++ b/tests/tcg/tricore/link.ld
@@ -0,0 +1,60 @@
+/* Default linker script, for normal executables */
+OUTPUT_FORMAT("elf32-tricore")
+OUTPUT_ARCH(tricore)
+ENTRY(_start)
+
+/* the internal ram description */
+MEMORY
+{
+  text_ram (rx!p): org = 0x80000000, len = 15K
+  data_ram (w!xp): org = 0xd0000000, len = 130K
+}
+/*
+ * Define the sizes of the user and system stacks.
+ */
+__USTACK_SIZE = DEFINED (__USTACK_SIZE) ? __USTACK_SIZE : 1K ;
+/*
+ * Define the start address and the size of the context save area.
+ */
+__CSA_BEGIN =  0xd0000000 ;
+__CSA_SIZE =  8k ;
+__CSA_END = __CSA_BEGIN + __CSA_SIZE ;
+
+SECTIONS
+{
+  .text  :
+  {
+    *(.text)
+    . = ALIGN(8);
+  } > text_ram
+
+  .rodata :
+  {
+    *(.rodata)
+    *(.rodata1)
+  } > data_ram
+
+  .data :
+  {
+    . = ALIGN(8) ;
+    *(.data)
+    *(.data.*)
+    . = ALIGN(8) ;
+    __USTACK = . + __USTACK_SIZE -768;
+
+  } > data_ram
+  /*
+   * Allocate space for BSS sections.
+   */
+  .bss  :
+  {
+    BSS_BASE = . ;
+    *(.bss)
+    *(COMMON)
+    . = ALIGN(8) ;
+  } > data_ram
+  /* Make sure CSA, stack and heap addresses are properly aligned.  */
+  _. = ASSERT ((__CSA_BEGIN & 0x3f) == 0 , "illegal CSA start address") ;
+  _. = ASSERT ((__CSA_SIZE & 0x3f) == 0 , "illegal CSA size") ;
+
+}
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH  v1 15/25] configure: Emit HOST_CC to config-host.mak
  2021-04-19 14:54 [PATCH for post 6.0 v1 00/25] testing/next (hexagon/tricore/test cc) Alex Bennée
                   ` (13 preceding siblings ...)
  2021-04-19 14:54 ` [PATCH v1 14/25] tests/tcg/tricore: Add build infrastructure Alex Bennée
@ 2021-04-19 14:54 ` Alex Bennée
  2021-04-19 14:54 ` [PATCH v1 16/25] tests/tcg/tricore: Add macros to create tests and first test 'abs' Alex Bennée
                   ` (10 subsequent siblings)
  25 siblings, 0 replies; 47+ messages in thread
From: Alex Bennée @ 2021-04-19 14:54 UTC (permalink / raw)
  To: qemu-devel
  Cc: fam, berrange, Bastian Koppelmann, f4bug, stefanha, crosa,
	pbonzini, Alex Bennée, aurelien

From: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>

this is needed by the tricore-tcg-tests as tricore-gcc is not easily
available. Thus we rely on the HOST_CC to do the preprocessing of the
tricore assembly files.

Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20210305170045.869437-6-kbastian@mail.uni-paderborn.de>
---
 configure | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configure b/configure
index 4f374b4889..bb86c72479 100755
--- a/configure
+++ b/configure
@@ -6139,6 +6139,7 @@ echo "GENISOIMAGE=$genisoimage" >> $config_host_mak
 echo "MESON=$meson" >> $config_host_mak
 echo "NINJA=$ninja" >> $config_host_mak
 echo "CC=$cc" >> $config_host_mak
+echo "HOST_CC=$host_cc" >> $config_host_mak
 if $iasl -h > /dev/null 2>&1; then
   echo "CONFIG_IASL=$iasl" >> $config_host_mak
 fi
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH v1 16/25] tests/tcg/tricore: Add macros to create tests and first test 'abs'
  2021-04-19 14:54 [PATCH for post 6.0 v1 00/25] testing/next (hexagon/tricore/test cc) Alex Bennée
                   ` (14 preceding siblings ...)
  2021-04-19 14:54 ` [PATCH v1 15/25] configure: Emit HOST_CC to config-host.mak Alex Bennée
@ 2021-04-19 14:54 ` Alex Bennée
  2021-04-19 14:54 ` [PATCH v1 17/25] tests/tcg/tricore: Add bmerge test Alex Bennée
                   ` (9 subsequent siblings)
  25 siblings, 0 replies; 47+ messages in thread
From: Alex Bennée @ 2021-04-19 14:54 UTC (permalink / raw)
  To: qemu-devel
  Cc: fam, berrange, Bastian Koppelmann, f4bug, stefanha, crosa,
	pbonzini, Alex Bennée, aurelien

From: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>

This kind of tests is inspired by the riscv-tests repository. This adds
macros that makes it easy to create single instruction self containing
tests.

It is achieved by macros that create a test sequence for an
instruction and check for a supplied correct value. If the value is correct the
next instruction is tested. Otherwise we jump to fail handler that writes is
test number as a status code back to qemu that then exits on that status code.
If all tests pass we write back 0 as a status code and exit.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Message-Id: <20210305170045.869437-7-kbastian@mail.uni-paderborn.de>
[AJB: add container_hosts]
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 tests/tcg/tricore/macros.h                | 53 +++++++++++++++++++++++
 tests/tcg/configure.sh                    |  6 +++
 tests/tcg/tricore/Makefile.softmmu-target |  2 +
 tests/tcg/tricore/test_abs.S              |  7 +++
 4 files changed, 68 insertions(+)
 create mode 100644 tests/tcg/tricore/macros.h
 create mode 100644 tests/tcg/tricore/test_abs.S

diff --git a/tests/tcg/tricore/macros.h b/tests/tcg/tricore/macros.h
new file mode 100644
index 0000000000..76c133132a
--- /dev/null
+++ b/tests/tcg/tricore/macros.h
@@ -0,0 +1,53 @@
+/* Helpers */
+#define LI(reg, val)           \
+    mov.u reg, lo:val;         \
+    movh DREG_TEMP_LI, up:val; \
+    or reg, reg, DREG_TEMP_LI; \
+
+/* Address definitions */
+#define TESTDEV_ADDR 0xf0000000
+/* Register definitions */
+#define DREG_RS1 %d0
+#define DREG_CALC_RESULT %d1
+#define DREG_TEMP_LI %d10
+#define DREG_TEMP %d11
+#define DREG_TEST_NUM %d14
+#define DREG_CORRECT_RESULT %d15
+
+#define DREG_DEV_ADDR %a15
+
+/* Test case wrappers */
+#define TEST_CASE(num, testreg, correct, code...) \
+test_ ## num:                                     \
+    code;                                         \
+    LI(DREG_CORRECT_RESULT, correct)              \
+    mov DREG_TEST_NUM, num;                       \
+    jne testreg, DREG_CORRECT_RESULT, fail        \
+
+/* Actual test case type
+ * e.g inst %dX, %dY      -> TEST_D_D
+ *     inst %dX, %dY, %dZ -> TEST_D_DD
+ *     inst %eX, %dY, %dZ -> TEST_E_DD
+ */
+#define TEST_D_D(insn, num, result, rs1)      \
+    TEST_CASE(num, DREG_CALC_RESULT, result,  \
+    LI(DREG_RS1, rs1);                        \
+    insn DREG_CALC_RESULT, DREG_RS1;          \
+    )
+
+/* Pass/Fail handling part */
+#define TEST_PASSFAIL                       \
+        j pass;                             \
+fail:                                       \
+        LI(DREG_TEMP, TESTDEV_ADDR)         \
+        mov.a DREG_DEV_ADDR, DREG_TEMP;     \
+        st.w [DREG_DEV_ADDR], DREG_TEST_NUM;\
+        debug;                              \
+        j fail;                             \
+pass:                                       \
+        LI(DREG_TEMP, TESTDEV_ADDR)         \
+        mov.a DREG_DEV_ADDR, DREG_TEMP;     \
+        mov DREG_TEST_NUM, 0;               \
+        st.w [DREG_DEV_ADDR], DREG_TEST_NUM;\
+        debug;                              \
+        j pass;
diff --git a/tests/tcg/configure.sh b/tests/tcg/configure.sh
index 9f304b6c5a..c04d9683ef 100755
--- a/tests/tcg/configure.sh
+++ b/tests/tcg/configure.sh
@@ -179,6 +179,12 @@ for target in $target_list; do
       container_image=debian-sparc64-cross
       container_cross_cc=sparc64-linux-gnu-gcc
       ;;
+    tricore-softmmu)
+      container_hosts=x86_64
+      container_image=debian-tricore-cross
+      container_cross_as=tricore-as
+      container_cross_ld=tricore-ld
+      ;;
     x86_64-*)
       container_hosts="aarch64 ppc64el x86_64"
       container_image=debian-amd64-cross
diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/Makefile.softmmu-target
index d64a99b95f..3b048e49fa 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target
+++ b/tests/tcg/tricore/Makefile.softmmu-target
@@ -3,6 +3,8 @@ TESTS_PATH = $(SRC_PATH)/tests/tcg/tricore
 LDFLAGS = -T$(TESTS_PATH)/link.ld
 ASFLAGS =
 
+TESTS += test_abs.tst
+
 QEMU_OPTS += -M tricore_testboard -nographic -kernel
 
 %.pS: $(TESTS_PATH)/%.S
diff --git a/tests/tcg/tricore/test_abs.S b/tests/tcg/tricore/test_abs.S
new file mode 100644
index 0000000000..e42240159a
--- /dev/null
+++ b/tests/tcg/tricore/test_abs.S
@@ -0,0 +1,7 @@
+#include "macros.h"
+.text
+.global _start
+_start:
+    TEST_D_D(abs, 1, 0, 0)
+
+    TEST_PASSFAIL
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH  v1 17/25] tests/tcg/tricore: Add bmerge test
  2021-04-19 14:54 [PATCH for post 6.0 v1 00/25] testing/next (hexagon/tricore/test cc) Alex Bennée
                   ` (15 preceding siblings ...)
  2021-04-19 14:54 ` [PATCH v1 16/25] tests/tcg/tricore: Add macros to create tests and first test 'abs' Alex Bennée
@ 2021-04-19 14:54 ` Alex Bennée
  2021-04-19 14:54 ` [PATCH v1 18/25] tests/tcg/tricore: Add clz test Alex Bennée
                   ` (8 subsequent siblings)
  25 siblings, 0 replies; 47+ messages in thread
From: Alex Bennée @ 2021-04-19 14:54 UTC (permalink / raw)
  To: qemu-devel
  Cc: fam, berrange, Bastian Koppelmann, f4bug, stefanha, crosa,
	pbonzini, Alex Bennée, aurelien

From: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>

Tested-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20210305170045.869437-8-kbastian@mail.uni-paderborn.de>
---
 tests/tcg/tricore/macros.h                | 24 +++++++++++++++++++++++
 tests/tcg/tricore/Makefile.softmmu-target |  1 +
 tests/tcg/tricore/test_bmerge.S           |  8 ++++++++
 3 files changed, 33 insertions(+)
 create mode 100644 tests/tcg/tricore/test_bmerge.S

diff --git a/tests/tcg/tricore/macros.h b/tests/tcg/tricore/macros.h
index 76c133132a..52aa936c56 100644
--- a/tests/tcg/tricore/macros.h
+++ b/tests/tcg/tricore/macros.h
@@ -8,7 +8,10 @@
 #define TESTDEV_ADDR 0xf0000000
 /* Register definitions */
 #define DREG_RS1 %d0
+#define DREG_RS2 %d1
 #define DREG_CALC_RESULT %d1
+#define DREG_CALC_PSW %d2
+#define DREG_CORRECT_PSW %d3
 #define DREG_TEMP_LI %d10
 #define DREG_TEMP %d11
 #define DREG_TEST_NUM %d14
@@ -24,6 +27,17 @@ test_ ## num:                                     \
     mov DREG_TEST_NUM, num;                       \
     jne testreg, DREG_CORRECT_RESULT, fail        \
 
+#define TEST_CASE_PSW(num, testreg, correct, correct_psw, code...) \
+test_ ## num:                                                      \
+    code;                                                          \
+    LI(DREG_CORRECT_RESULT, correct)                               \
+    mov DREG_TEST_NUM, num;                                        \
+    jne testreg, DREG_CORRECT_RESULT, fail;                        \
+    mfcr DREG_CALC_PSW, $psw;                                      \
+    LI(DREG_CORRECT_PSW, correct_psw)                              \
+    mov DREG_TEST_NUM, num;                                        \
+    jne DREG_CALC_PSW, DREG_CORRECT_PSW, fail;
+
 /* Actual test case type
  * e.g inst %dX, %dY      -> TEST_D_D
  *     inst %dX, %dY, %dZ -> TEST_D_DD
@@ -35,6 +49,16 @@ test_ ## num:                                     \
     insn DREG_CALC_RESULT, DREG_RS1;          \
     )
 
+#define TEST_D_DD_PSW(insn, num, result, psw, rs1, rs2) \
+    TEST_CASE_PSW(num, DREG_CALC_RESULT, result, psw,   \
+    LI(DREG_RS1, rs1);                                  \
+    LI(DREG_RS2, rs2);                                  \
+    rstv;                                               \
+    insn DREG_CALC_RESULT, DREG_RS1, DREG_RS2;          \
+    )
+
+
+
 /* Pass/Fail handling part */
 #define TEST_PASSFAIL                       \
         j pass;                             \
diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/Makefile.softmmu-target
index 3b048e49fa..de6a2cc88e 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target
+++ b/tests/tcg/tricore/Makefile.softmmu-target
@@ -4,6 +4,7 @@ LDFLAGS = -T$(TESTS_PATH)/link.ld
 ASFLAGS =
 
 TESTS += test_abs.tst
+TESTS += test_bmerge.tst
 
 QEMU_OPTS += -M tricore_testboard -nographic -kernel
 
diff --git a/tests/tcg/tricore/test_bmerge.S b/tests/tcg/tricore/test_bmerge.S
new file mode 100644
index 0000000000..8a0fa6d3f6
--- /dev/null
+++ b/tests/tcg/tricore/test_bmerge.S
@@ -0,0 +1,8 @@
+#include "macros.h"
+.text
+.global _start
+_start:
+    TEST_D_DD_PSW(bmerge, 1, 0x555557f7, 0x00000b80, 0x0000001d, 0x0000ffff)
+
+    TEST_PASSFAIL
+
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH  v1 18/25] tests/tcg/tricore: Add clz test
  2021-04-19 14:54 [PATCH for post 6.0 v1 00/25] testing/next (hexagon/tricore/test cc) Alex Bennée
                   ` (16 preceding siblings ...)
  2021-04-19 14:54 ` [PATCH v1 17/25] tests/tcg/tricore: Add bmerge test Alex Bennée
@ 2021-04-19 14:54 ` Alex Bennée
  2021-04-29 13:53   ` Bastian Koppelmann
  2021-04-19 14:54 ` [PATCH v1 19/25] tests/tcg/tricore: Add dvstep test Alex Bennée
                   ` (7 subsequent siblings)
  25 siblings, 1 reply; 47+ messages in thread
From: Alex Bennée @ 2021-04-19 14:54 UTC (permalink / raw)
  To: qemu-devel
  Cc: fam, berrange, Bastian Koppelmann, f4bug, stefanha, crosa,
	pbonzini, Alex Bennée, aurelien

From: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>

Tested-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20210305170045.869437-9-kbastian@mail.uni-paderborn.de>
---
 tests/tcg/tricore/Makefile.softmmu-target      |  1 +
 tests/tcg/tricore/Makefile.softmmu-target.orig | 18 ++++++++++++++++++
 tests/tcg/tricore/test_clz.S                   |  9 +++++++++
 3 files changed, 28 insertions(+)
 create mode 100644 tests/tcg/tricore/Makefile.softmmu-target.orig
 create mode 100644 tests/tcg/tricore/test_clz.S

diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/Makefile.softmmu-target
index de6a2cc88e..a9b81545e2 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target
+++ b/tests/tcg/tricore/Makefile.softmmu-target
@@ -5,6 +5,7 @@ ASFLAGS =
 
 TESTS += test_abs.tst
 TESTS += test_bmerge.tst
+TESTS += test_clz.tst
 
 QEMU_OPTS += -M tricore_testboard -nographic -kernel
 
diff --git a/tests/tcg/tricore/Makefile.softmmu-target.orig b/tests/tcg/tricore/Makefile.softmmu-target.orig
new file mode 100644
index 0000000000..de6a2cc88e
--- /dev/null
+++ b/tests/tcg/tricore/Makefile.softmmu-target.orig
@@ -0,0 +1,18 @@
+TESTS_PATH = $(SRC_PATH)/tests/tcg/tricore
+
+LDFLAGS = -T$(TESTS_PATH)/link.ld
+ASFLAGS =
+
+TESTS += test_abs.tst
+TESTS += test_bmerge.tst
+
+QEMU_OPTS += -M tricore_testboard -nographic -kernel
+
+%.pS: $(TESTS_PATH)/%.S
+	$(HOST_CC) -E -o $@ $<
+
+%.o: %.pS
+	$(AS) $(ASFLAGS) -o $@ $<
+
+%.tst: %.o
+	$(LD) $(LDFLAGS) $< -o $@
diff --git a/tests/tcg/tricore/test_clz.S b/tests/tcg/tricore/test_clz.S
new file mode 100644
index 0000000000..e03835f123
--- /dev/null
+++ b/tests/tcg/tricore/test_clz.S
@@ -0,0 +1,9 @@
+#include "macros.h"
+.text
+.global _start
+_start:
+    TEST_D_D(cls.h, 1, 0x0, 0x6db17976)
+    TEST_D_D(cls.h, 2, 0x000f000f, 0x0)
+
+    TEST_PASSFAIL
+
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH  v1 19/25] tests/tcg/tricore: Add dvstep test
  2021-04-19 14:54 [PATCH for post 6.0 v1 00/25] testing/next (hexagon/tricore/test cc) Alex Bennée
                   ` (17 preceding siblings ...)
  2021-04-19 14:54 ` [PATCH v1 18/25] tests/tcg/tricore: Add clz test Alex Bennée
@ 2021-04-19 14:54 ` Alex Bennée
  2021-04-19 14:54 ` [PATCH v1 20/25] tests/tcg/tricore: Add fadd test Alex Bennée
                   ` (6 subsequent siblings)
  25 siblings, 0 replies; 47+ messages in thread
From: Alex Bennée @ 2021-04-19 14:54 UTC (permalink / raw)
  To: qemu-devel
  Cc: fam, berrange, Bastian Koppelmann, f4bug, stefanha, crosa,
	pbonzini, Alex Bennée, aurelien

From: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>

Tested-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20210305170045.869437-10-kbastian@mail.uni-paderborn.de>
---
 tests/tcg/tricore/macros.h                    | 29 ++++++++++++++++++-
 tests/tcg/tricore/Makefile.softmmu-target     |  1 +
 .../tcg/tricore/Makefile.softmmu-target.orig  |  1 +
 tests/tcg/tricore/test_dvstep.S               | 15 ++++++++++
 4 files changed, 45 insertions(+), 1 deletion(-)
 create mode 100644 tests/tcg/tricore/test_dvstep.S

diff --git a/tests/tcg/tricore/macros.h b/tests/tcg/tricore/macros.h
index 52aa936c56..59b4b9a352 100644
--- a/tests/tcg/tricore/macros.h
+++ b/tests/tcg/tricore/macros.h
@@ -19,6 +19,18 @@
 
 #define DREG_DEV_ADDR %a15
 
+#define EREG_RS1 %e6
+#define EREG_RS1_LO %d6
+#define EREG_RS1_HI %d7
+#define EREG_RS2 %e8
+#define EREG_RS2_LO %d8
+#define EREG_RS2_HI %d9
+#define EREG_CALC_RESULT %e8
+#define EREG_CALC_RESULT_HI %d9
+#define EREG_CALC_RESULT_LO %d8
+#define EREG_CORRECT_RESULT_LO %d0
+#define EREG_CORRECT_RESULT_HI %d1
+
 /* Test case wrappers */
 #define TEST_CASE(num, testreg, correct, code...) \
 test_ ## num:                                     \
@@ -27,6 +39,15 @@ test_ ## num:                                     \
     mov DREG_TEST_NUM, num;                       \
     jne testreg, DREG_CORRECT_RESULT, fail        \
 
+#define TEST_CASE_E(num, correct_lo, correct_hi, code...)  \
+test_ ## num:                                              \
+    code;                                                  \
+    mov DREG_TEST_NUM, num;                                \
+    LI(EREG_CORRECT_RESULT_LO, correct_lo)                 \
+    jne EREG_CALC_RESULT_LO, EREG_CORRECT_RESULT_LO, fail; \
+    LI(EREG_CORRECT_RESULT_HI, correct_hi)                 \
+    jne EREG_CALC_RESULT_HI, EREG_CORRECT_RESULT_HI, fail;
+
 #define TEST_CASE_PSW(num, testreg, correct, correct_psw, code...) \
 test_ ## num:                                                      \
     code;                                                          \
@@ -57,7 +78,13 @@ test_ ## num:                                                      \
     insn DREG_CALC_RESULT, DREG_RS1, DREG_RS2;          \
     )
 
-
+#define TEST_E_ED(insn, num, res_hi, res_lo, rs1_hi, rs1_lo, rs2) \
+    TEST_CASE_E(num, res_lo, res_hi,                              \
+    LI(EREG_RS1_LO, rs1_lo);                                      \
+    LI(EREG_RS1_HI, rs1_hi);                                      \
+    LI(DREG_RS2, rs2);                                            \
+    insn EREG_CALC_RESULT, EREG_RS1, DREG_RS2;                    \
+    )
 
 /* Pass/Fail handling part */
 #define TEST_PASSFAIL                       \
diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/Makefile.softmmu-target
index a9b81545e2..799b51191e 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target
+++ b/tests/tcg/tricore/Makefile.softmmu-target
@@ -6,6 +6,7 @@ ASFLAGS =
 TESTS += test_abs.tst
 TESTS += test_bmerge.tst
 TESTS += test_clz.tst
+TESTS += test_dvstep.tst
 
 QEMU_OPTS += -M tricore_testboard -nographic -kernel
 
diff --git a/tests/tcg/tricore/Makefile.softmmu-target.orig b/tests/tcg/tricore/Makefile.softmmu-target.orig
index de6a2cc88e..a9b81545e2 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target.orig
+++ b/tests/tcg/tricore/Makefile.softmmu-target.orig
@@ -5,6 +5,7 @@ ASFLAGS =
 
 TESTS += test_abs.tst
 TESTS += test_bmerge.tst
+TESTS += test_clz.tst
 
 QEMU_OPTS += -M tricore_testboard -nographic -kernel
 
diff --git a/tests/tcg/tricore/test_dvstep.S b/tests/tcg/tricore/test_dvstep.S
new file mode 100644
index 0000000000..858dbc62dd
--- /dev/null
+++ b/tests/tcg/tricore/test_dvstep.S
@@ -0,0 +1,15 @@
+#include "macros.h"
+.text
+.global _start
+_start:
+    #                              Result                   RS1            RS2
+    TEST_E_ED(dvstep,   1, 0x000001ff, 0xfffe5cff, 0x00000001, 0xfffffe5c, 0x0)
+    TEST_E_ED(dvstep,   2, 0x00000000, 0x000000ff, 0x00000000, 0x00000000, 0x0)
+    TEST_E_ED(dvstep,   3, 0x0000f000, 0x000000fd, 0x010000f0, 0x00000000, 0x0)
+    TEST_E_ED(dvstep,   4, 0xfffff000, 0x00000000, 0x7ffffff0, 0x00000000, 0x0)
+    TEST_E_ED(dvstep.u, 5, 0xffffff00, 0x100008ff, 0xffffffff, 0x00100008, 0x0)
+    TEST_E_ED(dvstep.u, 6, 0x00000100, 0x00000000, 0x08000001, 0x00000000, \
+                           0xffffff2d)
+
+    TEST_PASSFAIL
+
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH  v1 20/25] tests/tcg/tricore: Add fadd test
  2021-04-19 14:54 [PATCH for post 6.0 v1 00/25] testing/next (hexagon/tricore/test cc) Alex Bennée
                   ` (18 preceding siblings ...)
  2021-04-19 14:54 ` [PATCH v1 19/25] tests/tcg/tricore: Add dvstep test Alex Bennée
@ 2021-04-19 14:54 ` Alex Bennée
  2021-04-19 14:54 ` [PATCH v1 21/25] tests/tcg/tricore: Add fmul test Alex Bennée
                   ` (5 subsequent siblings)
  25 siblings, 0 replies; 47+ messages in thread
From: Alex Bennée @ 2021-04-19 14:54 UTC (permalink / raw)
  To: qemu-devel
  Cc: fam, berrange, Bastian Koppelmann, f4bug, stefanha, crosa,
	pbonzini, Alex Bennée, aurelien

From: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>

Tested-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20210305170045.869437-11-kbastian@mail.uni-paderborn.de>
---
 tests/tcg/tricore/Makefile.softmmu-target      |  1 +
 tests/tcg/tricore/Makefile.softmmu-target.orig |  1 +
 tests/tcg/tricore/test_fadd.S                  | 16 ++++++++++++++++
 3 files changed, 18 insertions(+)
 create mode 100644 tests/tcg/tricore/test_fadd.S

diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/Makefile.softmmu-target
index 799b51191e..e7adb16af9 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target
+++ b/tests/tcg/tricore/Makefile.softmmu-target
@@ -7,6 +7,7 @@ TESTS += test_abs.tst
 TESTS += test_bmerge.tst
 TESTS += test_clz.tst
 TESTS += test_dvstep.tst
+TESTS += test_fadd.tst
 
 QEMU_OPTS += -M tricore_testboard -nographic -kernel
 
diff --git a/tests/tcg/tricore/Makefile.softmmu-target.orig b/tests/tcg/tricore/Makefile.softmmu-target.orig
index a9b81545e2..799b51191e 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target.orig
+++ b/tests/tcg/tricore/Makefile.softmmu-target.orig
@@ -6,6 +6,7 @@ ASFLAGS =
 TESTS += test_abs.tst
 TESTS += test_bmerge.tst
 TESTS += test_clz.tst
+TESTS += test_dvstep.tst
 
 QEMU_OPTS += -M tricore_testboard -nographic -kernel
 
diff --git a/tests/tcg/tricore/test_fadd.S b/tests/tcg/tricore/test_fadd.S
new file mode 100644
index 0000000000..1a65054803
--- /dev/null
+++ b/tests/tcg/tricore/test_fadd.S
@@ -0,0 +1,16 @@
+#include "macros.h"
+.text
+.global _start
+_start:
+    TEST_D_DD_PSW(add.f, 1, 0x7fc00000, 0x00000b80, 0xffffff85, 0x00001234)
+    TEST_D_DD_PSW(add.f, 2, 0xf9c00000, 0x00000b80, 0xf9400000, 0xf9400000)
+    TEST_D_DD_PSW(add.f, 3, 0x8bb858ca, 0x00000b80, 0x8b3858ca, 0x8b3858ca)
+    TEST_D_DD_PSW(add.f, 4, 0x00000000, 0x00000b80, 0x000000ff, 0x00000000)
+    TEST_D_DD_PSW(add.f, 5, 0x7fc00000, 0x00000b80, 0xfffffe52, 0x0a4cf70c)
+    TEST_D_DD_PSW(add.f, 6, 0x9e6d5076, 0x84000b80, 0x9ded50ec, 0x9ded4fff)
+    TEST_D_DD_PSW(add.f, 7, 0x00000000, 0x04000b80, 0x0000e8bd, 0x00000000)
+    TEST_D_DD_PSW(add.f, 8, 0x7fc00000, 0xc4000b80, 0xffad546e, 0xffad546e)
+    TEST_D_DD_PSW(add.f, 9, 0x7fc00000, 0x04000b80, 0xfffe0000, 0x08130000)
+
+    TEST_PASSFAIL
+
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH  v1 21/25] tests/tcg/tricore: Add fmul test
  2021-04-19 14:54 [PATCH for post 6.0 v1 00/25] testing/next (hexagon/tricore/test cc) Alex Bennée
                   ` (19 preceding siblings ...)
  2021-04-19 14:54 ` [PATCH v1 20/25] tests/tcg/tricore: Add fadd test Alex Bennée
@ 2021-04-19 14:54 ` Alex Bennée
  2021-04-19 14:54 ` [PATCH v1 22/25] tests/tcg/tricore: Add ftoi test Alex Bennée
                   ` (4 subsequent siblings)
  25 siblings, 0 replies; 47+ messages in thread
From: Alex Bennée @ 2021-04-19 14:54 UTC (permalink / raw)
  To: qemu-devel
  Cc: fam, berrange, Bastian Koppelmann, f4bug, stefanha, crosa,
	pbonzini, Alex Bennée, aurelien

From: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>

Tested-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20210305170045.869437-12-kbastian@mail.uni-paderborn.de>
---
 tests/tcg/tricore/Makefile.softmmu-target      | 1 +
 tests/tcg/tricore/Makefile.softmmu-target.orig | 1 +
 tests/tcg/tricore/test_fmul.S                  | 8 ++++++++
 3 files changed, 10 insertions(+)
 create mode 100644 tests/tcg/tricore/test_fmul.S

diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/Makefile.softmmu-target
index e7adb16af9..34da1f37de 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target
+++ b/tests/tcg/tricore/Makefile.softmmu-target
@@ -8,6 +8,7 @@ TESTS += test_bmerge.tst
 TESTS += test_clz.tst
 TESTS += test_dvstep.tst
 TESTS += test_fadd.tst
+TESTS += test_fmul.tst
 
 QEMU_OPTS += -M tricore_testboard -nographic -kernel
 
diff --git a/tests/tcg/tricore/Makefile.softmmu-target.orig b/tests/tcg/tricore/Makefile.softmmu-target.orig
index 799b51191e..e7adb16af9 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target.orig
+++ b/tests/tcg/tricore/Makefile.softmmu-target.orig
@@ -7,6 +7,7 @@ TESTS += test_abs.tst
 TESTS += test_bmerge.tst
 TESTS += test_clz.tst
 TESTS += test_dvstep.tst
+TESTS += test_fadd.tst
 
 QEMU_OPTS += -M tricore_testboard -nographic -kernel
 
diff --git a/tests/tcg/tricore/test_fmul.S b/tests/tcg/tricore/test_fmul.S
new file mode 100644
index 0000000000..fb1f634b2d
--- /dev/null
+++ b/tests/tcg/tricore/test_fmul.S
@@ -0,0 +1,8 @@
+#include "macros.h"
+.text
+.global _start
+_start:
+    TEST_D_DD_PSW(mul.f, 1, 0x974f4f0a, 0x84000b80, 0x1a0b1980, 0xbcbec42d)
+
+    TEST_PASSFAIL
+
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH  v1 22/25] tests/tcg/tricore: Add ftoi test
  2021-04-19 14:54 [PATCH for post 6.0 v1 00/25] testing/next (hexagon/tricore/test cc) Alex Bennée
                   ` (20 preceding siblings ...)
  2021-04-19 14:54 ` [PATCH v1 21/25] tests/tcg/tricore: Add fmul test Alex Bennée
@ 2021-04-19 14:54 ` Alex Bennée
  2021-04-19 14:54 ` [PATCH v1 23/25] tests/tcg/tricore: Add madd test Alex Bennée
                   ` (3 subsequent siblings)
  25 siblings, 0 replies; 47+ messages in thread
From: Alex Bennée @ 2021-04-19 14:54 UTC (permalink / raw)
  To: qemu-devel
  Cc: fam, berrange, Bastian Koppelmann, f4bug, stefanha, crosa,
	pbonzini, Alex Bennée, aurelien

From: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>

Tested-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20210305170045.869437-13-kbastian@mail.uni-paderborn.de>
---
 tests/tcg/tricore/macros.h                     |  7 +++++++
 tests/tcg/tricore/Makefile.softmmu-target      |  1 +
 tests/tcg/tricore/Makefile.softmmu-target.orig |  1 +
 tests/tcg/tricore/test_ftoi.S                  | 10 ++++++++++
 4 files changed, 19 insertions(+)
 create mode 100644 tests/tcg/tricore/test_ftoi.S

diff --git a/tests/tcg/tricore/macros.h b/tests/tcg/tricore/macros.h
index 59b4b9a352..e6a41cd1a2 100644
--- a/tests/tcg/tricore/macros.h
+++ b/tests/tcg/tricore/macros.h
@@ -70,6 +70,13 @@ test_ ## num:                                                      \
     insn DREG_CALC_RESULT, DREG_RS1;          \
     )
 
+#define TEST_D_D_PSW(insn, num, result, psw, rs1)     \
+    TEST_CASE_PSW(num, DREG_CALC_RESULT, result, psw, \
+    LI(DREG_RS1, rs1);                                \
+    rstv;                                             \
+    insn DREG_CORRECT_RESULT, DREG_RS1;               \
+    )
+
 #define TEST_D_DD_PSW(insn, num, result, psw, rs1, rs2) \
     TEST_CASE_PSW(num, DREG_CALC_RESULT, result, psw,   \
     LI(DREG_RS1, rs1);                                  \
diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/Makefile.softmmu-target
index 34da1f37de..fcc7b6c1c9 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target
+++ b/tests/tcg/tricore/Makefile.softmmu-target
@@ -9,6 +9,7 @@ TESTS += test_clz.tst
 TESTS += test_dvstep.tst
 TESTS += test_fadd.tst
 TESTS += test_fmul.tst
+TESTS += test_ftoi.tst
 
 QEMU_OPTS += -M tricore_testboard -nographic -kernel
 
diff --git a/tests/tcg/tricore/Makefile.softmmu-target.orig b/tests/tcg/tricore/Makefile.softmmu-target.orig
index e7adb16af9..34da1f37de 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target.orig
+++ b/tests/tcg/tricore/Makefile.softmmu-target.orig
@@ -8,6 +8,7 @@ TESTS += test_bmerge.tst
 TESTS += test_clz.tst
 TESTS += test_dvstep.tst
 TESTS += test_fadd.tst
+TESTS += test_fmul.tst
 
 QEMU_OPTS += -M tricore_testboard -nographic -kernel
 
diff --git a/tests/tcg/tricore/test_ftoi.S b/tests/tcg/tricore/test_ftoi.S
new file mode 100644
index 0000000000..fb4af6b5aa
--- /dev/null
+++ b/tests/tcg/tricore/test_ftoi.S
@@ -0,0 +1,10 @@
+#include "macros.h"
+.text
+.global _start
+_start:
+    TEST_D_D_PSW(ftoi, 1, 0x0, 0x84000b80, 0x05f6e605)
+    TEST_D_D_PSW(ftoi, 2, 0x0, 0x04000b80, 0x00012200)
+    TEST_D_D_PSW(ftoi, 3, 0x0, 0xc4000b80, 0xffffffff)
+
+    TEST_PASSFAIL
+
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH  v1 23/25] tests/tcg/tricore: Add madd test
  2021-04-19 14:54 [PATCH for post 6.0 v1 00/25] testing/next (hexagon/tricore/test cc) Alex Bennée
                   ` (21 preceding siblings ...)
  2021-04-19 14:54 ` [PATCH v1 22/25] tests/tcg/tricore: Add ftoi test Alex Bennée
@ 2021-04-19 14:54 ` Alex Bennée
  2021-04-19 14:54 ` [PATCH v1 24/25] tests/tcg/tricore: Add msub test Alex Bennée
                   ` (2 subsequent siblings)
  25 siblings, 0 replies; 47+ messages in thread
From: Alex Bennée @ 2021-04-19 14:54 UTC (permalink / raw)
  To: qemu-devel
  Cc: fam, berrange, Bastian Koppelmann, f4bug, stefanha, crosa,
	pbonzini, Alex Bennée, aurelien

From: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>

Tested-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20210305170045.869437-14-kbastian@mail.uni-paderborn.de>
---
 tests/tcg/tricore/macros.h                     | 18 ++++++++++++++++++
 tests/tcg/tricore/Makefile.softmmu-target      |  1 +
 tests/tcg/tricore/Makefile.softmmu-target.orig |  1 +
 tests/tcg/tricore/test_madd.S                  | 11 +++++++++++
 4 files changed, 31 insertions(+)
 create mode 100644 tests/tcg/tricore/test_madd.S

diff --git a/tests/tcg/tricore/macros.h b/tests/tcg/tricore/macros.h
index e6a41cd1a2..0d76fc403a 100644
--- a/tests/tcg/tricore/macros.h
+++ b/tests/tcg/tricore/macros.h
@@ -9,6 +9,7 @@
 /* Register definitions */
 #define DREG_RS1 %d0
 #define DREG_RS2 %d1
+#define DREG_RS3 %d4
 #define DREG_CALC_RESULT %d1
 #define DREG_CALC_PSW %d2
 #define DREG_CORRECT_PSW %d3
@@ -85,6 +86,23 @@ test_ ## num:                                                      \
     insn DREG_CALC_RESULT, DREG_RS1, DREG_RS2;          \
     )
 
+#define TEST_D_DDD_PSW(insn, num, result, psw, rs1, rs2, rs3) \
+    TEST_CASE_PSW(num, DREG_CALC_RESULT, result, psw,         \
+    LI(DREG_RS1, rs1);                                        \
+    LI(DREG_RS2, rs2);                                        \
+    LI(DREG_RS3, rs3);                                        \
+    rstv;                                                     \
+    insn DREG_CALC_RESULT, DREG_RS1, DREG_RS2, DREG_RS3;      \
+    )
+
+#define TEST_D_DDI_PSW(insn, num, result, psw, rs1, rs2, imm) \
+    TEST_CASE_PSW(num, DREG_CALC_RESULT, result, psw,         \
+    LI(DREG_RS1, rs1);                                        \
+    LI(DREG_RS2, rs2);                                        \
+    rstv;                                                     \
+    insn DREG_CALC_RESULT, DREG_RS1, DREG_RS2, imm;           \
+    )
+
 #define TEST_E_ED(insn, num, res_hi, res_lo, rs1_hi, rs1_lo, rs2) \
     TEST_CASE_E(num, res_lo, res_hi,                              \
     LI(EREG_RS1_LO, rs1_lo);                                      \
diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/Makefile.softmmu-target
index fcc7b6c1c9..8de005523e 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target
+++ b/tests/tcg/tricore/Makefile.softmmu-target
@@ -10,6 +10,7 @@ TESTS += test_dvstep.tst
 TESTS += test_fadd.tst
 TESTS += test_fmul.tst
 TESTS += test_ftoi.tst
+TESTS += test_madd.tst
 
 QEMU_OPTS += -M tricore_testboard -nographic -kernel
 
diff --git a/tests/tcg/tricore/Makefile.softmmu-target.orig b/tests/tcg/tricore/Makefile.softmmu-target.orig
index 34da1f37de..fcc7b6c1c9 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target.orig
+++ b/tests/tcg/tricore/Makefile.softmmu-target.orig
@@ -9,6 +9,7 @@ TESTS += test_clz.tst
 TESTS += test_dvstep.tst
 TESTS += test_fadd.tst
 TESTS += test_fmul.tst
+TESTS += test_ftoi.tst
 
 QEMU_OPTS += -M tricore_testboard -nographic -kernel
 
diff --git a/tests/tcg/tricore/test_madd.S b/tests/tcg/tricore/test_madd.S
new file mode 100644
index 0000000000..5d839772bb
--- /dev/null
+++ b/tests/tcg/tricore/test_madd.S
@@ -0,0 +1,11 @@
+#include "macros.h"
+.text
+.global _start
+_start:
+    TEST_D_DDI_PSW(madd,    1, 0x0000fffd, 0x60000b80, 0x0000ffff, 0x7fffffff,2)
+    TEST_D_DDI_PSW(madd,    2, 0xffff7fff, 0x60000b80, 0xffff8001, 0x7fffffff,2)
+    TEST_D_DDD_PSW(madds.u, 3, 0xffffffff, 0x60000b80, 0x00000000, 0x80000000, \
+                             0x80000000)
+
+    TEST_PASSFAIL
+
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH  v1 24/25] tests/tcg/tricore: Add msub test
  2021-04-19 14:54 [PATCH for post 6.0 v1 00/25] testing/next (hexagon/tricore/test cc) Alex Bennée
                   ` (22 preceding siblings ...)
  2021-04-19 14:54 ` [PATCH v1 23/25] tests/tcg/tricore: Add madd test Alex Bennée
@ 2021-04-19 14:54 ` Alex Bennée
  2021-04-19 14:54 ` [PATCH v1 25/25] tests/tcg/tricore: Add muls test Alex Bennée
  2021-04-19 15:51 ` [PATCH for post 6.0 v1 00/25] testing/next (hexagon/tricore/test cc) no-reply
  25 siblings, 0 replies; 47+ messages in thread
From: Alex Bennée @ 2021-04-19 14:54 UTC (permalink / raw)
  To: qemu-devel
  Cc: fam, berrange, Bastian Koppelmann, f4bug, stefanha, crosa,
	pbonzini, Alex Bennée, aurelien

From: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>

Tested-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20210305170045.869437-15-kbastian@mail.uni-paderborn.de>
---
 tests/tcg/tricore/Makefile.softmmu-target      | 1 +
 tests/tcg/tricore/Makefile.softmmu-target.orig | 1 +
 tests/tcg/tricore/test_msub.S                  | 9 +++++++++
 3 files changed, 11 insertions(+)
 create mode 100644 tests/tcg/tricore/test_msub.S

diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/Makefile.softmmu-target
index 8de005523e..0fe6a86482 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target
+++ b/tests/tcg/tricore/Makefile.softmmu-target
@@ -11,6 +11,7 @@ TESTS += test_fadd.tst
 TESTS += test_fmul.tst
 TESTS += test_ftoi.tst
 TESTS += test_madd.tst
+TESTS += test_msub.tst
 
 QEMU_OPTS += -M tricore_testboard -nographic -kernel
 
diff --git a/tests/tcg/tricore/Makefile.softmmu-target.orig b/tests/tcg/tricore/Makefile.softmmu-target.orig
index fcc7b6c1c9..8de005523e 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target.orig
+++ b/tests/tcg/tricore/Makefile.softmmu-target.orig
@@ -10,6 +10,7 @@ TESTS += test_dvstep.tst
 TESTS += test_fadd.tst
 TESTS += test_fmul.tst
 TESTS += test_ftoi.tst
+TESTS += test_madd.tst
 
 QEMU_OPTS += -M tricore_testboard -nographic -kernel
 
diff --git a/tests/tcg/tricore/test_msub.S b/tests/tcg/tricore/test_msub.S
new file mode 100644
index 0000000000..6dee87d99c
--- /dev/null
+++ b/tests/tcg/tricore/test_msub.S
@@ -0,0 +1,9 @@
+#include "macros.h"
+.text
+.global _start
+_start:
+    TEST_D_DDI_PSW(msub, 1, 0xd2fbe5e0, 0x00000b80,0x64003300, 0xff5420d4, -216)
+    TEST_D_DDI_PSW(msub, 2, 0xfffffc10, 0x00000b80,0xfffffe68, 0xfffffffd, -200)
+    TEST_D_DDD_PSW(msubs.u, 3, 0x0, 0x60000b80, 0x1, 0xffffffff, 0xffffffdb)
+    TEST_PASSFAIL
+
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 47+ messages in thread

* [PATCH  v1 25/25] tests/tcg/tricore: Add muls test
  2021-04-19 14:54 [PATCH for post 6.0 v1 00/25] testing/next (hexagon/tricore/test cc) Alex Bennée
                   ` (23 preceding siblings ...)
  2021-04-19 14:54 ` [PATCH v1 24/25] tests/tcg/tricore: Add msub test Alex Bennée
@ 2021-04-19 14:54 ` Alex Bennée
  2021-04-19 15:51 ` [PATCH for post 6.0 v1 00/25] testing/next (hexagon/tricore/test cc) no-reply
  25 siblings, 0 replies; 47+ messages in thread
From: Alex Bennée @ 2021-04-19 14:54 UTC (permalink / raw)
  To: qemu-devel
  Cc: fam, berrange, Bastian Koppelmann, f4bug, stefanha, crosa,
	pbonzini, Alex Bennée, aurelien

From: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>

Tested-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20210305170045.869437-16-kbastian@mail.uni-paderborn.de>
---
 tests/tcg/tricore/Makefile.softmmu-target      | 1 +
 tests/tcg/tricore/Makefile.softmmu-target.orig | 1 +
 tests/tcg/tricore/test_muls.S                  | 9 +++++++++
 3 files changed, 11 insertions(+)
 create mode 100644 tests/tcg/tricore/test_muls.S

diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/Makefile.softmmu-target
index 0fe6a86482..5007c60ce8 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target
+++ b/tests/tcg/tricore/Makefile.softmmu-target
@@ -12,6 +12,7 @@ TESTS += test_fmul.tst
 TESTS += test_ftoi.tst
 TESTS += test_madd.tst
 TESTS += test_msub.tst
+TESTS += test_muls.tst
 
 QEMU_OPTS += -M tricore_testboard -nographic -kernel
 
diff --git a/tests/tcg/tricore/Makefile.softmmu-target.orig b/tests/tcg/tricore/Makefile.softmmu-target.orig
index 8de005523e..0fe6a86482 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target.orig
+++ b/tests/tcg/tricore/Makefile.softmmu-target.orig
@@ -11,6 +11,7 @@ TESTS += test_fadd.tst
 TESTS += test_fmul.tst
 TESTS += test_ftoi.tst
 TESTS += test_madd.tst
+TESTS += test_msub.tst
 
 QEMU_OPTS += -M tricore_testboard -nographic -kernel
 
diff --git a/tests/tcg/tricore/test_muls.S b/tests/tcg/tricore/test_muls.S
new file mode 100644
index 0000000000..ca517556bc
--- /dev/null
+++ b/tests/tcg/tricore/test_muls.S
@@ -0,0 +1,9 @@
+#include "macros.h"
+.text
+.global _start
+_start:
+    TEST_D_DD_PSW(muls.u, 1, 0xffffffff, 0x78000b80, 0x80000001, 0xffffffff)
+    TEST_D_DD_PSW(muls.u, 2, 0xffffffff, 0x60000b80, 0xfffffffe, 0xffffffff)
+
+    TEST_PASSFAIL
+
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 47+ messages in thread

* Re: [PATCH for post 6.0 v1 00/25] testing/next (hexagon/tricore/test cc)
  2021-04-19 14:54 [PATCH for post 6.0 v1 00/25] testing/next (hexagon/tricore/test cc) Alex Bennée
                   ` (24 preceding siblings ...)
  2021-04-19 14:54 ` [PATCH v1 25/25] tests/tcg/tricore: Add muls test Alex Bennée
@ 2021-04-19 15:51 ` no-reply
  25 siblings, 0 replies; 47+ messages in thread
From: no-reply @ 2021-04-19 15:51 UTC (permalink / raw)
  To: alex.bennee
  Cc: fam, berrange, qemu-devel, f4bug, stefanha, crosa, pbonzini,
	alex.bennee, aurelien

Patchew URL: https://patchew.org/QEMU/20210419145435.14083-1-alex.bennee@linaro.org/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20210419145435.14083-1-alex.bennee@linaro.org
Subject: [PATCH for post 6.0 v1 00/25] testing/next (hexagon/tricore/test cc)

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 - [tag update]      patchew/20210412044644.55083-1-crosa@redhat.com -> patchew/20210412044644.55083-1-crosa@redhat.com
 * [new tag]         patchew/20210419145435.14083-1-alex.bennee@linaro.org -> patchew/20210419145435.14083-1-alex.bennee@linaro.org
Switched to a new branch 'test'
577249a tests/tcg/tricore: Add muls test
5ef297b tests/tcg/tricore: Add msub test
60d2b3d tests/tcg/tricore: Add madd test
e10597f tests/tcg/tricore: Add ftoi test
a00bef9 tests/tcg/tricore: Add fmul test
2c65e8a tests/tcg/tricore: Add fadd test
7be3f15 tests/tcg/tricore: Add dvstep test
2749026 tests/tcg/tricore: Add clz test
40bbef5 tests/tcg/tricore: Add bmerge test
56f8362 tests/tcg/tricore: Add macros to create tests and first test 'abs'
1ac43af configure: Emit HOST_CC to config-host.mak
0fe19d9 tests/tcg/tricore: Add build infrastructure
5793db7 hw/tricore: Add testdevice for tests in tests/tcg/
5c35bd9 tests/tcg: Run timeout cmds using --foreground
3c36b27 tests/tcg: Add docker_as and docker_ld cmds
bc285a6 tests/docker: Added libbpf library to the docker files.
7326208 tests/tcg: don't iterate through other arch compilers
2a78f78 gitlab: add build-user-hexagon test
7278054 tests/tcg: Use Hexagon Docker image
73903c8 docker: Add Hexagon image
2baa96d tests/docker: add "fetch" sub-command
e654d76 tests/docker: allow "update" to add the current user
57ff9bc tests/docker: make executable an optional argument to "update"
25c2969 tests/docker: fix copying of executable in "update"
77f7328 checkpatch: Fix use of uninitialized value

=== OUTPUT BEGIN ===
1/25 Checking commit 77f7328cc4aa (checkpatch: Fix use of uninitialized value)
2/25 Checking commit 25c296904fd8 (tests/docker: fix copying of executable in "update")
3/25 Checking commit 57ff9bce683b (tests/docker: make executable an optional argument to "update")
4/25 Checking commit e654d7663890 (tests/docker: allow "update" to add the current user)
5/25 Checking commit 2baa96d796e7 (tests/docker: add "fetch" sub-command)
6/25 Checking commit 73903c8e6a47 (docker: Add Hexagon image)
WARNING: line over 80 characters
#203: FILE: tests/docker/dockerfiles/debian-hexagon-cross.docker.d/build-toolchain.sh:63:
+    -DCMAKE_ASM_FLAGS="-G0 -mlong-calls -fno-pic --target=hexagon-unknown-linux-musl " \

ERROR: line over 90 characters
#230: FILE: tests/docker/dockerfiles/debian-hexagon-cross.docker.d/build-toolchain.sh:90:
+    CROSS_CFLAGS="-G0 -O0 -mv65 -fno-builtin -fno-rounding-math --target=hexagon-unknown-linux-musl" \

ERROR: line over 90 characters
#267: FILE: tests/docker/dockerfiles/debian-hexagon-cross.docker.d/build-toolchain.sh:127:
+    CFLAGS="-G0 -O0 -mv65 -fno-builtin -fno-rounding-math --target=hexagon-unknown-linux-musl" \

total: 2 errors, 1 warnings, 221 lines checked

Patch 6/25 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

7/25 Checking commit 727805463520 (tests/tcg: Use Hexagon Docker image)
8/25 Checking commit 2a78f78e1f07 (gitlab: add build-user-hexagon test)
9/25 Checking commit 732620837934 (tests/tcg: don't iterate through other arch compilers)
10/25 Checking commit bc285a619930 (tests/docker: Added libbpf library to the docker files.)
11/25 Checking commit 3c36b274bb6e (tests/tcg: Add docker_as and docker_ld cmds)
12/25 Checking commit 5c35bd9924d9 (tests/tcg: Run timeout cmds using --foreground)
13/25 Checking commit 5793db7a034e (hw/tricore: Add testdevice for tests in tests/tcg/)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#68: 
new file mode 100644

total: 0 errors, 1 warnings, 152 lines checked

Patch 13/25 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
14/25 Checking commit 0fe19d907c2b (tests/tcg/tricore: Add build infrastructure)
15/25 Checking commit 1ac43af60bb2 (configure: Emit HOST_CC to config-host.mak)
16/25 Checking commit 56f8362be549 (tests/tcg/tricore: Add macros to create tests and first test 'abs')
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#61: 
new file mode 100644

ERROR: Macros with multiple statements should be enclosed in a do - while loop
#67: FILE: tests/tcg/tricore/macros.h:2:
+#define LI(reg, val)           \
+    mov.u reg, lo:val;         \
+    movh DREG_TEMP_LI, up:val; \
+    or reg, reg, DREG_TEMP_LI; \
+

ERROR: spaces required around that ':' (ctx:VxV)
#68: FILE: tests/tcg/tricore/macros.h:3:
+    mov.u reg, lo:val;         \
                  ^

ERROR: spaces required around that ':' (ctx:VxV)
#69: FILE: tests/tcg/tricore/macros.h:4:
+    movh DREG_TEMP_LI, up:val; \
                          ^

ERROR: spaces required around that '%' (ctx:WxV)
#75: FILE: tests/tcg/tricore/macros.h:10:
+#define DREG_RS1 %d0
                  ^

ERROR: Macros with complex values should be enclosed in parenthesis
#75: FILE: tests/tcg/tricore/macros.h:10:
+#define DREG_RS1 %d0

ERROR: spaces required around that '%' (ctx:WxV)
#76: FILE: tests/tcg/tricore/macros.h:11:
+#define DREG_CALC_RESULT %d1
                          ^

ERROR: Macros with complex values should be enclosed in parenthesis
#76: FILE: tests/tcg/tricore/macros.h:11:
+#define DREG_CALC_RESULT %d1

ERROR: spaces required around that '%' (ctx:WxV)
#77: FILE: tests/tcg/tricore/macros.h:12:
+#define DREG_TEMP_LI %d10
                      ^

ERROR: Macros with complex values should be enclosed in parenthesis
#77: FILE: tests/tcg/tricore/macros.h:12:
+#define DREG_TEMP_LI %d10

ERROR: spaces required around that '%' (ctx:WxV)
#78: FILE: tests/tcg/tricore/macros.h:13:
+#define DREG_TEMP %d11
                   ^

ERROR: Macros with complex values should be enclosed in parenthesis
#78: FILE: tests/tcg/tricore/macros.h:13:
+#define DREG_TEMP %d11

ERROR: spaces required around that '%' (ctx:WxV)
#79: FILE: tests/tcg/tricore/macros.h:14:
+#define DREG_TEST_NUM %d14
                       ^

ERROR: Macros with complex values should be enclosed in parenthesis
#79: FILE: tests/tcg/tricore/macros.h:14:
+#define DREG_TEST_NUM %d14

ERROR: spaces required around that '%' (ctx:WxV)
#80: FILE: tests/tcg/tricore/macros.h:15:
+#define DREG_CORRECT_RESULT %d15
                             ^

ERROR: Macros with complex values should be enclosed in parenthesis
#80: FILE: tests/tcg/tricore/macros.h:15:
+#define DREG_CORRECT_RESULT %d15

ERROR: spaces required around that '%' (ctx:WxV)
#82: FILE: tests/tcg/tricore/macros.h:17:
+#define DREG_DEV_ADDR %a15
                       ^

ERROR: Macros with complex values should be enclosed in parenthesis
#82: FILE: tests/tcg/tricore/macros.h:17:
+#define DREG_DEV_ADDR %a15

ERROR: Macros with multiple statements should be enclosed in a do - while loop
#85: FILE: tests/tcg/tricore/macros.h:20:
+#define TEST_CASE(num, testreg, correct, code...) \
+test_ ## num:                                     \
+    code;                                         \
+    LI(DREG_CORRECT_RESULT, correct)              \
+    mov DREG_TEST_NUM, num;                       \
+    jne testreg, DREG_CORRECT_RESULT, fail        \
+

ERROR: spaces required around that ':' (ctx:VxE)
#86: FILE: tests/tcg/tricore/macros.h:21:
+test_ ## num:                                     \
             ^

WARNING: Block comments use a leading /* on a separate line
#92: FILE: tests/tcg/tricore/macros.h:27:
+/* Actual test case type

ERROR: Macros with multiple statements should be enclosed in a do - while loop
#104: FILE: tests/tcg/tricore/macros.h:39:
+#define TEST_PASSFAIL                       \
+        j pass;                             \
+fail:                                       \
+        LI(DREG_TEMP, TESTDEV_ADDR)         \
+        mov.a DREG_DEV_ADDR, DREG_TEMP;     \
+        st.w [DREG_DEV_ADDR], DREG_TEST_NUM;\
+        debug;                              \
+        j fail;                             \
+pass:                                       \
+        LI(DREG_TEMP, TESTDEV_ADDR)         \
+        mov.a DREG_DEV_ADDR, DREG_TEMP;     \
+        mov DREG_TEST_NUM, 0;               \
+        st.w [DREG_DEV_ADDR], DREG_TEST_NUM;\
+        debug;                              \
+        j pass;

ERROR: space prohibited before open square bracket '['
#109: FILE: tests/tcg/tricore/macros.h:44:
+        st.w [DREG_DEV_ADDR], DREG_TEST_NUM;\

ERROR: space prohibited before open square bracket '['
#116: FILE: tests/tcg/tricore/macros.h:51:
+        st.w [DREG_DEV_ADDR], DREG_TEST_NUM;\

total: 22 errors, 2 warnings, 80 lines checked

Patch 16/25 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

17/25 Checking commit 40bbef582452 (tests/tcg/tricore: Add bmerge test)
ERROR: spaces required around that '%' (ctx:WxV)
#38: FILE: tests/tcg/tricore/macros.h:11:
+#define DREG_RS2 %d1
                  ^

ERROR: Macros with complex values should be enclosed in parenthesis
#38: FILE: tests/tcg/tricore/macros.h:11:
+#define DREG_RS2 %d1

ERROR: spaces required around that '%' (ctx:WxV)
#40: FILE: tests/tcg/tricore/macros.h:13:
+#define DREG_CALC_PSW %d2
                       ^

ERROR: Macros with complex values should be enclosed in parenthesis
#40: FILE: tests/tcg/tricore/macros.h:13:
+#define DREG_CALC_PSW %d2

ERROR: spaces required around that '%' (ctx:WxV)
#41: FILE: tests/tcg/tricore/macros.h:14:
+#define DREG_CORRECT_PSW %d3
                          ^

ERROR: Macros with complex values should be enclosed in parenthesis
#41: FILE: tests/tcg/tricore/macros.h:14:
+#define DREG_CORRECT_PSW %d3

ERROR: spaces required around that ':' (ctx:VxE)
#50: FILE: tests/tcg/tricore/macros.h:31:
+test_ ## num:                                                      \
             ^

WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#81: 
new file mode 100644

total: 7 errors, 1 warnings, 58 lines checked

Patch 17/25 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

18/25 Checking commit 2749026f4db4 (tests/tcg/tricore: Add clz test)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#31: 
new file mode 100644

total: 0 errors, 1 warnings, 34 lines checked

Patch 18/25 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
19/25 Checking commit 7be3f1510885 (tests/tcg/tricore: Add dvstep test)
ERROR: spaces required around that '%' (ctx:WxV)
#51: FILE: tests/tcg/tricore/macros.h:22:
+#define EREG_RS1 %e6
                  ^

ERROR: Macros with complex values should be enclosed in parenthesis
#51: FILE: tests/tcg/tricore/macros.h:22:
+#define EREG_RS1 %e6

ERROR: spaces required around that '%' (ctx:WxV)
#52: FILE: tests/tcg/tricore/macros.h:23:
+#define EREG_RS1_LO %d6
                     ^

ERROR: Macros with complex values should be enclosed in parenthesis
#52: FILE: tests/tcg/tricore/macros.h:23:
+#define EREG_RS1_LO %d6

ERROR: spaces required around that '%' (ctx:WxV)
#53: FILE: tests/tcg/tricore/macros.h:24:
+#define EREG_RS1_HI %d7
                     ^

ERROR: Macros with complex values should be enclosed in parenthesis
#53: FILE: tests/tcg/tricore/macros.h:24:
+#define EREG_RS1_HI %d7

ERROR: spaces required around that '%' (ctx:WxV)
#54: FILE: tests/tcg/tricore/macros.h:25:
+#define EREG_RS2 %e8
                  ^

ERROR: Macros with complex values should be enclosed in parenthesis
#54: FILE: tests/tcg/tricore/macros.h:25:
+#define EREG_RS2 %e8

ERROR: spaces required around that '%' (ctx:WxV)
#55: FILE: tests/tcg/tricore/macros.h:26:
+#define EREG_RS2_LO %d8
                     ^

ERROR: Macros with complex values should be enclosed in parenthesis
#55: FILE: tests/tcg/tricore/macros.h:26:
+#define EREG_RS2_LO %d8

ERROR: spaces required around that '%' (ctx:WxV)
#56: FILE: tests/tcg/tricore/macros.h:27:
+#define EREG_RS2_HI %d9
                     ^

ERROR: Macros with complex values should be enclosed in parenthesis
#56: FILE: tests/tcg/tricore/macros.h:27:
+#define EREG_RS2_HI %d9

ERROR: spaces required around that '%' (ctx:WxV)
#57: FILE: tests/tcg/tricore/macros.h:28:
+#define EREG_CALC_RESULT %e8
                          ^

ERROR: Macros with complex values should be enclosed in parenthesis
#57: FILE: tests/tcg/tricore/macros.h:28:
+#define EREG_CALC_RESULT %e8

ERROR: spaces required around that '%' (ctx:WxV)
#58: FILE: tests/tcg/tricore/macros.h:29:
+#define EREG_CALC_RESULT_HI %d9
                             ^

ERROR: Macros with complex values should be enclosed in parenthesis
#58: FILE: tests/tcg/tricore/macros.h:29:
+#define EREG_CALC_RESULT_HI %d9

ERROR: spaces required around that '%' (ctx:WxV)
#59: FILE: tests/tcg/tricore/macros.h:30:
+#define EREG_CALC_RESULT_LO %d8
                             ^

ERROR: Macros with complex values should be enclosed in parenthesis
#59: FILE: tests/tcg/tricore/macros.h:30:
+#define EREG_CALC_RESULT_LO %d8

ERROR: spaces required around that '%' (ctx:WxV)
#60: FILE: tests/tcg/tricore/macros.h:31:
+#define EREG_CORRECT_RESULT_LO %d0
                                ^

ERROR: Macros with complex values should be enclosed in parenthesis
#60: FILE: tests/tcg/tricore/macros.h:31:
+#define EREG_CORRECT_RESULT_LO %d0

ERROR: spaces required around that '%' (ctx:WxV)
#61: FILE: tests/tcg/tricore/macros.h:32:
+#define EREG_CORRECT_RESULT_HI %d1
                                ^

ERROR: Macros with complex values should be enclosed in parenthesis
#61: FILE: tests/tcg/tricore/macros.h:32:
+#define EREG_CORRECT_RESULT_HI %d1

ERROR: spaces required around that ':' (ctx:VxE)
#71: FILE: tests/tcg/tricore/macros.h:43:
+test_ ## num:                                              \
             ^

WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#98: 
new file mode 100644

total: 23 errors, 1 warnings, 76 lines checked

Patch 19/25 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

20/25 Checking commit 2c65e8abba3c (tests/tcg/tricore: Add fadd test)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#43: 
new file mode 100644

total: 0 errors, 1 warnings, 30 lines checked

Patch 20/25 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
21/25 Checking commit a00bef9b2eb0 (tests/tcg/tricore: Add fmul test)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#43: 
new file mode 100644

total: 0 errors, 1 warnings, 22 lines checked

Patch 21/25 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
22/25 Checking commit e10597f38ece (tests/tcg/tricore: Add ftoi test)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#62: 
new file mode 100644

total: 0 errors, 1 warnings, 37 lines checked

Patch 22/25 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
23/25 Checking commit 60d2b3d2d9b2 (tests/tcg/tricore: Add madd test)
ERROR: spaces required around that '%' (ctx:WxV)
#51: FILE: tests/tcg/tricore/macros.h:12:
+#define DREG_RS3 %d4
                  ^

ERROR: Macros with complex values should be enclosed in parenthesis
#51: FILE: tests/tcg/tricore/macros.h:12:
+#define DREG_RS3 %d4

WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#80: 
new file mode 100644

total: 2 errors, 1 warnings, 55 lines checked

Patch 23/25 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

24/25 Checking commit 5ef297b49088 (tests/tcg/tricore: Add msub test)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#43: 
new file mode 100644

total: 0 errors, 1 warnings, 23 lines checked

Patch 24/25 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
25/25 Checking commit 577249a8a4a1 (tests/tcg/tricore: Add muls test)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#43: 
new file mode 100644

total: 0 errors, 1 warnings, 23 lines checked

Patch 25/25 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20210419145435.14083-1-alex.bennee@linaro.org/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH v1 02/25] tests/docker: fix copying of executable in "update"
  2021-04-19 14:54 ` [PATCH v1 02/25] tests/docker: fix copying of executable in "update" Alex Bennée
@ 2021-04-23 17:35   ` Willian Rampazzo
  0 siblings, 0 replies; 47+ messages in thread
From: Willian Rampazzo @ 2021-04-23 17:35 UTC (permalink / raw)
  To: Alex Bennée
  Cc: Fam Zheng, Thomas Huth, Daniel Berrange, qemu-devel,
	Wainer dos Santos Moschetta, Philippe Mathieu-Daudé,
	Stefan Hajnoczi, Cleber Rosa Junior, Paolo Bonzini,
	Aurelien Jarno

On Mon, Apr 19, 2021 at 11:54 AM Alex Bennée <alex.bennee@linaro.org> wrote:
>
> We have the same symlink chasing problem when doing an "update"
> operation. Fix that.
>
> Based-on: 5e33f7fead ("tests/docker: better handle symlinked libs")
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>  tests/docker/docker.py | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
>

Reviewed-by: Willian Rampazzo <willianr@redhat.com>



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH v1 03/25] tests/docker: make executable an optional argument to "update"
  2021-04-19 14:54 ` [PATCH v1 03/25] tests/docker: make executable an optional argument to "update" Alex Bennée
@ 2021-04-23 17:37   ` Willian Rampazzo
  0 siblings, 0 replies; 47+ messages in thread
From: Willian Rampazzo @ 2021-04-23 17:37 UTC (permalink / raw)
  To: Alex Bennée
  Cc: Fam Zheng, Thomas Huth, Daniel Berrange, qemu-devel,
	Wainer dos Santos Moschetta, Philippe Mathieu-Daudé,
	Stefan Hajnoczi, Cleber Rosa Junior, Paolo Bonzini,
	Aurelien Jarno

On Mon, Apr 19, 2021 at 11:54 AM Alex Bennée <alex.bennee@linaro.org> wrote:
>
> We're going to extend the abilities of the command shortly.
>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>
> ---
> v2
>   - fix indention issue
> ---
>  tests/docker/Makefile.include |  2 +-
>  tests/docker/docker.py        | 56 ++++++++++++++++++-----------------
>  2 files changed, 30 insertions(+), 28 deletions(-)
>

Reviewed-by: Willian Rampazzo <willianr@redhat.com>



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH v1 04/25] tests/docker: allow "update" to add the current user
  2021-04-19 14:54 ` [PATCH v1 04/25] tests/docker: allow "update" to add the current user Alex Bennée
@ 2021-04-23 18:35   ` Willian Rampazzo
  0 siblings, 0 replies; 47+ messages in thread
From: Willian Rampazzo @ 2021-04-23 18:35 UTC (permalink / raw)
  To: Alex Bennée
  Cc: Fam Zheng, Thomas Huth, Daniel Berrange, qemu-devel,
	Wainer dos Santos Moschetta, Philippe Mathieu-Daudé,
	Stefan Hajnoczi, Cleber Rosa Junior, Paolo Bonzini,
	Aurelien Jarno

On Mon, Apr 19, 2021 at 11:54 AM Alex Bennée <alex.bennee@linaro.org> wrote:
>
> The current user functionality is used for cross compiling to avoid
> complications with permissions when building test programs. However
> for images that come from the registry we still need the ability to
> add the user after the fact.
>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>  tests/docker/docker.py | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
>

Reviewed-by: Willian Rampazzo <willianr@redhat.com>



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH v1 05/25] tests/docker: add "fetch" sub-command
  2021-04-19 14:54 ` [PATCH v1 05/25] tests/docker: add "fetch" sub-command Alex Bennée
@ 2021-04-23 18:37   ` Willian Rampazzo
  0 siblings, 0 replies; 47+ messages in thread
From: Willian Rampazzo @ 2021-04-23 18:37 UTC (permalink / raw)
  To: Alex Bennée
  Cc: Fam Zheng, Thomas Huth, Daniel Berrange, qemu-devel,
	Wainer dos Santos Moschetta, Philippe Mathieu-Daudé,
	Stefan Hajnoczi, Cleber Rosa Junior, Paolo Bonzini,
	Aurelien Jarno

On Mon, Apr 19, 2021 at 11:54 AM Alex Bennée <alex.bennee@linaro.org> wrote:
>
> This simply wraps up fetching a build from the registry and tagging it
> as the local build.
>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>  tests/docker/docker.py | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
>

Reviewed-by: Willian Rampazzo <willianr@redhat.com>



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH v1 08/25] gitlab: add build-user-hexagon test
  2021-04-19 14:54 ` [PATCH v1 08/25] gitlab: add build-user-hexagon test Alex Bennée
@ 2021-04-23 18:38   ` Willian Rampazzo
  2021-04-23 22:23   ` Philippe Mathieu-Daudé
  2021-05-11 14:41   ` Alex Bennée
  2 siblings, 0 replies; 47+ messages in thread
From: Willian Rampazzo @ 2021-04-23 18:38 UTC (permalink / raw)
  To: Alex Bennée
  Cc: Fam Zheng, Thomas Huth, Daniel Berrange, qemu-devel,
	Wainer dos Santos Moschetta, Philippe Mathieu-Daudé,
	Stefan Hajnoczi, Cleber Rosa Junior, Paolo Bonzini,
	Aurelien Jarno

On Mon, Apr 19, 2021 at 11:54 AM Alex Bennée <alex.bennee@linaro.org> wrote:
>
> We special case this as the container with the cross compiler for the
> tests takes so long to build it is manually uploaded into the
> registry.
>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
> Message-Id: <20210305092328.31792-7-alex.bennee@linaro.org>
> ---
>  .gitlab-ci.yml | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>

Reviewed-by: Willian Rampazzo <willianr@redhat.com>



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH v1 10/25] tests/docker: Added libbpf library to the docker files.
  2021-04-19 14:54 ` [PATCH v1 10/25] tests/docker: Added libbpf library to the docker files Alex Bennée
@ 2021-04-23 18:39   ` Willian Rampazzo
  2021-04-23 22:30   ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 47+ messages in thread
From: Willian Rampazzo @ 2021-04-23 18:39 UTC (permalink / raw)
  To: Alex Bennée
  Cc: Fam Zheng, Andrew Melnychenko, Daniel Berrange, qemu-devel,
	Wainer dos Santos Moschetta, Philippe Mathieu-Daudé,
	Stefan Hajnoczi, Cleber Rosa Junior, Thomas Huth, Paolo Bonzini,
	Aurelien Jarno

On Mon, Apr 19, 2021 at 11:54 AM Alex Bennée <alex.bennee@linaro.org> wrote:
>
> From: Andrew Melnychenko <andrew@daynix.com>
>
> The series of patches for eBPF RSS adds libbpf dependency for qemu.
> https://lists.gnu.org/archive/html/qemu-devel/2021-03/msg08887.html
>
> With this patch, libbpf added:
>   Alpine - added libbpf-dev
>   Centos 8 - added libbpf-devel
>   Fedora - added libbpf-devel
>
> Signed-off-by: Andrew Melnychenko <andrew@daynix.com>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> Message-Id: <20210406082947.672708-2-andrew@daynix.com>
> ---
>  tests/docker/dockerfiles/alpine.docker  | 1 +
>  tests/docker/dockerfiles/centos8.docker | 1 +
>  tests/docker/dockerfiles/fedora.docker  | 1 +
>  3 files changed, 3 insertions(+)
>

Reviewed-by: Willian Rampazzo <willianr@redhat.com>



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH v1 06/25] docker: Add Hexagon image
  2021-04-19 14:54 ` [PATCH v1 06/25] docker: Add Hexagon image Alex Bennée
@ 2021-04-23 18:41   ` Willian Rampazzo
  2021-04-23 22:25   ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 47+ messages in thread
From: Willian Rampazzo @ 2021-04-23 18:41 UTC (permalink / raw)
  To: Alex Bennée
  Cc: Fam Zheng, Alessandro Di Federico, Thomas Huth, Daniel Berrange,
	Brian Cain, qemu-devel, Wainer dos Santos Moschetta,
	Philippe Mathieu-Daudé,
	Stefan Hajnoczi, Cleber Rosa Junior, Paolo Bonzini,
	Aurelien Jarno

On Mon, Apr 19, 2021 at 11:54 AM Alex Bennée <alex.bennee@linaro.org> wrote:
>
> From: Alessandro Di Federico <ale@rev.ng>
>
> This image is a little special because it takes a long time to build.
> As such most users don't want to be doing that and just pull random
> binaries from the ether as intended by the container gods. This
> involves someone with credentials and a beefy machine running:
>
>   make docker-image-debian-hexagon-cross V=1 NOCACHE=1 J=30
>   docker tag qemu/debian-hexagon-cross registry.gitlab.com/qemu-project/qemu/qemu/debian-hexagon-cross
>   docker push registry.gitlab.com/qemu-project/qemu/qemu/debian-hexagon-cross
>
> With a suitable binary in the "cloud" a normal user will run:
>
>   make docker-image-debian-hexagon-cross
>
> or have it run for them through the dependency mechanism of our
> over-engineered makefiles and get the binary they wanted. There are a
> few wrinkles of course including needing to tweak the final image to
> have the credentials of the user so we can actually do our cross
> compiles.
>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> Cc: Alessandro Di Federico <ale@rev.ng>
> Cc: Philippe Mathieu-Daudé <f4bug@amsat.org>
> Cc: Brian Cain <bcain@quicinc.com>
>
> ---
> vAJB:
>   - dropped all r-b/sob due to rewrite
>   - split into a multi-stage dockerfile
>   - make dockerfile standalone
>   - play fugly make games
> v2
>   - update LLVM version per BN7PR02MB4194DF5752EF3BADE858018DB8799@BN7PR02MB4194.namprd02.prod.outlook.com
> ---
>  MAINTAINERS                                   |   2 +
>  tests/docker/Makefile.include                 |  22 +++
>  .../dockerfiles/debian-hexagon-cross.docker   |  44 ++++++
>  .../build-toolchain.sh                        | 141 ++++++++++++++++++
>  4 files changed, 209 insertions(+)
>  create mode 100644 tests/docker/dockerfiles/debian-hexagon-cross.docker
>  create mode 100755 tests/docker/dockerfiles/debian-hexagon-cross.docker.d/build-toolchain.sh
>

Reviewed-by: Willian Rampazzo <willianr@redhat.com>



^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH v1 08/25] gitlab: add build-user-hexagon test
  2021-04-19 14:54 ` [PATCH v1 08/25] gitlab: add build-user-hexagon test Alex Bennée
  2021-04-23 18:38   ` Willian Rampazzo
@ 2021-04-23 22:23   ` Philippe Mathieu-Daudé
  2021-05-11 14:41   ` Alex Bennée
  2 siblings, 0 replies; 47+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-04-23 22:23 UTC (permalink / raw)
  To: Alex Bennée, qemu-devel
  Cc: fam, Thomas Huth, berrange, Wainer dos Santos Moschetta,
	Willian Rampazzo, stefanha, crosa, pbonzini, aurelien

On 4/19/21 4:54 PM, Alex Bennée wrote:
> We special case this as the container with the cross compiler for the
> tests takes so long to build it is manually uploaded into the
> registry.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
> Message-Id: <20210305092328.31792-7-alex.bennee@linaro.org>
> ---
>  .gitlab-ci.yml | 11 +++++++++++
>  1 file changed, 11 insertions(+)

Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>


^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH v1 07/25] tests/tcg: Use Hexagon Docker image
  2021-04-19 14:54 ` [PATCH v1 07/25] tests/tcg: Use Hexagon Docker image Alex Bennée
@ 2021-04-23 22:23   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 47+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-04-23 22:23 UTC (permalink / raw)
  To: Alex Bennée, qemu-devel
  Cc: fam, Alessandro Di Federico, berrange, stefanha, crosa, pbonzini,
	aurelien

On 4/19/21 4:54 PM, Alex Bennée wrote:
> From: Alessandro Di Federico <ale@rev.ng>
> 
> [PMD: Split from 'Add Hexagon Docker image' patch]
> 
> Signed-off-by: Alessandro Di Federico <ale@rev.ng>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> Message-Id: <20210228222314.304787-5-f4bug@amsat.org>
> Message-Id: <20210305092328.31792-6-alex.bennee@linaro.org>
> ---
>  tests/tcg/configure.sh | 4 ++++
>  1 file changed, 4 insertions(+)

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>


^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH v1 06/25] docker: Add Hexagon image
  2021-04-19 14:54 ` [PATCH v1 06/25] docker: Add Hexagon image Alex Bennée
  2021-04-23 18:41   ` Willian Rampazzo
@ 2021-04-23 22:25   ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 47+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-04-23 22:25 UTC (permalink / raw)
  To: Alex Bennée, qemu-devel
  Cc: fam, Alessandro Di Federico, Thomas Huth, berrange, Brian Cain,
	Wainer dos Santos Moschetta, Willian Rampazzo, stefanha, crosa,
	pbonzini, aurelien

On 4/19/21 4:54 PM, Alex Bennée wrote:
> From: Alessandro Di Federico <ale@rev.ng>
> 
> This image is a little special because it takes a long time to build.
> As such most users don't want to be doing that and just pull random
> binaries from the ether as intended by the container gods. This
> involves someone with credentials and a beefy machine running:
> 
>   make docker-image-debian-hexagon-cross V=1 NOCACHE=1 J=30
>   docker tag qemu/debian-hexagon-cross registry.gitlab.com/qemu-project/qemu/qemu/debian-hexagon-cross
>   docker push registry.gitlab.com/qemu-project/qemu/qemu/debian-hexagon-cross
> 
> With a suitable binary in the "cloud" a normal user will run:
> 
>   make docker-image-debian-hexagon-cross
> 
> or have it run for them through the dependency mechanism of our
> over-engineered makefiles and get the binary they wanted. There are a
> few wrinkles of course including needing to tweak the final image to
> have the credentials of the user so we can actually do our cross
> compiles.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> Cc: Alessandro Di Federico <ale@rev.ng>
> Cc: Philippe Mathieu-Daudé <f4bug@amsat.org>
> Cc: Brian Cain <bcain@quicinc.com>
> 
> ---
> vAJB:
>   - dropped all r-b/sob due to rewrite
>   - split into a multi-stage dockerfile
>   - make dockerfile standalone
>   - play fugly make games
> v2
>   - update LLVM version per BN7PR02MB4194DF5752EF3BADE858018DB8799@BN7PR02MB4194.namprd02.prod.outlook.com
> ---
>  MAINTAINERS                                   |   2 +
>  tests/docker/Makefile.include                 |  22 +++
>  .../dockerfiles/debian-hexagon-cross.docker   |  44 ++++++
>  .../build-toolchain.sh                        | 141 ++++++++++++++++++
>  4 files changed, 209 insertions(+)
>  create mode 100644 tests/docker/dockerfiles/debian-hexagon-cross.docker
>  create mode 100755 tests/docker/dockerfiles/debian-hexagon-cross.docker.d/build-toolchain.sh

Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>


^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH v1 10/25] tests/docker: Added libbpf library to the docker files.
  2021-04-19 14:54 ` [PATCH v1 10/25] tests/docker: Added libbpf library to the docker files Alex Bennée
  2021-04-23 18:39   ` Willian Rampazzo
@ 2021-04-23 22:30   ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 47+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-04-23 22:30 UTC (permalink / raw)
  To: Alex Bennée, qemu-devel
  Cc: fam, Andrew Melnychenko, berrange, Thomas Huth,
	Wainer dos Santos Moschetta, Willian Rampazzo, stefanha, crosa,
	pbonzini, aurelien

On 4/19/21 4:54 PM, Alex Bennée wrote:
> From: Andrew Melnychenko <andrew@daynix.com>
> 
> The series of patches for eBPF RSS adds libbpf dependency for qemu.
> https://lists.gnu.org/archive/html/qemu-devel/2021-03/msg08887.html
> 
> With this patch, libbpf added:
>   Alpine - added libbpf-dev
>   Centos 8 - added libbpf-devel
>   Fedora - added libbpf-devel
> 
> Signed-off-by: Andrew Melnychenko <andrew@daynix.com>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> Message-Id: <20210406082947.672708-2-andrew@daynix.com>
> ---
>  tests/docker/dockerfiles/alpine.docker  | 1 +
>  tests/docker/dockerfiles/centos8.docker | 1 +
>  tests/docker/dockerfiles/fedora.docker  | 1 +
>  3 files changed, 3 insertions(+)

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>


^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH v1 11/25] tests/tcg: Add docker_as and docker_ld cmds
  2021-04-19 14:54 ` [PATCH v1 11/25] tests/tcg: Add docker_as and docker_ld cmds Alex Bennée
@ 2021-04-23 22:31   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 47+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-04-23 22:31 UTC (permalink / raw)
  To: Alex Bennée, qemu-devel
  Cc: fam, berrange, Bastian Koppelmann, stefanha, crosa, pbonzini, aurelien

On 4/19/21 4:54 PM, Alex Bennée wrote:
> From: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
> 
> At least for the TriCore target no easily available c compiler exists.
> Thus we need to rely on "as" and "ld". This allows us to run them
> through the docker image. We don't test the generation capabilities of
> docker images as they are assumed to work.
> 
> Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
> [AJB: fix quoting, only handle docker & clear, test -n, tweak commit msg]
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>  tests/tcg/Makefile.qemu | 15 +++++++++++++++
>  tests/tcg/configure.sh  | 17 ++++++++++++++++-
>  2 files changed, 31 insertions(+), 1 deletion(-)

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>


^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH v1 13/25] hw/tricore: Add testdevice for tests in tests/tcg/
  2021-04-19 14:54 ` [PATCH v1 13/25] hw/tricore: Add testdevice for tests in tests/tcg/ Alex Bennée
@ 2021-04-26  9:37   ` Philippe Mathieu-Daudé
  2021-04-26 10:15     ` Alex Bennée
  0 siblings, 1 reply; 47+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-04-26  9:37 UTC (permalink / raw)
  To: Alex Bennée, Bastian Koppelmann
  Cc: fam, berrange, qemu-devel, stefanha, crosa, pbonzini, aurelien

On 4/19/21 4:54 PM, Alex Bennée wrote:
> From: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
> 
> this device is used to verify the correctness of regression tests by
> allowing guests to write their exit status to this device. This is then
> used by qemu to exit using the written status.
> 
> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
> Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> Message-Id: <20210305170045.869437-4-kbastian@mail.uni-paderborn.de>
> ---
>  include/hw/tricore/tricore_testdevice.h | 38 ++++++++++++
>  hw/tricore/tricore_testboard.c          |  8 +++
>  hw/tricore/tricore_testdevice.c         | 82 +++++++++++++++++++++++++
>  hw/tricore/meson.build                  |  1 +
>  4 files changed, 129 insertions(+)
>  create mode 100644 include/hw/tricore/tricore_testdevice.h
>  create mode 100644 hw/tricore/tricore_testdevice.c

> +#include "hw/tricore/tricore_testdevice.h"
> +
> +static void tricore_testdevice_write(void *opaque, hwaddr offset,
> +                                      uint64_t value, unsigned size)
> +{
> +    exit(value);

   ->  qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN);

I'd rather use a 2 steps check of value such watchdog devices do
(to be sure the guest is still in control and isn't nut).


A general comments, all targets require a such test feature,
so we should have a generic user-creatable sysbus-testdev for that.

Regards,

Phil.


^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH v1 13/25] hw/tricore: Add testdevice for tests in tests/tcg/
  2021-04-26  9:37   ` Philippe Mathieu-Daudé
@ 2021-04-26 10:15     ` Alex Bennée
  2021-04-26 12:03       ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 47+ messages in thread
From: Alex Bennée @ 2021-04-26 10:15 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: fam, berrange, Bastian Koppelmann, qemu-devel, stefanha, crosa,
	pbonzini, aurelien


Philippe Mathieu-Daudé <f4bug@amsat.org> writes:

> On 4/19/21 4:54 PM, Alex Bennée wrote:
>> From: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
>> 
>> this device is used to verify the correctness of regression tests by
>> allowing guests to write their exit status to this device. This is then
>> used by qemu to exit using the written status.
>> 
>> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
>> Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>> Message-Id: <20210305170045.869437-4-kbastian@mail.uni-paderborn.de>
>> ---
>>  include/hw/tricore/tricore_testdevice.h | 38 ++++++++++++
>>  hw/tricore/tricore_testboard.c          |  8 +++
>>  hw/tricore/tricore_testdevice.c         | 82 +++++++++++++++++++++++++
>>  hw/tricore/meson.build                  |  1 +
>>  4 files changed, 129 insertions(+)
>>  create mode 100644 include/hw/tricore/tricore_testdevice.h
>>  create mode 100644 hw/tricore/tricore_testdevice.c
>
>> +#include "hw/tricore/tricore_testdevice.h"
>> +
>> +static void tricore_testdevice_write(void *opaque, hwaddr offset,
>> +                                      uint64_t value, unsigned size)
>> +{
>> +    exit(value);
>
>    ->  qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN);
>
> I'd rather use a 2 steps check of value such watchdog devices do
> (to be sure the guest is still in control and isn't nut).

This isn't any different to what we do for TARGET_SYS_EXIT_EXTENDED or
the various other semihosting exits. Maybe we could do a better job of
flagging that these devices (or features) give the guest an avenue to
cause QEMU to shutdown but none of these are enabled by default.

>
> A general comments, all targets require a such test feature,
> so we should have a generic user-creatable sysbus-testdev for that.

We also have the isa-debug-exit device used by x86. I believe there is
also a PCI device (pci-testdev) used to submit error-exit results for
kvm-unit-tests.

I'm all for modelling a cleaner abstraction that could be used by all
these methods and avoiding multiple exit paths but I don't want to hold
up Bastian's tests to a higher standard without addressing the other
cases. In the meantime given it improves the testing situation for
Tricore I don't think it's a major issue.

>
> Regards,
>
> Phil.


-- 
Alex Bennée


^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH v1 13/25] hw/tricore: Add testdevice for tests in tests/tcg/
  2021-04-26 10:15     ` Alex Bennée
@ 2021-04-26 12:03       ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 47+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-04-26 12:03 UTC (permalink / raw)
  To: Alex Bennée
  Cc: fam, berrange, Bastian Koppelmann, qemu-devel, stefanha, crosa,
	pbonzini, aurelien

On 4/26/21 12:15 PM, Alex Bennée wrote:
> Philippe Mathieu-Daudé <f4bug@amsat.org> writes:
>> On 4/19/21 4:54 PM, Alex Bennée wrote:
>>> From: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
>>>
>>> this device is used to verify the correctness of regression tests by
>>> allowing guests to write their exit status to this device. This is then
>>> used by qemu to exit using the written status.
>>>
>>> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
>>> Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
>>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>>> Message-Id: <20210305170045.869437-4-kbastian@mail.uni-paderborn.de>
>>> ---
>>>  include/hw/tricore/tricore_testdevice.h | 38 ++++++++++++
>>>  hw/tricore/tricore_testboard.c          |  8 +++
>>>  hw/tricore/tricore_testdevice.c         | 82 +++++++++++++++++++++++++
>>>  hw/tricore/meson.build                  |  1 +
>>>  4 files changed, 129 insertions(+)
>>>  create mode 100644 include/hw/tricore/tricore_testdevice.h
>>>  create mode 100644 hw/tricore/tricore_testdevice.c
>>
>>> +#include "hw/tricore/tricore_testdevice.h"
>>> +
>>> +static void tricore_testdevice_write(void *opaque, hwaddr offset,
>>> +                                      uint64_t value, unsigned size)
>>> +{
>>> +    exit(value);
>>
>>    ->  qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN);
>>
>> I'd rather use a 2 steps check of value such watchdog devices do
>> (to be sure the guest is still in control and isn't nut).
> 
> This isn't any different to what we do for TARGET_SYS_EXIT_EXTENDED or
> the various other semihosting exits. Maybe we could do a better job of
> flagging that these devices (or features) give the guest an avenue to
> cause QEMU to shutdown but none of these are enabled by default.

My concern here is the console being modified and not being restored
correctly. Maybe not a problem for the current test, but could happens
later with more tests added, or the device re-used elsewhere.

This is a one-line change, which can be done later.

This concert also applies to the semihosting exit(). Can be done later too.

> 
>>
>> A general comments, all targets require a such test feature,
>> so we should have a generic user-creatable sysbus-testdev for that.
> 
> We also have the isa-debug-exit device used by x86. I believe there is
> also a PCI device (pci-testdev) used to submit error-exit results for
> kvm-unit-tests.
> 
> I'm all for modelling a cleaner abstraction that could be used by all
> these methods and avoiding multiple exit paths but I don't want to hold
> up Bastian's tests to a higher standard without addressing the other
> cases. In the meantime given it improves the testing situation for
> Tricore I don't think it's a major issue.

Agreed, not a major issue, my comment are not blocking this patch.

Thanks,

Phil.


^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH  v1 18/25] tests/tcg/tricore: Add clz test
  2021-04-19 14:54 ` [PATCH v1 18/25] tests/tcg/tricore: Add clz test Alex Bennée
@ 2021-04-29 13:53   ` Bastian Koppelmann
  0 siblings, 0 replies; 47+ messages in thread
From: Bastian Koppelmann @ 2021-04-29 13:53 UTC (permalink / raw)
  To: Alex Bennée
  Cc: fam, berrange, qemu-devel, f4bug, stefanha, crosa, pbonzini, aurelien

On Mon, Apr 19, 2021 at 03:54:28PM +0100, Alex Bennée wrote:
> From: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
> 
> Tested-by: Alex Bennée <alex.bennee@linaro.org>
> Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> Message-Id: <20210305170045.869437-9-kbastian@mail.uni-paderborn.de>
> ---
>  tests/tcg/tricore/Makefile.softmmu-target      |  1 +
>  tests/tcg/tricore/Makefile.softmmu-target.orig | 18 ++++++++++++++++++

Whoops, that file slipped in. Can you remove that, Alex?

Cheers,
Bastian


^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH  v1 08/25] gitlab: add build-user-hexagon test
  2021-04-19 14:54 ` [PATCH v1 08/25] gitlab: add build-user-hexagon test Alex Bennée
  2021-04-23 18:38   ` Willian Rampazzo
  2021-04-23 22:23   ` Philippe Mathieu-Daudé
@ 2021-05-11 14:41   ` Alex Bennée
  2021-05-11 14:53     ` Brian Cain
  2 siblings, 1 reply; 47+ messages in thread
From: Alex Bennée @ 2021-05-11 14:41 UTC (permalink / raw)
  To: qemu-devel
  Cc: fam, Brian Cain, Thomas Huth, berrange, f4bug,
	Wainer dos Santos Moschetta, Willian Rampazzo, Taylor Simpson,
	stefanha, crosa, pbonzini, Alex Bennée, aurelien


Alex Bennée <alex.bennee@linaro.org> writes:

> We special case this as the container with the cross compiler for the
> tests takes so long to build it is manually uploaded into the
> registry.

Gahh, something changed underneath me with the inclusion of:

  commit 46ef47e2a77d1a34996964760b4a0d2b19476f25
  Author: Taylor Simpson <tsimpson@quicinc.com>
  Date:   Thu Apr 8 20:07:50 2021 -0500

      Hexagon (target/hexagon) circular addressing

Which leads to the compiler complaining:

  hexagon-unknown-linux-musl-clang  -Wno-incompatible-pointer-types -Wno-undefined-internal -fno-unroll-loops -Wall -Werror -O0 -g -fno-strict-aliasing -mv67 -O2 -static /home
  /alex.bennee/lsrc/qemu.git/tests/tcg/hexagon/circ.c -o circ  -static
  /home/alex.bennee/lsrc/qemu.git/tests/tcg/hexagon/circ.c:257:1: error: unknown register name 'cs0' in asm
  TEST_LOAD_IMM(b,  char,           bbuf, NBYTES, 1, d)
  ^
  /home/alex.bennee/lsrc/qemu.git/tests/tcg/hexagon/circ.c:242:9: note: expanded from macro 'TEST_LOAD_IMM'
          CIRC_LOAD_IMM_##SZ(element, p, BUF, size * sizeof(TYPE), (INC)); \
          ^
  <scratch space>:9:1: note: expanded from here
  CIRC_LOAD_IMM_b
  ^
  /home/alex.bennee/lsrc/qemu.git/tests/tcg/hexagon/circ.c:75:5: note: expanded from macro 'CIRC_LOAD_IMM_b'
      CIRC_LOAD_IMM(b, RES, ADDR, START, LEN, INC)
      ^
  /home/alex.bennee/lsrc/qemu.git/tests/tcg/hexagon/circ.c:73:23: note: expanded from macro 'CIRC_LOAD_IMM'
          : "r4", "m0", "cs0")

I suspect the easiest thing to do is to drop the patches again so I
don't hold up the rest of testing/next. I can include the initial docker
image patch but I won't enable it in configure.sh/gitlab.

Would one of the hexagon guys be able to send a new image and verify it
works with the current tests in master?

>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
> Message-Id: <20210305092328.31792-7-alex.bennee@linaro.org>
> ---
>  .gitlab-ci.yml | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
> index 52d65d6c04..87d1172b03 100644
> --- a/.gitlab-ci.yml
> +++ b/.gitlab-ci.yml
> @@ -413,6 +413,17 @@ build-user-static:
>      CONFIGURE_ARGS: --disable-tools --disable-system --static
>      MAKE_CHECK_ARGS: check-tcg
>  
> +# Because the hexagon cross-compiler takes so long to build we don't rely
> +# on the CI system to build it and hence this job has no dependency
> +# declared. The image is manually uploaded.
> +build-user-hexagon:
> +  <<: *native_build_job_definition
> +  variables:
> +    IMAGE: debian-hexagon-cross
> +    TARGETS: hexagon-linux-user
> +    CONFIGURE_ARGS: --disable-tools --disable-docs --enable-debug-tcg
> +    MAKE_CHECK_ARGS: check-tcg
> +
>  # Only build the softmmu targets we have check-tcg tests for
>  build-some-softmmu:
>    <<: *native_build_job_definition


-- 
Alex Bennée


^ permalink raw reply	[flat|nested] 47+ messages in thread

* RE: [PATCH  v1 08/25] gitlab: add build-user-hexagon test
  2021-05-11 14:41   ` Alex Bennée
@ 2021-05-11 14:53     ` Brian Cain
  2021-05-11 15:08       ` Brian Cain
  0 siblings, 1 reply; 47+ messages in thread
From: Brian Cain @ 2021-05-11 14:53 UTC (permalink / raw)
  To: Alex Bennée, qemu-devel
  Cc: fam, Thomas Huth, berrange, f4bug, Wainer dos Santos Moschetta,
	Willian Rampazzo, Taylor Simpson, stefanha, crosa, pbonzini,
	aurelien

> -----Original Message-----
> From: Alex Bennée <alex.bennee@linaro.org>
...
> Which leads to the compiler complaining:
> 
>   hexagon-unknown-linux-musl-clang  -Wno-incompatible-pointer-types -
> Wno-undefined-internal -fno-unroll-loops -Wall -Werror -O0 -g -fno-strict-
> aliasing -mv67 -O2 -static /home
>   /alex.bennee/lsrc/qemu.git/tests/tcg/hexagon/circ.c -o circ  -static
>   /home/alex.bennee/lsrc/qemu.git/tests/tcg/hexagon/circ.c:257:1: error:
> unknown register name 'cs0' in asm
>   TEST_LOAD_IMM(b,  char,           bbuf, NBYTES, 1, d)
>   ^
>   /home/alex.bennee/lsrc/qemu.git/tests/tcg/hexagon/circ.c:242:9: note:
> expanded from macro 'TEST_LOAD_IMM'
>           CIRC_LOAD_IMM_##SZ(element, p, BUF, size * sizeof(TYPE), (INC)); \
>           ^
>   <scratch space>:9:1: note: expanded from here
>   CIRC_LOAD_IMM_b
>   ^
>   /home/alex.bennee/lsrc/qemu.git/tests/tcg/hexagon/circ.c:75:5: note:
> expanded from macro 'CIRC_LOAD_IMM_b'
>       CIRC_LOAD_IMM(b, RES, ADDR, START, LEN, INC)
>       ^
>   /home/alex.bennee/lsrc/qemu.git/tests/tcg/hexagon/circ.c:73:23: note:
> expanded from macro 'CIRC_LOAD_IMM'
>           : "r4", "m0", "cs0")
> 
> I suspect the easiest thing to do is to drop the patches again so I don't hold up
> the rest of testing/next. I can include the initial docker image patch but I
> won't enable it in configure.sh/gitlab.

Sorry -- I sent along a patch to update the LLVM_SRC_URL so that we would have the support we need for this test case.

> Would one of the hexagon guys be able to send a new image and verify it
> works with the current tests in master?

Sure, can do.  Do I need to update the container registry in gitlab somehow?  Or just share the patch to update the Dockerfile?

> >
> > Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> > Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> > Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
> > Message-Id: <20210305092328.31792-7-alex.bennee@linaro.org>
> > ---
> >  .gitlab-ci.yml | 11 +++++++++++
> >  1 file changed, 11 insertions(+)
> >
> > diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index
> > 52d65d6c04..87d1172b03 100644
> > --- a/.gitlab-ci.yml
> > +++ b/.gitlab-ci.yml
> > @@ -413,6 +413,17 @@ build-user-static:
> >      CONFIGURE_ARGS: --disable-tools --disable-system --static
> >      MAKE_CHECK_ARGS: check-tcg
> >
> > +# Because the hexagon cross-compiler takes so long to build we don't
> > +rely # on the CI system to build it and hence this job has no
> > +dependency # declared. The image is manually uploaded.
> > +build-user-hexagon:
> > +  <<: *native_build_job_definition
> > +  variables:
> > +    IMAGE: debian-hexagon-cross
> > +    TARGETS: hexagon-linux-user
> > +    CONFIGURE_ARGS: --disable-tools --disable-docs --enable-debug-tcg
> > +    MAKE_CHECK_ARGS: check-tcg
> > +
> >  # Only build the softmmu targets we have check-tcg tests for
> >  build-some-softmmu:
> >    <<: *native_build_job_definition
> 
> 
> --
> Alex Bennée

^ permalink raw reply	[flat|nested] 47+ messages in thread

* RE: [PATCH  v1 08/25] gitlab: add build-user-hexagon test
  2021-05-11 14:53     ` Brian Cain
@ 2021-05-11 15:08       ` Brian Cain
  2021-05-12  7:34         ` Alex Bennée
  0 siblings, 1 reply; 47+ messages in thread
From: Brian Cain @ 2021-05-11 15:08 UTC (permalink / raw)
  To: Alex Bennée, qemu-devel
  Cc: fam, Thomas Huth, berrange, f4bug, Wainer dos Santos Moschetta,
	Willian Rampazzo, Taylor Simpson, stefanha, crosa, pbonzini,
	aurelien

> -----Original Message-----
> From: Brian Cain
...
> > I suspect the easiest thing to do is to drop the patches again so I
> > don't hold up the rest of testing/next. I can include the initial
> > docker image patch but I won't enable it in configure.sh/gitlab.
> 
> Sorry -- I sent along a patch to update the LLVM_SRC_URL so that we would
> have the support we need for this test case.
> 
> > Would one of the hexagon guys be able to send a new image and verify
> > it works with the current tests in master?
> 
> Sure, can do.  Do I need to update the container registry in gitlab somehow?
> Or just share the patch to update the Dockerfile?

Reference:

https://www.mail-archive.com/qemu-devel@nongnu.org/msg796850.html

If you want, I can build and push the container.  Not sure I have the right credentials but I think we can sort that out.

-Brian

^ permalink raw reply	[flat|nested] 47+ messages in thread

* Re: [PATCH v1 08/25] gitlab: add build-user-hexagon test
  2021-05-11 15:08       ` Brian Cain
@ 2021-05-12  7:34         ` Alex Bennée
  0 siblings, 0 replies; 47+ messages in thread
From: Alex Bennée @ 2021-05-12  7:34 UTC (permalink / raw)
  To: Brian Cain
  Cc: Fam Zheng, Thomas Huth, Daniel P. Berrange, QEMU Developers,
	Wainer dos Santos Moschetta, Philippe Mathieu-Daudé,
	Willian Rampazzo, Taylor Simpson, Stefan Hajnoczi, Cleber Rosa,
	Paolo Bonzini, Aurelien Jarno

[-- Attachment #1: Type: text/plain, Size: 1182 bytes --]

Sorted now. I had applied the patch but was running into trouble because
although I'd pushed to the project registry when running on my gitlab
project it was using the personal registry. Will post v3 later today.

On Tue, 11 May 2021, 16:08 Brian Cain, <bcain@quicinc.com> wrote:

> > -----Original Message-----
> > From: Brian Cain
> ...
> > > I suspect the easiest thing to do is to drop the patches again so I
> > > don't hold up the rest of testing/next. I can include the initial
> > > docker image patch but I won't enable it in configure.sh/gitlab.
> >
> > Sorry -- I sent along a patch to update the LLVM_SRC_URL so that we would
> > have the support we need for this test case.
> >
> > > Would one of the hexagon guys be able to send a new image and verify
> > > it works with the current tests in master?
> >
> > Sure, can do.  Do I need to update the container registry in gitlab
> somehow?
> > Or just share the patch to update the Dockerfile?
>
> Reference:
>
> https://www.mail-archive.com/qemu-devel@nongnu.org/msg796850.html
>
> If you want, I can build and push the container.  Not sure I have the
> right credentials but I think we can sort that out.
>
> -Brian
>

[-- Attachment #2: Type: text/html, Size: 1791 bytes --]

^ permalink raw reply	[flat|nested] 47+ messages in thread

end of thread, other threads:[~2021-05-12  7:36 UTC | newest]

Thread overview: 47+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-19 14:54 [PATCH for post 6.0 v1 00/25] testing/next (hexagon/tricore/test cc) Alex Bennée
2021-04-19 14:54 ` [PATCH v1 01/25] checkpatch: Fix use of uninitialized value Alex Bennée
2021-04-19 14:54 ` [PATCH v1 02/25] tests/docker: fix copying of executable in "update" Alex Bennée
2021-04-23 17:35   ` Willian Rampazzo
2021-04-19 14:54 ` [PATCH v1 03/25] tests/docker: make executable an optional argument to "update" Alex Bennée
2021-04-23 17:37   ` Willian Rampazzo
2021-04-19 14:54 ` [PATCH v1 04/25] tests/docker: allow "update" to add the current user Alex Bennée
2021-04-23 18:35   ` Willian Rampazzo
2021-04-19 14:54 ` [PATCH v1 05/25] tests/docker: add "fetch" sub-command Alex Bennée
2021-04-23 18:37   ` Willian Rampazzo
2021-04-19 14:54 ` [PATCH v1 06/25] docker: Add Hexagon image Alex Bennée
2021-04-23 18:41   ` Willian Rampazzo
2021-04-23 22:25   ` Philippe Mathieu-Daudé
2021-04-19 14:54 ` [PATCH v1 07/25] tests/tcg: Use Hexagon Docker image Alex Bennée
2021-04-23 22:23   ` Philippe Mathieu-Daudé
2021-04-19 14:54 ` [PATCH v1 08/25] gitlab: add build-user-hexagon test Alex Bennée
2021-04-23 18:38   ` Willian Rampazzo
2021-04-23 22:23   ` Philippe Mathieu-Daudé
2021-05-11 14:41   ` Alex Bennée
2021-05-11 14:53     ` Brian Cain
2021-05-11 15:08       ` Brian Cain
2021-05-12  7:34         ` Alex Bennée
2021-04-19 14:54 ` [PATCH v1 09/25] tests/tcg: don't iterate through other arch compilers Alex Bennée
2021-04-19 14:54 ` [PATCH v1 10/25] tests/docker: Added libbpf library to the docker files Alex Bennée
2021-04-23 18:39   ` Willian Rampazzo
2021-04-23 22:30   ` Philippe Mathieu-Daudé
2021-04-19 14:54 ` [PATCH v1 11/25] tests/tcg: Add docker_as and docker_ld cmds Alex Bennée
2021-04-23 22:31   ` Philippe Mathieu-Daudé
2021-04-19 14:54 ` [PATCH v1 12/25] tests/tcg: Run timeout cmds using --foreground Alex Bennée
2021-04-19 14:54 ` [PATCH v1 13/25] hw/tricore: Add testdevice for tests in tests/tcg/ Alex Bennée
2021-04-26  9:37   ` Philippe Mathieu-Daudé
2021-04-26 10:15     ` Alex Bennée
2021-04-26 12:03       ` Philippe Mathieu-Daudé
2021-04-19 14:54 ` [PATCH v1 14/25] tests/tcg/tricore: Add build infrastructure Alex Bennée
2021-04-19 14:54 ` [PATCH v1 15/25] configure: Emit HOST_CC to config-host.mak Alex Bennée
2021-04-19 14:54 ` [PATCH v1 16/25] tests/tcg/tricore: Add macros to create tests and first test 'abs' Alex Bennée
2021-04-19 14:54 ` [PATCH v1 17/25] tests/tcg/tricore: Add bmerge test Alex Bennée
2021-04-19 14:54 ` [PATCH v1 18/25] tests/tcg/tricore: Add clz test Alex Bennée
2021-04-29 13:53   ` Bastian Koppelmann
2021-04-19 14:54 ` [PATCH v1 19/25] tests/tcg/tricore: Add dvstep test Alex Bennée
2021-04-19 14:54 ` [PATCH v1 20/25] tests/tcg/tricore: Add fadd test Alex Bennée
2021-04-19 14:54 ` [PATCH v1 21/25] tests/tcg/tricore: Add fmul test Alex Bennée
2021-04-19 14:54 ` [PATCH v1 22/25] tests/tcg/tricore: Add ftoi test Alex Bennée
2021-04-19 14:54 ` [PATCH v1 23/25] tests/tcg/tricore: Add madd test Alex Bennée
2021-04-19 14:54 ` [PATCH v1 24/25] tests/tcg/tricore: Add msub test Alex Bennée
2021-04-19 14:54 ` [PATCH v1 25/25] tests/tcg/tricore: Add muls test Alex Bennée
2021-04-19 15:51 ` [PATCH for post 6.0 v1 00/25] testing/next (hexagon/tricore/test cc) no-reply

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.