qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PULL 00/14] Gitlab-CI improvements and related fixes
@ 2020-09-07 12:11 Thomas Huth
  2020-09-07 12:11 ` [PULL 01/14] tests/docker: add python3-setuptools the docker images Thomas Huth
                   ` (15 more replies)
  0 siblings, 16 replies; 18+ messages in thread
From: Thomas Huth @ 2020-09-07 12:11 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell; +Cc: Yonggang Luo

 Hi Peter,

the following changes since commit 7c37270b3fbe3d034ba80e488761461676e21eb4:

  Merge remote-tracking branch 'remotes/kraxel/tags/ui-20200904-pull-request' into staging (2020-09-06 16:23:55 +0100)

are available in the Git repository at:

  https://gitlab.com/huth/qemu.git tags/pull-request-2020-09-07

for you to fetch changes up to 88e74b6122bb40852b1c98befd47a572f0c06930:

  target/microblaze: Collected fixes for env->iflags (2020-09-07 12:34:17 +0200)

----------------------------------------------------------------
* Fixes for cross-compiling with MinGW / compiling with MSYS2
* Enable cross-compiler builds in the Gitlab CI
* Improvements / fixes for the crypto tests in the Gitlab CI
* Fix for the "make check-acceptance" microblaze failure
  (required to get the Gitlab CI green again)
----------------------------------------------------------------

Alex Bennée (1):
      tests/docker: add python3-setuptools the docker images

Daniel P. Berrangé (2):
      crypto: fix build with gcrypt enabled
      gitlab: expand test coverage for crypto builds

Paolo Bonzini (1):
      tests/qtest: do not list ahci-test twice

Richard Henderson (1):
      target/microblaze: Collected fixes for env->iflags

Thomas Huth (6):
      tests/Makefile: test-image-locking needs CONFIG_POSIX
      dockerfiles/debian-win64-cross: Download WHPX MinGW headers
      configure: Allow automatic WHPX detection
      stubs: Move qemu_timer_notify_cb() and remove qemu_notify_event() stub
      stubs: Move qemu_fd_register stub to util/main-loop.c
      gitlab-ci: Add cross-compiling build tests

Yonggang Luo (3):
      tests: handling signal on win32 properly
      tests: fixes test-vmstate.c compile error on msys2
      tests: Fixes building test-util-filemonitor.c on msys2/mingw

 .gitlab-ci.d/crossbuilds.yml                       | 113 +++++++++++++++++++++
 .gitlab-ci.yml                                     |  69 +++++++++++++
 MAINTAINERS                                        |   1 +
 configure                                          |   3 +
 crypto/meson.build                                 |  42 ++++++--
 meson.build                                        |   5 +
 stubs/cpu-get-icount.c                             |   5 -
 stubs/fd-register.c                                |   6 --
 stubs/meson.build                                  |   3 +-
 stubs/notify-event.c                               |   6 --
 stubs/qemu-timer-notify-cb.c                       |   8 ++
 target/microblaze/cpu.c                            |  11 ++
 target/microblaze/cpu.h                            |   3 +-
 target/microblaze/helper.c                         |  17 ++--
 target/microblaze/translate.c                      |   4 +-
 tests/Makefile.include                             |   2 +
 tests/docker/dockerfiles/centos7.docker            |   2 +
 tests/docker/dockerfiles/centos8.docker            |   1 +
 tests/docker/dockerfiles/debian-win64-cross.docker |   9 +-
 tests/docker/dockerfiles/debian10.docker           |   1 +
 tests/docker/dockerfiles/debian9.docker            |   1 +
 tests/qtest/meson.build                            |   1 -
 tests/test-replication.c                           |   4 +
 tests/test-util-filemonitor.c                      |   4 +-
 tests/test-vmstate.c                               |   4 +-
 util/main-loop.c                                   |   4 +
 26 files changed, 285 insertions(+), 44 deletions(-)
 create mode 100644 .gitlab-ci.d/crossbuilds.yml
 delete mode 100644 stubs/fd-register.c
 delete mode 100644 stubs/notify-event.c
 create mode 100644 stubs/qemu-timer-notify-cb.c



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

* [PULL 01/14] tests/docker: add python3-setuptools the docker images
  2020-09-07 12:11 [PULL 00/14] Gitlab-CI improvements and related fixes Thomas Huth
@ 2020-09-07 12:11 ` Thomas Huth
  2020-09-07 12:11 ` [PULL 02/14] tests: handling signal on win32 properly Thomas Huth
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: Thomas Huth @ 2020-09-07 12:11 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell; +Cc: Yonggang Luo

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

We need these now for builds to work.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20200903112107.27367-4-alex.bennee@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/docker/dockerfiles/debian10.docker | 1 +
 tests/docker/dockerfiles/debian9.docker  | 1 +
 2 files changed, 2 insertions(+)

diff --git a/tests/docker/dockerfiles/debian10.docker b/tests/docker/dockerfiles/debian10.docker
index bcdff04ddf..e3c11a454e 100644
--- a/tests/docker/dockerfiles/debian10.docker
+++ b/tests/docker/dockerfiles/debian10.docker
@@ -29,6 +29,7 @@ RUN apt update && \
         pkg-config \
         psmisc \
         python3 \
+        python3-setuptools \
         python3-sphinx \
         texinfo \
         $(apt-get -s build-dep qemu | egrep ^Inst | fgrep '[all]' | cut -d\  -f2)
diff --git a/tests/docker/dockerfiles/debian9.docker b/tests/docker/dockerfiles/debian9.docker
index 0f0ebe530a..3edb5147ef 100644
--- a/tests/docker/dockerfiles/debian9.docker
+++ b/tests/docker/dockerfiles/debian9.docker
@@ -28,4 +28,5 @@ RUN apt update && \
         pkg-config \
         psmisc \
         python3 \
+        python3-setuptools \
         $(apt-get -s build-dep qemu | egrep ^Inst | fgrep '[all]' | cut -d\  -f2)
-- 
2.18.2



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

* [PULL 02/14] tests: handling signal on win32 properly
  2020-09-07 12:11 [PULL 00/14] Gitlab-CI improvements and related fixes Thomas Huth
  2020-09-07 12:11 ` [PULL 01/14] tests/docker: add python3-setuptools the docker images Thomas Huth
@ 2020-09-07 12:11 ` Thomas Huth
  2020-09-07 12:11 ` [PULL 03/14] tests: fixes test-vmstate.c compile error on msys2 Thomas Huth
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: Thomas Huth @ 2020-09-07 12:11 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell; +Cc: Yonggang Luo

From: Yonggang Luo <luoyonggang@gmail.com>

SIGABRT should use signal(SIGABRT, sigabrt_handler) to handle on win32

The error:
E:/CI-Cor-Ready/xemu/qemu.org/tests/test-replication.c:559:33: error: invalid use of undefined type 'struct sigaction'
  559 |     sigact = (struct sigaction) {
      |                                 ^

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Message-Id: <20200902170054.810-6-luoyonggang@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/test-replication.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/test-replication.c b/tests/test-replication.c
index e0b03dafc2..9ab3666a90 100644
--- a/tests/test-replication.c
+++ b/tests/test-replication.c
@@ -554,6 +554,9 @@ static void sigabrt_handler(int signo)
 
 static void setup_sigabrt_handler(void)
 {
+#ifdef _WIN32
+    signal(SIGABRT, sigabrt_handler);
+#else
     struct sigaction sigact;
 
     sigact = (struct sigaction) {
@@ -562,6 +565,7 @@ static void setup_sigabrt_handler(void)
     };
     sigemptyset(&sigact.sa_mask);
     sigaction(SIGABRT, &sigact, NULL);
+#endif
 }
 
 int main(int argc, char **argv)
-- 
2.18.2



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

* [PULL 03/14] tests: fixes test-vmstate.c compile error on msys2
  2020-09-07 12:11 [PULL 00/14] Gitlab-CI improvements and related fixes Thomas Huth
  2020-09-07 12:11 ` [PULL 01/14] tests/docker: add python3-setuptools the docker images Thomas Huth
  2020-09-07 12:11 ` [PULL 02/14] tests: handling signal on win32 properly Thomas Huth
@ 2020-09-07 12:11 ` Thomas Huth
  2020-09-07 12:11 ` [PULL 04/14] tests: Fixes building test-util-filemonitor.c on msys2/mingw Thomas Huth
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: Thomas Huth @ 2020-09-07 12:11 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell; +Cc: Yonggang Luo

From: Yonggang Luo <luoyonggang@gmail.com>

../tests/test-vmstate.c: In function 'int_cmp':
../tests/test-vmstate.c:884:5: error: unknown type name 'uint'; did you mean 'uInt'?
  884 |     uint ua = GPOINTER_TO_UINT(a);
      |     ^~~~
      |     uInt
../tests/test-vmstate.c:885:5: error: unknown type name 'uint'; did you mean 'uInt'?
  885 |     uint ub = GPOINTER_TO_UINT(b);
      |     ^~~~
      |     uInt
make: *** [Makefile.ninja:5461:tests/test-vmstate.exe.p/test-vmstate.c.obj] 错误 1

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Message-Id: <20200905063813.1875-1-luoyonggang@gmail.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/test-vmstate.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/test-vmstate.c b/tests/test-vmstate.c
index f7b3868881..f8de709a0b 100644
--- a/tests/test-vmstate.c
+++ b/tests/test-vmstate.c
@@ -881,8 +881,8 @@ static gint interval_cmp(gconstpointer a, gconstpointer b, gpointer user_data)
 /* ID comparison function */
 static gint int_cmp(gconstpointer a, gconstpointer b, gpointer user_data)
 {
-    uint ua = GPOINTER_TO_UINT(a);
-    uint ub = GPOINTER_TO_UINT(b);
+    guint ua = GPOINTER_TO_UINT(a);
+    guint ub = GPOINTER_TO_UINT(b);
     return (ua > ub) - (ua < ub);
 }
 
-- 
2.18.2



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

* [PULL 04/14] tests: Fixes building test-util-filemonitor.c on msys2/mingw
  2020-09-07 12:11 [PULL 00/14] Gitlab-CI improvements and related fixes Thomas Huth
                   ` (2 preceding siblings ...)
  2020-09-07 12:11 ` [PULL 03/14] tests: fixes test-vmstate.c compile error on msys2 Thomas Huth
@ 2020-09-07 12:11 ` Thomas Huth
  2020-09-07 12:11 ` [PULL 05/14] tests/Makefile: test-image-locking needs CONFIG_POSIX Thomas Huth
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: Thomas Huth @ 2020-09-07 12:11 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell; +Cc: Yonggang Luo

From: Yonggang Luo <luoyonggang@gmail.com>

Fixes the following compiling error:
../tests/test-util-filemonitor.c: In function 'test_file_monitor_events':
../tests/test-util-filemonitor.c:620:17: error: too many arguments to function 'mkdir'
  620 |             if (mkdir(pathsrc, 0700) < 0) {
      |                 ^~~~~
In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/unistd.h:10,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:93,
                 from ../tests/test-util-filemonitor.c:21:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/io.h:282:15: note: declared here
  282 |   int __cdecl mkdir (const char *) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
      |               ^~~~~

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Message-Id: <20200905203425.1470-1-luoyonggang@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/test-util-filemonitor.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/test-util-filemonitor.c b/tests/test-util-filemonitor.c
index 8f0eff3d03..b629e10857 100644
--- a/tests/test-util-filemonitor.c
+++ b/tests/test-util-filemonitor.c
@@ -23,6 +23,8 @@
 #include "qapi/error.h"
 #include "qemu/filemonitor.h"
 
+#include <glib/gstdio.h>
+
 #include <utime.h>
 
 enum {
@@ -617,7 +619,7 @@ test_file_monitor_events(void)
             if (debug) {
                 g_printerr("Mkdir %s\n", pathsrc);
             }
-            if (mkdir(pathsrc, 0700) < 0) {
+            if (g_mkdir_with_parents(pathsrc, 0700) < 0) {
                 g_printerr("Unable to mkdir %s: %s",
                            pathsrc, strerror(errno));
                 goto cleanup;
-- 
2.18.2



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

* [PULL 05/14] tests/Makefile: test-image-locking needs CONFIG_POSIX
  2020-09-07 12:11 [PULL 00/14] Gitlab-CI improvements and related fixes Thomas Huth
                   ` (3 preceding siblings ...)
  2020-09-07 12:11 ` [PULL 04/14] tests: Fixes building test-util-filemonitor.c on msys2/mingw Thomas Huth
@ 2020-09-07 12:11 ` Thomas Huth
  2020-09-07 12:11 ` [PULL 06/14] dockerfiles/debian-win64-cross: Download WHPX MinGW headers Thomas Huth
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: Thomas Huth @ 2020-09-07 12:11 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell; +Cc: Yonggang Luo

test-image-locking.c uses the qemu_lock_fd_test() function which is
only available on POSIX-like systems.

Message-Id: <20200804170055.2851-4-thuth@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Message-Id: <20200823111757.72002-4-thuth@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/Makefile.include | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/Makefile.include b/tests/Makefile.include
index 9ac8f5b86a..497f1f21ff 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -87,7 +87,9 @@ check-unit-$(CONFIG_BLOCK) += tests/test-blockjob$(EXESUF)
 check-unit-$(CONFIG_BLOCK) += tests/test-blockjob-txn$(EXESUF)
 check-unit-$(CONFIG_BLOCK) += tests/test-block-backend$(EXESUF)
 check-unit-$(CONFIG_BLOCK) += tests/test-block-iothread$(EXESUF)
+ifeq ($(CONFIG_POSIX),y)
 check-unit-$(CONFIG_BLOCK) += tests/test-image-locking$(EXESUF)
+endif
 check-unit-y += tests/test-x86-cpuid$(EXESUF)
 # all code tested by test-x86-cpuid is inside topology.h
 ifeq ($(CONFIG_SOFTMMU),y)
-- 
2.18.2



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

* [PULL 06/14] dockerfiles/debian-win64-cross: Download WHPX MinGW headers
  2020-09-07 12:11 [PULL 00/14] Gitlab-CI improvements and related fixes Thomas Huth
                   ` (4 preceding siblings ...)
  2020-09-07 12:11 ` [PULL 05/14] tests/Makefile: test-image-locking needs CONFIG_POSIX Thomas Huth
@ 2020-09-07 12:11 ` Thomas Huth
  2020-09-07 12:11 ` [PULL 07/14] configure: Allow automatic WHPX detection Thomas Huth
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: Thomas Huth @ 2020-09-07 12:11 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell; +Cc: Yonggang Luo

To compile-test the WHPX accelerator, we need to download these system
headers first (they are unfortunately not part of any released and
packaged MinGW toolchain yet).

Idea taken from another patch by Stefan Weil.

Message-Id: <20200804170055.2851-12-thuth@redhat.com>
Message-Id: <20200823111757.72002-6-thuth@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/docker/dockerfiles/debian-win64-cross.docker | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/tests/docker/dockerfiles/debian-win64-cross.docker b/tests/docker/dockerfiles/debian-win64-cross.docker
index 2fc9cfcbc6..4cc4a3f365 100644
--- a/tests/docker/dockerfiles/debian-win64-cross.docker
+++ b/tests/docker/dockerfiles/debian-win64-cross.docker
@@ -32,7 +32,14 @@ RUN apt-get update && \
         mxe-$TARGET-w64-mingw32.shared-sdl2 \
         mxe-$TARGET-w64-mingw32.shared-sdl2-mixer \
         mxe-$TARGET-w64-mingw32.shared-sdl2-gfx \
-        mxe-$TARGET-w64-mingw32.shared-zlib
+        mxe-$TARGET-w64-mingw32.shared-zlib \
+        curl && \
+    curl -s -S -o /usr/lib/mxe/usr/x86_64-w64-mingw32.shared/include/WinHvEmulation.h \
+        "https://sourceforge.net/p/mingw-w64/mingw-w64/ci/master/tree/mingw-w64-headers/include/winhvemulation.h?format=raw" && \
+    curl -s -S -o /usr/lib/mxe/usr/x86_64-w64-mingw32.shared/include/WinHvPlatform.h \
+        "https://sourceforge.net/p/mingw-w64/mingw-w64/ci/master/tree/mingw-w64-headers/include/winhvplatform.h?format=raw" && \
+    curl -s -S -o /usr/lib/mxe/usr/x86_64-w64-mingw32.shared/include/winhvplatformdefs.h \
+        "https://sourceforge.net/p/mingw-w64/mingw-w64/ci/master/tree/mingw-w64-headers/include/winhvplatformdefs.h?format=raw"
 
 # Specify the cross prefix for this image (see tests/docker/common.rc)
 ENV QEMU_CONFIGURE_OPTS --cross-prefix=x86_64-w64-mingw32.shared-
-- 
2.18.2



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

* [PULL 07/14] configure: Allow automatic WHPX detection
  2020-09-07 12:11 [PULL 00/14] Gitlab-CI improvements and related fixes Thomas Huth
                   ` (5 preceding siblings ...)
  2020-09-07 12:11 ` [PULL 06/14] dockerfiles/debian-win64-cross: Download WHPX MinGW headers Thomas Huth
@ 2020-09-07 12:11 ` Thomas Huth
  2020-09-07 12:11 ` [PULL 08/14] stubs: Move qemu_timer_notify_cb() and remove qemu_notify_event() stub Thomas Huth
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: Thomas Huth @ 2020-09-07 12:11 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell; +Cc: Yonggang Luo

The whpx variable is currently initialized to "no" which causes the WHPX
check to skip the detection unless the user specified --enable-whpx.
Since the detection code should be able to figure it out correctly, let's
initialized the variable to "" on MinGW-builds for proper auto-detection
instead.

Message-Id: <20200804170055.2851-11-thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Message-Id: <20200823111757.72002-7-thuth@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 configure | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configure b/configure
index 922adbc43a..086c6d3197 100755
--- a/configure
+++ b/configure
@@ -849,6 +849,7 @@ case $targetos in
 MINGW32*)
   mingw32="yes"
   hax="yes"
+  whpx=""
   vhost_user="no"
   audio_possible_drivers="dsound sdl"
   if check_include dsound.h; then
-- 
2.18.2



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

* [PULL 08/14] stubs: Move qemu_timer_notify_cb() and remove qemu_notify_event() stub
  2020-09-07 12:11 [PULL 00/14] Gitlab-CI improvements and related fixes Thomas Huth
                   ` (6 preceding siblings ...)
  2020-09-07 12:11 ` [PULL 07/14] configure: Allow automatic WHPX detection Thomas Huth
@ 2020-09-07 12:11 ` Thomas Huth
  2020-09-07 12:11 ` [PULL 09/14] stubs: Move qemu_fd_register stub to util/main-loop.c Thomas Huth
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: Thomas Huth @ 2020-09-07 12:11 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell; +Cc: Yonggang Luo

When cross-compiling with MinGW, there are sometimes some weird linker
errors like:

ibqemuutil.a(util_main-loop.c.obj): In function `qemu_notify_event':
/builds/huth/qemu/build/../util/main-loop.c:139: multiple definition of
 `qemu_notify_event'
libqemuutil.a(stubs_notify-event.c.obj):/builds/huth/qemu/stubs/notify-event.c:5:
 first defined here
collect2: error: ld returned 1 exit status
/builds/huth/qemu/rules.mak:88: recipe for target 'tests/test-timed-average.exe'
 failed

It seems like it works better when the qemu_timer_notify_cb() stub (which
calls qemu_notify_event()) is in a separate file - then we can also even
remove the qemu_notify_event() stub now.

This patch is based on ideas from the patch "stubs: Remove qemu_notify_event()"
by Philippe Mathieu-Daudé and the patch "cpu-timers, icount: new modules" from
Claudio Fontana.

Message-Id: <20200902102433.304737-1-thuth@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 stubs/cpu-get-icount.c       | 5 -----
 stubs/meson.build            | 2 +-
 stubs/notify-event.c         | 6 ------
 stubs/qemu-timer-notify-cb.c | 8 ++++++++
 4 files changed, 9 insertions(+), 12 deletions(-)
 delete mode 100644 stubs/notify-event.c
 create mode 100644 stubs/qemu-timer-notify-cb.c

diff --git a/stubs/cpu-get-icount.c b/stubs/cpu-get-icount.c
index b35f844638..4001613240 100644
--- a/stubs/cpu-get-icount.c
+++ b/stubs/cpu-get-icount.c
@@ -14,8 +14,3 @@ int64_t cpu_get_icount_raw(void)
 {
     abort();
 }
-
-void qemu_timer_notify_cb(void *opaque, QEMUClockType type)
-{
-    qemu_notify_event();
-}
diff --git a/stubs/meson.build b/stubs/meson.build
index 019bd79c7a..e2dfedc2a7 100644
--- a/stubs/meson.build
+++ b/stubs/meson.build
@@ -24,9 +24,9 @@ stub_ss.add(files('machine-init-done.c'))
 stub_ss.add(files('migr-blocker.c'))
 stub_ss.add(files('monitor.c'))
 stub_ss.add(files('monitor-core.c'))
-stub_ss.add(files('notify-event.c'))
 stub_ss.add(files('pci-bus.c'))
 stub_ss.add(files('pci-host-piix.c'))
+stub_ss.add(files('qemu-timer-notify-cb.c'))
 stub_ss.add(files('qmp_memory_device.c'))
 stub_ss.add(files('qtest.c'))
 stub_ss.add(files('ram-block.c'))
diff --git a/stubs/notify-event.c b/stubs/notify-event.c
deleted file mode 100644
index 827bb52d1a..0000000000
--- a/stubs/notify-event.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include "qemu/osdep.h"
-#include "qemu/main-loop.h"
-
-void qemu_notify_event(void)
-{
-}
diff --git a/stubs/qemu-timer-notify-cb.c b/stubs/qemu-timer-notify-cb.c
new file mode 100644
index 0000000000..054b408b1c
--- /dev/null
+++ b/stubs/qemu-timer-notify-cb.c
@@ -0,0 +1,8 @@
+#include "qemu/osdep.h"
+#include "sysemu/cpus.h"
+#include "qemu/main-loop.h"
+
+void qemu_timer_notify_cb(void *opaque, QEMUClockType type)
+{
+    qemu_notify_event();
+}
-- 
2.18.2



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

* [PULL 09/14] stubs: Move qemu_fd_register stub to util/main-loop.c
  2020-09-07 12:11 [PULL 00/14] Gitlab-CI improvements and related fixes Thomas Huth
                   ` (7 preceding siblings ...)
  2020-09-07 12:11 ` [PULL 08/14] stubs: Move qemu_timer_notify_cb() and remove qemu_notify_event() stub Thomas Huth
@ 2020-09-07 12:11 ` Thomas Huth
  2020-09-07 12:11 ` [PULL 10/14] gitlab-ci: Add cross-compiling build tests Thomas Huth
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: Thomas Huth @ 2020-09-07 12:11 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell; +Cc: Yonggang Luo

The linker of MinGW sometimes runs into the following problem:

libqemuutil.a(util_main-loop.c.obj): In function `qemu_fd_register':
/builds/huth/qemu/build/../util/main-loop.c:331: multiple definition of
 `qemu_fd_register'
libqemuutil.a(stubs_fd-register.c.obj):/builds/huth/qemu/stubs/fd-register.c:5:
 first defined here
collect2: error: ld returned 1 exit status
/builds/huth/qemu/rules.mak:88: recipe for target 'tests/test-timed-average.exe'
 failed

qemu_fd_register() is defined in util/main-loop.c for WIN32, so let's simply
move the stub also there in the #else part of the corresponding #ifndef
to fix this problem.

Message-Id: <20200903054503.425435-1-thuth@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 stubs/fd-register.c | 6 ------
 stubs/meson.build   | 1 -
 util/main-loop.c    | 4 ++++
 3 files changed, 4 insertions(+), 7 deletions(-)
 delete mode 100644 stubs/fd-register.c

diff --git a/stubs/fd-register.c b/stubs/fd-register.c
deleted file mode 100644
index 63a4abdb20..0000000000
--- a/stubs/fd-register.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include "qemu/osdep.h"
-#include "qemu/main-loop.h"
-
-void qemu_fd_register(int fd)
-{
-}
diff --git a/stubs/meson.build b/stubs/meson.build
index e2dfedc2a7..e0b322bc28 100644
--- a/stubs/meson.build
+++ b/stubs/meson.build
@@ -9,7 +9,6 @@ stub_ss.add(files('cpu-get-clock.c'))
 stub_ss.add(files('cpu-get-icount.c'))
 stub_ss.add(files('dump.c'))
 stub_ss.add(files('error-printf.c'))
-stub_ss.add(files('fd-register.c'))
 stub_ss.add(files('fdset.c'))
 stub_ss.add(files('fw_cfg.c'))
 stub_ss.add(files('gdbstub.c'))
diff --git a/util/main-loop.c b/util/main-loop.c
index f69f055013..217c8d6056 100644
--- a/util/main-loop.c
+++ b/util/main-loop.c
@@ -179,6 +179,10 @@ static int max_priority;
 static int glib_pollfds_idx;
 static int glib_n_poll_fds;
 
+void qemu_fd_register(int fd)
+{
+}
+
 static void glib_pollfds_fill(int64_t *cur_timeout)
 {
     GMainContext *context = g_main_context_default();
-- 
2.18.2



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

* [PULL 10/14] gitlab-ci: Add cross-compiling build tests
  2020-09-07 12:11 [PULL 00/14] Gitlab-CI improvements and related fixes Thomas Huth
                   ` (8 preceding siblings ...)
  2020-09-07 12:11 ` [PULL 09/14] stubs: Move qemu_fd_register stub to util/main-loop.c Thomas Huth
@ 2020-09-07 12:11 ` Thomas Huth
  2020-09-07 12:11 ` [PULL 11/14] crypto: fix build with gcrypt enabled Thomas Huth
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: Thomas Huth @ 2020-09-07 12:11 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell; +Cc: Yonggang Luo

Now that we can use all our QEMU test containers in the gitlab-CI, we can
easily add some jobs that test cross-compilation for various architectures.
There is just only small ugliness: Since the shared runners on gitlab.com
are single-threaded, we have to split each compilation job into two parts
(--disable-user and --disable-system), and exclude some additional targets,
to avoid that the jobs are running too long and hitting the timeout of 1 h.

Message-Id: <20200823111757.72002-8-thuth@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 .gitlab-ci.d/crossbuilds.yml | 113 +++++++++++++++++++++++++++++++++++
 .gitlab-ci.yml               |   1 +
 MAINTAINERS                  |   1 +
 3 files changed, 115 insertions(+)
 create mode 100644 .gitlab-ci.d/crossbuilds.yml

diff --git a/.gitlab-ci.d/crossbuilds.yml b/.gitlab-ci.d/crossbuilds.yml
new file mode 100644
index 0000000000..4ec7226b5c
--- /dev/null
+++ b/.gitlab-ci.d/crossbuilds.yml
@@ -0,0 +1,113 @@
+
+.cross_system_build_job_template: &cross_system_build_job_definition
+  stage: build
+  image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:latest
+  script:
+    - mkdir build
+    - cd build
+    - PKG_CONFIG_PATH=$PKG_CONFIG_PATH
+      ../configure --enable-werror $QEMU_CONFIGURE_OPTS --disable-user
+        --target-list-exclude="aarch64-softmmu i386-softmmu microblaze-softmmu
+          mips-softmmu mipsel-softmmu mips64-softmmu ppc64-softmmu sh4-softmmu
+          xtensa-softmmu"
+    - make -j$(expr $(nproc) + 1) all check-build
+
+.cross_user_build_job_template: &cross_user_build_job_definition
+  stage: build
+  image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:latest
+  script:
+    - mkdir build
+    - cd build
+    - PKG_CONFIG_PATH=$PKG_CONFIG_PATH
+      ../configure --enable-werror $QEMU_CONFIGURE_OPTS --disable-system
+    - make -j$(expr $(nproc) + 1) all check-build
+
+cross-armel-system:
+  <<: *cross_system_build_job_definition
+  variables:
+    IMAGE: debian-armel-cross
+
+cross-armel-user:
+  <<: *cross_user_build_job_definition
+  variables:
+    IMAGE: debian-armel-cross
+
+cross-armhf-system:
+  <<: *cross_system_build_job_definition
+  variables:
+    IMAGE: debian-armhf-cross
+
+cross-armhf-user:
+  <<: *cross_user_build_job_definition
+  variables:
+    IMAGE: debian-armhf-cross
+
+cross-arm64-system:
+  <<: *cross_system_build_job_definition
+  variables:
+    IMAGE: debian-arm64-cross
+
+cross-arm64-user:
+  <<: *cross_user_build_job_definition
+  variables:
+    IMAGE: debian-arm64-cross
+
+cross-mips-system:
+  <<: *cross_system_build_job_definition
+  variables:
+    IMAGE: debian-mips-cross
+
+cross-mips-user:
+  <<: *cross_user_build_job_definition
+  variables:
+    IMAGE: debian-mips-cross
+
+cross-mipsel-system:
+  <<: *cross_system_build_job_definition
+  variables:
+    IMAGE: debian-mipsel-cross
+
+cross-mipsel-user:
+  <<: *cross_user_build_job_definition
+  variables:
+    IMAGE: debian-mipsel-cross
+
+cross-mips64el-system:
+  <<: *cross_system_build_job_definition
+  variables:
+    IMAGE: debian-mips64el-cross
+
+cross-mips64el-user:
+  <<: *cross_user_build_job_definition
+  variables:
+    IMAGE: debian-mips64el-cross
+
+cross-ppc64el-system:
+  <<: *cross_system_build_job_definition
+  variables:
+    IMAGE: debian-ppc64el-cross
+
+cross-ppc64el-user:
+  <<: *cross_user_build_job_definition
+  variables:
+    IMAGE: debian-ppc64el-cross
+
+cross-s390x-system:
+  <<: *cross_system_build_job_definition
+  variables:
+    IMAGE: debian-s390x-cross
+
+cross-s390x-user:
+  <<: *cross_user_build_job_definition
+  variables:
+    IMAGE: debian-s390x-cross
+
+cross-win32-system:
+  <<: *cross_system_build_job_definition
+  variables:
+    IMAGE: debian-win32-cross
+
+cross-win64-system:
+  <<: *cross_system_build_job_definition
+  variables:
+    IMAGE: debian-win64-cross
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index ff959e4e03..d677e00933 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -18,6 +18,7 @@ include:
   - local: '/.gitlab-ci.d/edk2.yml'
   - local: '/.gitlab-ci.d/opensbi.yml'
   - local: '/.gitlab-ci.d/containers.yml'
+  - local: '/.gitlab-ci.d/crossbuilds.yml'
 
 .native_build_job_template: &native_build_job_definition
   stage: build
diff --git a/MAINTAINERS b/MAINTAINERS
index b233da2a73..7d0a5e91e4 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3071,6 +3071,7 @@ M: Alex Bennée <alex.bennee@linaro.org>
 R: Wainer dos Santos Moschetta <wainersm@redhat.com>
 S: Maintained
 F: .gitlab-ci.yml
+F: .gitlab-ci.d/crossbuilds.yml
 
 Guest Test Compilation Support
 M: Alex Bennée <alex.bennee@linaro.org>
-- 
2.18.2



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

* [PULL 11/14] crypto: fix build with gcrypt enabled
  2020-09-07 12:11 [PULL 00/14] Gitlab-CI improvements and related fixes Thomas Huth
                   ` (9 preceding siblings ...)
  2020-09-07 12:11 ` [PULL 10/14] gitlab-ci: Add cross-compiling build tests Thomas Huth
@ 2020-09-07 12:11 ` Thomas Huth
  2020-09-07 12:11 ` [PULL 12/14] gitlab: expand test coverage for crypto builds Thomas Huth
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: Thomas Huth @ 2020-09-07 12:11 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell; +Cc: Yonggang Luo

From: Daniel P. Berrangé <berrange@redhat.com>

If nettle is disabled and gcrypt enabled, the compiler and linker flags
needed for gcrypt are not passed.

Gnutls was also not added as a dependancy when gcrypt is enabled.

Attempting to add the library dependencies at the same time as the
source dependencies is error prone, as there are alot of different
rules for picking which sources to use, and some of the source files
use code level conditionals intead. It is thus clearer to add the
library dependencies separately.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20200901133050.381844-2-berrange@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 configure          |  2 ++
 crypto/meson.build | 42 +++++++++++++++++++++++++++++++-----------
 meson.build        |  5 +++++
 3 files changed, 38 insertions(+), 11 deletions(-)

diff --git a/configure b/configure
index 086c6d3197..166193cef9 100755
--- a/configure
+++ b/configure
@@ -6963,6 +6963,8 @@ if test "$gcrypt" = "yes" ; then
   if test "$gcrypt_hmac" = "yes" ; then
     echo "CONFIG_GCRYPT_HMAC=y" >> $config_host_mak
   fi
+  echo "GCRYPT_CFLAGS=$gcrypt_cflags" >> $config_host_mak
+  echo "GCRYPT_LIBS=$gcrypt_libs" >> $config_host_mak
 fi
 if test "$nettle" = "yes" ; then
   echo "CONFIG_NETTLE=y" >> $config_host_mak
diff --git a/crypto/meson.build b/crypto/meson.build
index 18da7c8541..f6f5ce1ecd 100644
--- a/crypto/meson.build
+++ b/crypto/meson.build
@@ -23,24 +23,35 @@ crypto_ss.add(files(
   'tlssession.c',
 ))
 
-if 'CONFIG_GCRYPT' in config_host
-  wo_nettle = files('hash-gcrypt.c', 'pbkdf-gcrypt.c')
+if 'CONFIG_NETTLE' in config_host
+  crypto_ss.add(files('hash-nettle.c', 'hmac-nettle.c', 'pbkdf-nettle.c'))
+elif 'CONFIG_GCRYPT' in config_host
+  crypto_ss.add(files('hash-gcrypt.c', 'pbkdf-gcrypt.c'))
+  if 'CONFIG_GCRYPT_HMAC' in config_host
+    crypto_ss.add(files('hmac-gcrypt.c'))
+  else
+    crypto_ss.add(files('hmac-glib.c'))
+  endif
 else
-  wo_nettle = files('hash-glib.c', 'pbkdf-stub.c')
-endif
-if 'CONFIG_GCRYPT_HMAC' not in config_host
-  wo_nettle += files('hmac-glib.c')
+  crypto_ss.add(files('hash-glib.c', 'hmac-glib.c', 'pbkdf-stub.c'))
 endif
-crypto_ss.add(when: [nettle, 'CONFIG_NETTLE'],
-             if_true: files('hash-nettle.c', 'hmac-nettle.c', 'pbkdf-nettle.c'),
-             if_false: wo_nettle)
 
 crypto_ss.add(when: 'CONFIG_SECRET_KEYRING', if_true: files('secret_keyring.c'))
 crypto_ss.add(when: 'CONFIG_QEMU_PRIVATE_XTS', if_true: files('xts.c'))
-crypto_ss.add(when: 'CONFIG_GCRYPT_HMAC', if_true: files('hmac-gcrypt.c'))
 crypto_ss.add(when: 'CONFIG_AF_ALG', if_true: files('afalg.c', 'cipher-afalg.c', 'hash-afalg.c'))
 crypto_ss.add(when: 'CONFIG_GNUTLS', if_true: files('tls-cipher-suites.c'))
 
+if 'CONFIG_NETTLE' in config_host
+  crypto_ss.add(nettle)
+elif 'CONFIG_GCRYPT' in config_host
+  crypto_ss.add(gcrypt)
+endif
+
+if 'CONFIG_GNUTLS' in config_host
+  crypto_ss.add(gnutls)
+endif
+
+
 crypto_ss = crypto_ss.apply(config_host, strict: false)
 libcrypto = static_library('crypto', crypto_ss.sources() + genh,
                            dependencies: [crypto_ss.dependencies()],
@@ -52,12 +63,21 @@ crypto = declare_dependency(link_whole: libcrypto,
 
 util_ss.add(files('aes.c'))
 util_ss.add(files('init.c'))
+
 if 'CONFIG_GCRYPT' in config_host
   util_ss.add(files('random-gcrypt.c'))
 elif 'CONFIG_GNUTLS' in config_host
-  util_ss.add(files('random-gnutls.c'), gnutls)
+  util_ss.add(files('random-gnutls.c'))
 elif 'CONFIG_RNG_NONE' in config_host
   util_ss.add(files('random-none.c'))
 else
   util_ss.add(files('random-platform.c'))
 endif
+
+if 'CONFIG_GCRYPT' in config_host
+  util_ss.add(gcrypt)
+endif
+
+if 'CONFIG_GNUTLS' in config_host
+  util_ss.add(gnutls)
+endif
diff --git a/meson.build b/meson.build
index 5aaa364730..04e070bb3b 100644
--- a/meson.build
+++ b/meson.build
@@ -116,6 +116,11 @@ urcubp = not_found
 if 'CONFIG_TRACE_UST' in config_host
   urcubp = declare_dependency(link_args: config_host['URCU_BP_LIBS'].split())
 endif
+gcrypt = not_found
+if 'CONFIG_GCRYPT' in config_host
+  gcrypt = declare_dependency(compile_args: config_host['GCRYPT_CFLAGS'].split(),
+                              link_args: config_host['GCRYPT_LIBS'].split())
+endif
 nettle = not_found
 if 'CONFIG_NETTLE' in config_host
   nettle = declare_dependency(compile_args: config_host['NETTLE_CFLAGS'].split(),
-- 
2.18.2



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

* [PULL 12/14] gitlab: expand test coverage for crypto builds
  2020-09-07 12:11 [PULL 00/14] Gitlab-CI improvements and related fixes Thomas Huth
                   ` (10 preceding siblings ...)
  2020-09-07 12:11 ` [PULL 11/14] crypto: fix build with gcrypt enabled Thomas Huth
@ 2020-09-07 12:11 ` Thomas Huth
  2020-09-07 12:11 ` [PULL 13/14] tests/qtest: do not list ahci-test twice Thomas Huth
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: Thomas Huth @ 2020-09-07 12:11 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell; +Cc: Yonggang Luo

From: Daniel P. Berrangé <berrange@redhat.com>

Most jobs test the latest nettle library. This adds explicit coverage
for latest gcrypt using Fedora, and old gcrypt and nettle using
CentOS-7. The latter does a minimal tools-only build, as we only need to
validate that the crypto code builds and unit tests pass. Finally a job
disabling both nettle and gcrypt is provided to validate that gnutls
still works.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20200901133050.381844-3-berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 .gitlab-ci.yml                          | 68 +++++++++++++++++++++++++
 tests/docker/dockerfiles/centos7.docker |  2 +
 tests/docker/dockerfiles/centos8.docker |  1 +
 3 files changed, 71 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index d677e00933..72e8604579 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -133,6 +133,7 @@ build-system-fedora:
   <<: *native_build_job_definition
   variables:
     IMAGE: fedora
+    CONFIGURE_ARGS: --disable-gcrypt --enable-nettle
     TARGETS: tricore-softmmu unicore32-softmmu microblaze-softmmu mips-softmmu
       xtensa-softmmu m68k-softmmu riscv32-softmmu ppc-softmmu sparc64-softmmu
     MAKE_CHECK_ARGS: check-build
@@ -164,6 +165,7 @@ build-system-centos:
   <<: *native_build_job_definition
   variables:
     IMAGE: centos8
+    CONFIGURE_ARGS: --disable-nettle --enable-gcrypt
     TARGETS: ppc64-softmmu lm32-softmmu or1k-softmmu s390x-softmmu
       x86_64-softmmu rx-softmmu sh4-softmmu nios2-softmmu
     MAKE_CHECK_ARGS: check-build
@@ -290,3 +292,69 @@ build-tci:
       done
     - QTEST_QEMU_BINARY="./qemu-system-x86_64" ./tests/qtest/pxe-test
     - QTEST_QEMU_BINARY="./qemu-system-s390x" ./tests/qtest/pxe-test -m slow
+
+# Most jobs test latest gcrypt or nettle builds
+#
+# These jobs test old gcrypt and nettle from RHEL7
+# which had some API differences.
+build-crypto-old-nettle:
+  <<: *native_build_job_definition
+  variables:
+    IMAGE: centos7
+    TARGETS: x86_64-softmmu x86_64-linux-user
+    CONFIGURE_ARGS: --disable-gcrypt --enable-nettle
+    MAKE_CHECK_ARGS: check-build
+  artifacts:
+    paths:
+      - build
+
+check-crypto-old-nettle:
+  <<: *native_test_job_definition
+  needs:
+    - job: build-crypto-old-nettle
+      artifacts: true
+  variables:
+    IMAGE: centos7
+    MAKE_CHECK_ARGS: check
+
+
+build-crypto-old-gcrypt:
+  <<: *native_build_job_definition
+  variables:
+    IMAGE: centos7
+    TARGETS: x86_64-softmmu x86_64-linux-user
+    CONFIGURE_ARGS: --disable-nettle --enable-gcrypt
+    MAKE_CHECK_ARGS: check-build
+  artifacts:
+    paths:
+      - build
+
+check-crypto-old-gcrypt:
+  <<: *native_test_job_definition
+  needs:
+    - job: build-crypto-old-gcrypt
+      artifacts: true
+  variables:
+    IMAGE: centos7
+    MAKE_CHECK_ARGS: check
+
+
+build-crypto-only-gnutls:
+  <<: *native_build_job_definition
+  variables:
+    IMAGE: centos7
+    TARGETS: x86_64-softmmu x86_64-linux-user
+    CONFIGURE_ARGS: --disable-nettle --disable-gcrypt --enable-gnutls
+    MAKE_CHECK_ARGS: check-build
+  artifacts:
+    paths:
+      - build
+
+check-crypto-only-gnutls:
+  <<: *native_test_job_definition
+  needs:
+    - job: build-crypto-only-gnutls
+      artifacts: true
+  variables:
+    IMAGE: centos7
+    MAKE_CHECK_ARGS: check
diff --git a/tests/docker/dockerfiles/centos7.docker b/tests/docker/dockerfiles/centos7.docker
index e197acdc3c..46277773bf 100644
--- a/tests/docker/dockerfiles/centos7.docker
+++ b/tests/docker/dockerfiles/centos7.docker
@@ -15,9 +15,11 @@ ENV PACKAGES \
     gettext \
     git \
     glib2-devel \
+    gnutls-devel \
     libaio-devel \
     libepoxy-devel \
     libfdt-devel \
+    libgcrypt-devel \
     librdmacm-devel \
     libzstd-devel \
     lzo-devel \
diff --git a/tests/docker/dockerfiles/centos8.docker b/tests/docker/dockerfiles/centos8.docker
index 9852c5b9ee..f435616d6a 100644
--- a/tests/docker/dockerfiles/centos8.docker
+++ b/tests/docker/dockerfiles/centos8.docker
@@ -13,6 +13,7 @@ ENV PACKAGES \
     glib2-devel \
     libaio-devel \
     libepoxy-devel \
+    libgcrypt-devel \
     lzo-devel \
     make \
     mesa-libEGL-devel \
-- 
2.18.2



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

* [PULL 13/14] tests/qtest: do not list ahci-test twice
  2020-09-07 12:11 [PULL 00/14] Gitlab-CI improvements and related fixes Thomas Huth
                   ` (11 preceding siblings ...)
  2020-09-07 12:11 ` [PULL 12/14] gitlab: expand test coverage for crypto builds Thomas Huth
@ 2020-09-07 12:11 ` Thomas Huth
  2020-09-07 12:11 ` [PULL 14/14] target/microblaze: Collected fixes for env->iflags Thomas Huth
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 18+ messages in thread
From: Thomas Huth @ 2020-09-07 12:11 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell; +Cc: Yonggang Luo

From: Paolo Bonzini <pbonzini@redhat.com>

This is caught by "meson test", which complains about two tests with the
same name.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200904120342.11370-1-pbonzini@redhat.com>
Fixes: a2ce7dbd917 ("meson: convert tests/qtest to meson")
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qtest/meson.build | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build
index 8f8fdb1336..874b5be62b 100644
--- a/tests/qtest/meson.build
+++ b/tests/qtest/meson.build
@@ -49,7 +49,6 @@ qtests_i386 = \
   qtests_pci +                                                                              \
   ['fdc-test',
    'ide-test',
-   'ahci-test',
    'hd-geo-test',
    'boot-order-test',
    'bios-tables-test',
-- 
2.18.2



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

* [PULL 14/14] target/microblaze: Collected fixes for env->iflags
  2020-09-07 12:11 [PULL 00/14] Gitlab-CI improvements and related fixes Thomas Huth
                   ` (12 preceding siblings ...)
  2020-09-07 12:11 ` [PULL 13/14] tests/qtest: do not list ahci-test twice Thomas Huth
@ 2020-09-07 12:11 ` Thomas Huth
  2020-09-07 17:52 ` [PULL 00/14] Gitlab-CI improvements and related fixes 罗勇刚(Yonggang Luo)
  2020-09-07 18:26 ` Peter Maydell
  15 siblings, 0 replies; 18+ messages in thread
From: Thomas Huth @ 2020-09-07 12:11 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell; +Cc: Yonggang Luo

From: Richard Henderson <richard.henderson@linaro.org>

There are several problems here that can result in soft lockup,
depending on exactly where an interrupt or exception is delivered:

Include BIMM_FLAG in IFLAGS_TB_MASK, since it needs to follow D_FLAG.
Ensure that iflags is 0 when entering an interrupt/exception handler.
Add mb_cpu_synchronize_from_tb to restore iflags from tb->flags.
The change to t_sync_flags is cosmetic, but makes the code clearer.

This fixes the reported regression in acceptance/replay_kernel.py.

Fixes: 683a247ed7a4 ("target/microblaze: Store "current" iflags in insn_start")
Tested-by: Thomas Huth <thuth@redhat.com>
Reported-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20200904190842.2282109-2-richard.henderson@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 target/microblaze/cpu.c       | 11 +++++++++++
 target/microblaze/cpu.h       |  3 ++-
 target/microblaze/helper.c    | 17 +++++++++++------
 target/microblaze/translate.c |  4 ++--
 4 files changed, 26 insertions(+), 9 deletions(-)

diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c
index 67017ecc33..6392524135 100644
--- a/target/microblaze/cpu.c
+++ b/target/microblaze/cpu.c
@@ -80,6 +80,16 @@ static void mb_cpu_set_pc(CPUState *cs, vaddr value)
     MicroBlazeCPU *cpu = MICROBLAZE_CPU(cs);
 
     cpu->env.pc = value;
+    /* Ensure D_FLAG and IMM_FLAG are clear for the new PC */
+    cpu->env.iflags = 0;
+}
+
+static void mb_cpu_synchronize_from_tb(CPUState *cs, TranslationBlock *tb)
+{
+    MicroBlazeCPU *cpu = MICROBLAZE_CPU(cs);
+
+    cpu->env.pc = tb->pc;
+    cpu->env.iflags = tb->flags & IFLAGS_TB_MASK;
 }
 
 static bool mb_cpu_has_work(CPUState *cs)
@@ -321,6 +331,7 @@ static void mb_cpu_class_init(ObjectClass *oc, void *data)
     cc->cpu_exec_interrupt = mb_cpu_exec_interrupt;
     cc->dump_state = mb_cpu_dump_state;
     cc->set_pc = mb_cpu_set_pc;
+    cc->synchronize_from_tb = mb_cpu_synchronize_from_tb;
     cc->gdb_read_register = mb_cpu_gdb_read_register;
     cc->gdb_write_register = mb_cpu_gdb_write_register;
     cc->tlb_fill = mb_cpu_tlb_fill;
diff --git a/target/microblaze/cpu.h b/target/microblaze/cpu.h
index d11b6fa995..a25a2b427f 100644
--- a/target/microblaze/cpu.h
+++ b/target/microblaze/cpu.h
@@ -270,7 +270,8 @@ struct CPUMBState {
 #define D_FLAG		(1 << 19)  /* Bit in ESR.  */
 
 /* TB dependent CPUMBState.  */
-#define IFLAGS_TB_MASK  (D_FLAG | IMM_FLAG | DRTI_FLAG | DRTE_FLAG | DRTB_FLAG)
+#define IFLAGS_TB_MASK  (D_FLAG | BIMM_FLAG | IMM_FLAG | \
+                         DRTI_FLAG | DRTE_FLAG | DRTB_FLAG)
 #define MSR_TB_MASK     (MSR_UM | MSR_VM | MSR_EE)
 
     uint32_t iflags;
diff --git a/target/microblaze/helper.c b/target/microblaze/helper.c
index 48547385b0..00090526da 100644
--- a/target/microblaze/helper.c
+++ b/target/microblaze/helper.c
@@ -113,7 +113,10 @@ void mb_cpu_do_interrupt(CPUState *cs)
     uint32_t t, msr = mb_cpu_read_msr(env);
 
     /* IMM flag cannot propagate across a branch and into the dslot.  */
-    assert(!((env->iflags & D_FLAG) && (env->iflags & IMM_FLAG)));
+    assert((env->iflags & (D_FLAG | IMM_FLAG)) != (D_FLAG | IMM_FLAG));
+    /* BIMM flag cannot be set without D_FLAG. */
+    assert((env->iflags & (D_FLAG | BIMM_FLAG)) != BIMM_FLAG);
+    /* RTI flags are private to translate. */
     assert(!(env->iflags & (DRTI_FLAG | DRTE_FLAG | DRTB_FLAG)));
     env->res_addr = RES_ADDR_NONE;
     switch (cs->exception_index) {
@@ -146,7 +149,7 @@ void mb_cpu_do_interrupt(CPUState *cs)
                           env->pc, env->ear,
                           env->esr, env->iflags);
             log_cpu_state_mask(CPU_LOG_INT, cs, 0);
-            env->iflags &= ~(IMM_FLAG | D_FLAG);
+            env->iflags = 0;
             env->pc = cpu->cfg.base_vectors + 0x20;
             break;
 
@@ -186,14 +189,14 @@ void mb_cpu_do_interrupt(CPUState *cs)
                           "exception at pc=%x ear=%" PRIx64 " iflags=%x\n",
                           env->pc, env->ear, env->iflags);
             log_cpu_state_mask(CPU_LOG_INT, cs, 0);
-            env->iflags &= ~(IMM_FLAG | D_FLAG);
+            env->iflags = 0;
             env->pc = cpu->cfg.base_vectors + 0x20;
             break;
 
         case EXCP_IRQ:
             assert(!(msr & (MSR_EIP | MSR_BIP)));
             assert(msr & MSR_IE);
-            assert(!(env->iflags & D_FLAG));
+            assert(!(env->iflags & (D_FLAG | IMM_FLAG)));
 
             t = (msr & (MSR_VM | MSR_UM)) << 1;
 
@@ -226,13 +229,14 @@ void mb_cpu_do_interrupt(CPUState *cs)
             mb_cpu_write_msr(env, msr);
 
             env->regs[14] = env->pc;
+            env->iflags = 0;
             env->pc = cpu->cfg.base_vectors + 0x10;
             //log_cpu_state_mask(CPU_LOG_INT, cs, 0);
             break;
 
         case EXCP_HW_BREAK:
-            assert(!(env->iflags & IMM_FLAG));
-            assert(!(env->iflags & D_FLAG));
+            assert(!(env->iflags & (D_FLAG | IMM_FLAG)));
+
             t = (msr & (MSR_VM | MSR_UM)) << 1;
             qemu_log_mask(CPU_LOG_INT,
                           "break at pc=%x msr=%x %x iflags=%x\n",
@@ -242,6 +246,7 @@ void mb_cpu_do_interrupt(CPUState *cs)
             msr |= t;
             msr |= MSR_BIP;
             env->regs[16] = env->pc;
+            env->iflags = 0;
             env->pc = cpu->cfg.base_vectors + 0x18;
             mb_cpu_write_msr(env, msr);
             break;
diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c
index a377818b5e..a8a3249185 100644
--- a/target/microblaze/translate.c
+++ b/target/microblaze/translate.c
@@ -91,8 +91,8 @@ static int typeb_imm(DisasContext *dc, int x)
 static void t_sync_flags(DisasContext *dc)
 {
     /* Synch the tb dependent flags between translator and runtime.  */
-    if ((dc->tb_flags ^ dc->base.tb->flags) & ~MSR_TB_MASK) {
-        tcg_gen_movi_i32(cpu_iflags, dc->tb_flags & ~MSR_TB_MASK);
+    if ((dc->tb_flags ^ dc->base.tb->flags) & IFLAGS_TB_MASK) {
+        tcg_gen_movi_i32(cpu_iflags, dc->tb_flags & IFLAGS_TB_MASK);
     }
 }
 
-- 
2.18.2



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

* Re: [PULL 00/14] Gitlab-CI improvements and related fixes
  2020-09-07 12:11 [PULL 00/14] Gitlab-CI improvements and related fixes Thomas Huth
                   ` (13 preceding siblings ...)
  2020-09-07 12:11 ` [PULL 14/14] target/microblaze: Collected fixes for env->iflags Thomas Huth
@ 2020-09-07 17:52 ` 罗勇刚(Yonggang Luo)
  2020-09-07 18:26 ` Peter Maydell
  15 siblings, 0 replies; 18+ messages in thread
From: 罗勇刚(Yonggang Luo) @ 2020-09-07 17:52 UTC (permalink / raw)
  To: Thomas Huth; +Cc: Peter Maydell, qemu-level, Paolo Bonzini

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

On Mon, Sep 7, 2020 at 8:11 PM Thomas Huth <thuth@redhat.com> wrote:

>  Hi Peter,
>
> the following changes since commit
> 7c37270b3fbe3d034ba80e488761461676e21eb4:
>
>   Merge remote-tracking branch
> 'remotes/kraxel/tags/ui-20200904-pull-request' into staging (2020-09-06
> 16:23:55 +0100)
>
> are available in the Git repository at:
>
>   https://gitlab.com/huth/qemu.git tags/pull-request-2020-09-07
>
> for you to fetch changes up to 88e74b6122bb40852b1c98befd47a572f0c06930:
>
>   target/microblaze: Collected fixes for env->iflags (2020-09-07 12:34:17
> +0200)
>
> ----------------------------------------------------------------
> * Fixes for cross-compiling with MinGW / compiling with MSYS2
> * Enable cross-compiler builds in the Gitlab CI
> * Improvements / fixes for the crypto tests in the Gitlab CI
> * Fix for the "make check-acceptance" microblaze failure
>   (required to get the Gitlab CI green again)
> ----------------------------------------------------------------
>
> Alex Bennée (1):
>       tests/docker: add python3-setuptools the docker images
>
> Daniel P. Berrangé (2):
>       crypto: fix build with gcrypt enabled
>       gitlab: expand test coverage for crypto builds
>
> Paolo Bonzini (1):
>       tests/qtest: do not list ahci-test twice
>
> Richard Henderson (1):
>       target/microblaze: Collected fixes for env->iflags
>
> Thomas Huth (6):
>       tests/Makefile: test-image-locking needs CONFIG_POSIX
>       dockerfiles/debian-win64-cross: Download WHPX MinGW headers
>       configure: Allow automatic WHPX detection
>       stubs: Move qemu_timer_notify_cb() and remove qemu_notify_event()
> stub
>       stubs: Move qemu_fd_register stub to util/main-loop.c
>       gitlab-ci: Add cross-compiling build tests
>
> Yonggang Luo (3):
>       tests: handling signal on win32 properly
>
Hi thomas, this have already been queued by Bonzini, you have to skip this.

>       tests: fixes test-vmstate.c compile error on msys2
>
Hi Bonzini, the int compiling error are fixed by this commit

>       tests: Fixes building test-util-filemonitor.c on msys2/mingw
>
Hi Bonzini, the mkdir error are fixed by this commit

>
>  .gitlab-ci.d/crossbuilds.yml                       | 113
> +++++++++++++++++++++
>  .gitlab-ci.yml                                     |  69 +++++++++++++
>  MAINTAINERS                                        |   1 +
>  configure                                          |   3 +
>  crypto/meson.build                                 |  42 ++++++--
>  meson.build                                        |   5 +
>  stubs/cpu-get-icount.c                             |   5 -
>  stubs/fd-register.c                                |   6 --
>  stubs/meson.build                                  |   3 +-
>  stubs/notify-event.c                               |   6 --
>  stubs/qemu-timer-notify-cb.c                       |   8 ++
>  target/microblaze/cpu.c                            |  11 ++
>  target/microblaze/cpu.h                            |   3 +-
>  target/microblaze/helper.c                         |  17 ++--
>  target/microblaze/translate.c                      |   4 +-
>  tests/Makefile.include                             |   2 +
>  tests/docker/dockerfiles/centos7.docker            |   2 +
>  tests/docker/dockerfiles/centos8.docker            |   1 +
>  tests/docker/dockerfiles/debian-win64-cross.docker |   9 +-
>  tests/docker/dockerfiles/debian10.docker           |   1 +
>  tests/docker/dockerfiles/debian9.docker            |   1 +
>  tests/qtest/meson.build                            |   1 -
>  tests/test-replication.c                           |   4 +
>  tests/test-util-filemonitor.c                      |   4 +-
>  tests/test-vmstate.c                               |   4 +-
>  util/main-loop.c                                   |   4 +
>  26 files changed, 285 insertions(+), 44 deletions(-)
>  create mode 100644 .gitlab-ci.d/crossbuilds.yml
>  delete mode 100644 stubs/fd-register.c
>  delete mode 100644 stubs/notify-event.c
>  create mode 100644 stubs/qemu-timer-notify-cb.c
>
>

-- 
         此致
礼
罗勇刚
Yours
    sincerely,
Yonggang Luo

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

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

* Re: [PULL 00/14] Gitlab-CI improvements and related fixes
  2020-09-07 12:11 [PULL 00/14] Gitlab-CI improvements and related fixes Thomas Huth
                   ` (14 preceding siblings ...)
  2020-09-07 17:52 ` [PULL 00/14] Gitlab-CI improvements and related fixes 罗勇刚(Yonggang Luo)
@ 2020-09-07 18:26 ` Peter Maydell
  2020-09-07 18:31   ` 罗勇刚(Yonggang Luo)
  15 siblings, 1 reply; 18+ messages in thread
From: Peter Maydell @ 2020-09-07 18:26 UTC (permalink / raw)
  To: Thomas Huth; +Cc: Yonggang Luo, QEMU Developers

On Mon, 7 Sep 2020 at 13:11, Thomas Huth <thuth@redhat.com> wrote:
>
>  Hi Peter,
>
> the following changes since commit 7c37270b3fbe3d034ba80e488761461676e21eb4:
>
>   Merge remote-tracking branch 'remotes/kraxel/tags/ui-20200904-pull-request' into staging (2020-09-06 16:23:55 +0100)
>
> are available in the Git repository at:
>
>   https://gitlab.com/huth/qemu.git tags/pull-request-2020-09-07
>
> for you to fetch changes up to 88e74b6122bb40852b1c98befd47a572f0c06930:
>
>   target/microblaze: Collected fixes for env->iflags (2020-09-07 12:34:17 +0200)
>
> ----------------------------------------------------------------
> * Fixes for cross-compiling with MinGW / compiling with MSYS2
> * Enable cross-compiler builds in the Gitlab CI
> * Improvements / fixes for the crypto tests in the Gitlab CI
> * Fix for the "make check-acceptance" microblaze failure
>   (required to get the Gitlab CI green again)
> ----------------------------------------------------------------


Applied, thanks.

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

-- PMM


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

* Re: [PULL 00/14] Gitlab-CI improvements and related fixes
  2020-09-07 18:26 ` Peter Maydell
@ 2020-09-07 18:31   ` 罗勇刚(Yonggang Luo)
  0 siblings, 0 replies; 18+ messages in thread
From: 罗勇刚(Yonggang Luo) @ 2020-09-07 18:31 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Paolo Bonzini, Thomas Huth, QEMU Developers

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

On Tue, Sep 8, 2020 at 2:26 AM Peter Maydell <peter.maydell@linaro.org>
wrote:

> On Mon, 7 Sep 2020 at 13:11, Thomas Huth <thuth@redhat.com> wrote:
> >
> >  Hi Peter,
> >
> > the following changes since commit
> 7c37270b3fbe3d034ba80e488761461676e21eb4:
> >
> >   Merge remote-tracking branch
> 'remotes/kraxel/tags/ui-20200904-pull-request' into staging (2020-09-06
> 16:23:55 +0100)
> >
> > are available in the Git repository at:
> >
> >   https://gitlab.com/huth/qemu.git tags/pull-request-2020-09-07
> >
> > for you to fetch changes up to 88e74b6122bb40852b1c98befd47a572f0c06930:
> >
> >   target/microblaze: Collected fixes for env->iflags (2020-09-07
> 12:34:17 +0200)
> >
> > ----------------------------------------------------------------
> > * Fixes for cross-compiling with MinGW / compiling with MSYS2
> > * Enable cross-compiler builds in the Gitlab CI
> > * Improvements / fixes for the crypto tests in the Gitlab CI
> > * Fix for the "make check-acceptance" microblaze failure
> >   (required to get the Gitlab CI green again)
> > ----------------------------------------------------------------
>
>
> Applied, thanks.
>
> Please update the changelog at https://wiki.qemu.org/ChangeLog/5.2
> for any user-visible changes.
>
> -- PMM
>


-- 
         此致
礼
罗勇刚
Yours
    sincerely,
Yonggang Luo

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

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

end of thread, other threads:[~2020-09-07 18:38 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-07 12:11 [PULL 00/14] Gitlab-CI improvements and related fixes Thomas Huth
2020-09-07 12:11 ` [PULL 01/14] tests/docker: add python3-setuptools the docker images Thomas Huth
2020-09-07 12:11 ` [PULL 02/14] tests: handling signal on win32 properly Thomas Huth
2020-09-07 12:11 ` [PULL 03/14] tests: fixes test-vmstate.c compile error on msys2 Thomas Huth
2020-09-07 12:11 ` [PULL 04/14] tests: Fixes building test-util-filemonitor.c on msys2/mingw Thomas Huth
2020-09-07 12:11 ` [PULL 05/14] tests/Makefile: test-image-locking needs CONFIG_POSIX Thomas Huth
2020-09-07 12:11 ` [PULL 06/14] dockerfiles/debian-win64-cross: Download WHPX MinGW headers Thomas Huth
2020-09-07 12:11 ` [PULL 07/14] configure: Allow automatic WHPX detection Thomas Huth
2020-09-07 12:11 ` [PULL 08/14] stubs: Move qemu_timer_notify_cb() and remove qemu_notify_event() stub Thomas Huth
2020-09-07 12:11 ` [PULL 09/14] stubs: Move qemu_fd_register stub to util/main-loop.c Thomas Huth
2020-09-07 12:11 ` [PULL 10/14] gitlab-ci: Add cross-compiling build tests Thomas Huth
2020-09-07 12:11 ` [PULL 11/14] crypto: fix build with gcrypt enabled Thomas Huth
2020-09-07 12:11 ` [PULL 12/14] gitlab: expand test coverage for crypto builds Thomas Huth
2020-09-07 12:11 ` [PULL 13/14] tests/qtest: do not list ahci-test twice Thomas Huth
2020-09-07 12:11 ` [PULL 14/14] target/microblaze: Collected fixes for env->iflags Thomas Huth
2020-09-07 17:52 ` [PULL 00/14] Gitlab-CI improvements and related fixes 罗勇刚(Yonggang Luo)
2020-09-07 18:26 ` Peter Maydell
2020-09-07 18:31   ` 罗勇刚(Yonggang Luo)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).