[PULL v2 00/14] testing fixes and semihosting console support

Alex Bennée posted 14 patches 4 years, 4 months ago
Only 6 patches received!
include/hw/semihosting/console.h          | 16 +++++++
include/hw/semihosting/semihost.h         |  4 ++
tests/tcg/arm/semicall.h                  | 35 ++++++++++++++
hw/i386/x86-iommu-stub.c                  |  9 ++++
hw/semihosting/console.c                  | 79 +++++++++++++++++++++++++++++++
linux-user/aarch64/cpu_loop.c             |  1 +
linux-user/arm/cpu_loop.c                 |  1 +
linux-user/arm/semihost.c                 | 27 +++++++++++
stubs/semihost.c                          |  4 ++
target/arm/arm-semi.c                     |  3 +-
target/arm/helper.c                       |  8 +---
target/arm/m_helper.c                     |  1 +
target/arm/translate-a64.c                |  2 +-
target/arm/translate.c                    |  6 +--
tests/tcg/aarch64/system/semiconsole.c    | 38 +++++++++++++++
tests/tcg/arm/semiconsole.c               | 27 +++++++++++
tests/tcg/arm/semihosting.c               | 21 +-------
vl.c                                      |  3 ++
.travis.yml                               | 30 +++++++-----
tests/Makefile.include                    |  2 +-
tests/fp/Makefile                         | 14 +++---
tests/tcg/aarch64/Makefile.softmmu-target | 11 ++++-
tests/tcg/aarch64/Makefile.target         |  7 +++
tests/tcg/arm/Makefile.target             | 28 +++++++++++
tests/vm/freebsd                          |  3 +-
tests/vm/openbsd                          |  4 +-
26 files changed, 328 insertions(+), 56 deletions(-)
create mode 100644 tests/tcg/arm/semicall.h
create mode 100644 tests/tcg/aarch64/system/semiconsole.c
create mode 100644 tests/tcg/arm/semiconsole.c
[PULL v2 00/14] testing fixes and semihosting console support
Posted by Alex Bennée 4 years, 4 months ago
The following changes since commit 035eed4c0d257c905a556fa0f4865a0c077b4e7f:

  Merge remote-tracking branch 'remotes/vivier/tags/q800-for-5.0-pull-request' into staging (2020-01-07 17:08:21 +0000)

are available in the Git repository at:

  https://github.com/stsquad/qemu.git tags/pull-testing-and-semihosting-090120-2

for you to fetch changes up to 486e58b188c1b093a8f64d4b5cd11ff5c3514cb2:

  tests/tcg: add user version of dumb-as-bricks semiconsole test (2020-01-09 11:41:29 +0000)

----------------------------------------------------------------
Testing fixes and semiconsole support:

  - build fix (missing x86-iommu stubs)
  - python fixes for freebsd and OSX
  - nicer reporting of acceptance failures
  - fix build nesting of fp-test (breaks bsds)
  - semihosting clean-ups
  - support for blocking semihosting console

----------------------------------------------------------------
Alex Bennée (8):
      travis.yml: duplicate before_script for MacOSX
      travis.yml: install homebrew python for OS X
      testing: don't nest build for fp-test
      target/arm: remove unused EXCP_SEMIHOST leg
      target/arm: only update pc after semihosting completes
      tests/tcg: add a dumb-as-bricks semihosting console test
      tests/tcg: extract __semi_call into a header and expand
      tests/tcg: add user version of dumb-as-bricks semiconsole test

Gerd Hoffmann (2):
      tests/vm: update openbsd to release 6.6
      freebsd: use python37

Keith Packard (1):
      semihosting: add qemu_semihosting_console_inc for SYS_READC

Philippe Mathieu-Daudé (1):
      hw/i386/x86-iommu: Add missing stubs

Wainer dos Santos Moschetta (2):
      travis.yml: avocado: Print logs of non-pass tests only
      travis.yml: Detach build and test steps

 include/hw/semihosting/console.h          | 16 +++++++
 include/hw/semihosting/semihost.h         |  4 ++
 tests/tcg/arm/semicall.h                  | 35 ++++++++++++++
 hw/i386/x86-iommu-stub.c                  |  9 ++++
 hw/semihosting/console.c                  | 79 +++++++++++++++++++++++++++++++
 linux-user/aarch64/cpu_loop.c             |  1 +
 linux-user/arm/cpu_loop.c                 |  1 +
 linux-user/arm/semihost.c                 | 27 +++++++++++
 stubs/semihost.c                          |  4 ++
 target/arm/arm-semi.c                     |  3 +-
 target/arm/helper.c                       |  8 +---
 target/arm/m_helper.c                     |  1 +
 target/arm/translate-a64.c                |  2 +-
 target/arm/translate.c                    |  6 +--
 tests/tcg/aarch64/system/semiconsole.c    | 38 +++++++++++++++
 tests/tcg/arm/semiconsole.c               | 27 +++++++++++
 tests/tcg/arm/semihosting.c               | 21 +-------
 vl.c                                      |  3 ++
 .travis.yml                               | 30 +++++++-----
 tests/Makefile.include                    |  2 +-
 tests/fp/Makefile                         | 14 +++---
 tests/tcg/aarch64/Makefile.softmmu-target | 11 ++++-
 tests/tcg/aarch64/Makefile.target         |  7 +++
 tests/tcg/arm/Makefile.target             | 28 +++++++++++
 tests/vm/freebsd                          |  3 +-
 tests/vm/openbsd                          |  4 +-
 26 files changed, 328 insertions(+), 56 deletions(-)
 create mode 100644 tests/tcg/arm/semicall.h
 create mode 100644 tests/tcg/aarch64/system/semiconsole.c
 create mode 100644 tests/tcg/arm/semiconsole.c

-- 
2.20.1


Re: [PULL v2 00/14] testing fixes and semihosting console support
Posted by Peter Maydell 4 years, 4 months ago
On Thu, 9 Jan 2020 at 14:19, Alex Bennée <alex.bennee@linaro.org> wrote:
>
> The following changes since commit 035eed4c0d257c905a556fa0f4865a0c077b4e7f:
>
>   Merge remote-tracking branch 'remotes/vivier/tags/q800-for-5.0-pull-request' into staging (2020-01-07 17:08:21 +0000)
>
> are available in the Git repository at:
>
>   https://github.com/stsquad/qemu.git tags/pull-testing-and-semihosting-090120-2
>
> for you to fetch changes up to 486e58b188c1b093a8f64d4b5cd11ff5c3514cb2:
>
>   tests/tcg: add user version of dumb-as-bricks semiconsole test (2020-01-09 11:41:29 +0000)
>
> ----------------------------------------------------------------
> Testing fixes and semiconsole support:
>
>   - build fix (missing x86-iommu stubs)
>   - python fixes for freebsd and OSX
>   - nicer reporting of acceptance failures
>   - fix build nesting of fp-test (breaks bsds)
>   - semihosting clean-ups
>   - support for blocking semihosting console
>


Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/5.0
for any user-visible changes.

-- PMM

[PULL v2 01/14] hw/i386/x86-iommu: Add missing stubs
Posted by Alex Bennée 4 years, 4 months ago
From: Philippe Mathieu-Daudé <philmd@redhat.com>

In commit 6c730e4af9 we introduced a stub to build the MicroVM
machine without Intel IOMMU. This stub is incomplete for the
other PC machines. Add the missing stubs.

Fixes: 6c730e4af9
Reported-by: Travis-CI
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20191220154225.25879-1-philmd@redhat.com>

diff --git a/hw/i386/x86-iommu-stub.c b/hw/i386/x86-iommu-stub.c
index 03576cdccb4..c5ba077f9d1 100644
--- a/hw/i386/x86-iommu-stub.c
+++ b/hw/i386/x86-iommu-stub.c
@@ -32,3 +32,12 @@ X86IOMMUState *x86_iommu_get_default(void)
     return NULL;
 }
 
+bool x86_iommu_ir_supported(X86IOMMUState *s)
+{
+    return false;
+}
+
+IommuType x86_iommu_get_type(void)
+{
+    abort();
+}
-- 
2.20.1


[PULL v2 02/14] tests/vm: update openbsd to release 6.6
Posted by Alex Bennée 4 years, 4 months ago
From: Gerd Hoffmann <kraxel@redhat.com>

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20191018102443.26469-1-kraxel@redhat.com>

diff --git a/tests/vm/openbsd b/tests/vm/openbsd
index 6df5162dbf4..d6173506f78 100755
--- a/tests/vm/openbsd
+++ b/tests/vm/openbsd
@@ -22,8 +22,8 @@ class OpenBSDVM(basevm.BaseVM):
     name = "openbsd"
     arch = "x86_64"
 
-    link = "https://cdn.openbsd.org/pub/OpenBSD/6.5/amd64/install65.iso"
-    csum = "38d1f8cadd502f1c27bf05c5abde6cc505dd28f3f34f8a941048ff9a54f9f608"
+    link = "https://cdn.openbsd.org/pub/OpenBSD/6.6/amd64/install66.iso"
+    csum = "b22e63df56e6266de6bbeed8e9be0fbe9ee2291551c5bc03f3cc2e4ab9436ee3"
     size = "20G"
     pkgs = [
         # tools
-- 
2.20.1


[PULL v2 03/14] freebsd: use python37
Posted by Alex Bennée 4 years, 4 months ago
From: Gerd Hoffmann <kraxel@redhat.com>

FreeBSD seems to use python37 by default now, which breaks the build
script.  Add python to the package list, to explicitly pick the version,
and also adapt the configure command line.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20200106123746.18201-1-kraxel@redhat.com>

diff --git a/tests/vm/freebsd b/tests/vm/freebsd
index 1825cc58218..33a736298a9 100755
--- a/tests/vm/freebsd
+++ b/tests/vm/freebsd
@@ -32,6 +32,7 @@ class FreeBSDVM(basevm.BaseVM):
         "git",
         "pkgconf",
         "bzip2",
+        "python37",
 
         # gnu tools
         "bash",
@@ -63,7 +64,7 @@ class FreeBSDVM(basevm.BaseVM):
         mkdir src build; cd src;
         tar -xf /dev/vtbd1;
         cd ../build
-        ../src/configure --python=python3.6 {configure_opts};
+        ../src/configure --python=python3.7 {configure_opts};
         gmake --output-sync -j{jobs} {target} {verbose};
     """
 
-- 
2.20.1


[PULL v2 04/14] travis.yml: avocado: Print logs of non-pass tests only
Posted by Alex Bennée 4 years, 4 months ago
From: Wainer dos Santos Moschetta <wainersm@redhat.com>

The acceptance tests build on Travis is configured to print
the entire Avocado's job log in case any test fail. Usually one is
interested on failed tests only though. So this change the Travis
configuration in order to show the log of tests which status is
different from 'PASS' and 'SKIP' only. Note that 'CANCEL'-ed tests
will have the log printed too because it can help to debug some
condition on CI environment which is not being fulfilled.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20191230184327.2800-2-wainersm@redhat.com>

diff --git a/.travis.yml b/.travis.yml
index 638fba4799a..93838bf0f8b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -262,8 +262,8 @@ matrix:
     - env:
         - CONFIG="--python=/usr/bin/python3 --target-list=x86_64-softmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmmu,alpha-softmmu,ppc-softmmu,ppc64-softmmu,m68k-softmmu,sparc-softmmu"
         - TEST_CMD="make check-acceptance"
-      after_failure:
-        - cat tests/results/latest/job.log
+      after_script:
+        - python3 -c 'import json; r = json.load(open("tests/results/latest/results.json")); [print(t["logfile"]) for t in r["tests"] if t["status"] not in ("PASS", "SKIP")]' | xargs cat
       addons:
         apt:
           packages:
-- 
2.20.1


[PULL v2 05/14] travis.yml: Detach build and test steps
Posted by Alex Bennée 4 years, 4 months ago
From: Wainer dos Santos Moschetta <wainersm@redhat.com>

Currently build and test commands are a single step in a
Travis's `script` block. In order to see the output
of the tests one needs to scroll down the log to find where
the build messages ended and the limit is not clear. If
they were in different steps then Travis would print the
result build command, which can be easily grep'ed.

So this change is made to detach those commands
to ease the visualization of the output.

Note that all steps on the `script` block is executed regardless
if one previous has failed. To overcome it, let's save the
return code of the build then check whether succeed or failed on
the test step.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20191230184327.2800-3-wainersm@redhat.com>

diff --git a/.travis.yml b/.travis.yml
index 93838bf0f8b..848a2714efe 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -94,7 +94,8 @@ before_script:
   - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
   - ${SRC_DIR}/configure ${BASE_CONFIG} ${CONFIG} || { cat config.log && exit 1; }
 script:
-  - make -j3 && travis_retry ${TEST_CMD}
+  - BUILD_RC=0 && make -j3 || BUILD_RC=$?
+  - if [ "$BUILD_RC" -eq 0 ] ; then travis_retry ${TEST_CMD} ; else $(exit $BUILD_RC); fi
 after_script:
   - if command -v ccache ; then ccache --show-stats ; fi
 
-- 
2.20.1


[PULL v2 06/14] travis.yml: duplicate before_script for MacOSX
Posted by Alex Bennée 4 years, 4 months ago
Rather than keep the hack in the global code lets "Think Different"
and have a special copy for MacOSX.

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

diff --git a/.travis.yml b/.travis.yml
index 848a2714efe..6826618ea81 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -89,7 +89,6 @@ git:
 
 
 before_script:
-  - if [ "$TRAVIS_OS_NAME" == "osx" ] ; then export PATH="/usr/local/opt/ccache/libexec:$PATH" ; fi
   - if command -v ccache ; then ccache --zero-stats ; fi
   - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
   - ${SRC_DIR}/configure ${BASE_CONFIG} ${CONFIG} || { cat config.log && exit 1; }
@@ -240,6 +239,11 @@ matrix:
       os: osx
       osx_image: xcode10.3
       compiler: clang
+      before_script:
+        - export PATH="/usr/local/opt/ccache/libexec:$PATH"
+        - if command -v ccache ; then ccache --zero-stats ; fi
+        - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
+        - ${SRC_DIR}/configure ${BASE_CONFIG} ${CONFIG} || { cat config.log && exit 1; }
 
 
     # Python builds
-- 
2.20.1


[PULL v2 07/14] travis.yml: install homebrew python for OS X
Posted by Alex Bennée 4 years, 4 months ago
Our python3 requirements now outstrip those of the build. While we are
at it we can move more of the special casing for Mac into the one
build we have.

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

diff --git a/.travis.yml b/.travis.yml
index 6826618ea81..6c1038a0f1a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -51,13 +51,6 @@ addons:
       - sparse
       - uuid-dev
       - gcovr
-  homebrew:
-    packages:
-      - ccache
-      - glib
-      - pixman
-      - gnu-sed
-    update: true
 
 
 # The channel name "irc.oftc.net#qemu" is encrypted against qemu/qemu
@@ -239,7 +232,17 @@ matrix:
       os: osx
       osx_image: xcode10.3
       compiler: clang
+      addons:
+        homebrew:
+          packages:
+            - ccache
+            - glib
+            - pixman
+            - gnu-sed
+            - python
+          update: true
       before_script:
+        - brew link --overwrite python
         - export PATH="/usr/local/opt/ccache/libexec:$PATH"
         - if command -v ccache ; then ccache --zero-stats ; fi
         - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
-- 
2.20.1


[PULL v2 09/14] target/arm: remove unused EXCP_SEMIHOST leg
Posted by Alex Bennée 4 years, 4 months ago
All semihosting exceptions are dealt with earlier in the common code
so we should never get here.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
Tested-by: Keith Packard <keithp@keithp.com>

diff --git a/target/arm/helper.c b/target/arm/helper.c
index b6bec42f48e..da22c198006 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -8566,12 +8566,6 @@ static void arm_cpu_do_interrupt_aarch64(CPUState *cs)
     case EXCP_VFIQ:
         addr += 0x100;
         break;
-    case EXCP_SEMIHOST:
-        qemu_log_mask(CPU_LOG_INT,
-                      "...handling as semihosting call 0x%" PRIx64 "\n",
-                      env->xregs[0]);
-        env->xregs[0] = do_arm_semihosting(env);
-        return;
     default:
         cpu_abort(cs, "Unhandled exception 0x%x\n", cs->exception_index);
     }
-- 
2.20.1