qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PULL 0/6] qtest and misc patches
@ 2020-07-06  7:28 Thomas Huth
  2020-07-06  7:28 ` [PULL 1/6] fuzz: fix broken qtest check at rcu_disable_atfork Thomas Huth
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: Thomas Huth @ 2020-07-06  7:28 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-devel

 Hi Peter,

the following changes since commit eb6490f544388dd24c0d054a96dd304bc7284450:

  Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20200703' into staging (2020-07-04 16:08:41 +0100)

are available in the Git repository at:

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

for you to fetch changes up to 70f909b4eec6fa92a9e33a8d23e185cad7abd533:

  tests/acceptance: Add a test for the sun4u sparc64 machine (2020-07-06 07:37:02 +0200)

----------------------------------------------------------------
* Fuzzer fixes from Alexander
* Clean-up patches for qtests, configure and mcf5206
* Sparc64 sun4u acceptance test
----------------------------------------------------------------

Alexander Bulekov (2):
      fuzz: fix broken qtest check at rcu_disable_atfork
      fuzz: do not use POSIX shm for coverage bitmap

Thomas Huth (4):
      tests/qtest: Unify the test for the xenfv and xenpv machines
      configure / util: Auto-detect the availability of openpty()
      hw/m68k/mcf5206: Replace remaining hw_error()s by qemu_log_mask()
      tests/acceptance: Add a test for the sun4u sparc64 machine

 MAINTAINERS                               |  1 +
 configure                                 |  9 ++++++-
 hw/m68k/mcf5206.c                         | 39 +++++++++++++++++++++---------
 softmmu/vl.c                              | 12 +---------
 tests/acceptance/machine_sparc64_sun4u.py | 36 ++++++++++++++++++++++++++++
 tests/qtest/device-introspect-test.c      |  5 ----
 tests/qtest/fuzz/fork_fuzz.c              | 40 ++++++++++---------------------
 tests/qtest/fuzz/fuzz.c                   |  3 +++
 tests/qtest/libqtest.c                    |  4 ++++
 tests/qtest/qom-test.c                    |  5 ----
 tests/qtest/test-hmp.c                    |  5 ----
 util/qemu-openpty.c                       |  5 +++-
 12 files changed, 98 insertions(+), 66 deletions(-)
 create mode 100644 tests/acceptance/machine_sparc64_sun4u.py



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

* [PULL 1/6] fuzz: fix broken qtest check at rcu_disable_atfork
  2020-07-06  7:28 [PULL 0/6] qtest and misc patches Thomas Huth
@ 2020-07-06  7:28 ` Thomas Huth
  2020-07-06  7:28 ` [PULL 2/6] fuzz: do not use POSIX shm for coverage bitmap Thomas Huth
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Thomas Huth @ 2020-07-06  7:28 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Alexander Bulekov, qemu-devel

From: Alexander Bulekov <alxndr@bu.edu>

The qtest_enabled check introduced in d6919e4 always returns false, as
it is called prior to configure_accelerators(). Instead of trying to
skip rcu_disable_atfork in qemu_main, simply call rcu_enable_atfork in
the fuzzer, after qemu_main returns.

Reported-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
Message-Id: <20200618160516.2817-1-alxndr@bu.edu>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 softmmu/vl.c            | 12 +-----------
 tests/qtest/fuzz/fuzz.c |  3 +++
 2 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/softmmu/vl.c b/softmmu/vl.c
index 3e15ee2435..9da2e23144 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -3832,17 +3832,7 @@ void qemu_init(int argc, char **argv, char **envp)
                                               machine_class);
 
     os_daemonize();
-
-    /*
-     * If QTest is enabled, keep the rcu_atfork enabled, since system processes
-     * may be forked testing purposes (e.g. fork-server based fuzzing) The fork
-     * should happen before a signle cpu instruction is executed, to prevent
-     * deadlocks. See commit 73c6e40, rcu: "completely disable pthread_atfork
-     * callbacks as soon as possible"
-     */
-    if (!qtest_enabled()) {
-        rcu_disable_atfork();
-    }
+    rcu_disable_atfork();
 
     if (pid_file && !qemu_write_pidfile(pid_file, &err)) {
         error_reportf_err(err, "cannot create PID file: ");
diff --git a/tests/qtest/fuzz/fuzz.c b/tests/qtest/fuzz/fuzz.c
index a44fe479db..a36d9038e0 100644
--- a/tests/qtest/fuzz/fuzz.c
+++ b/tests/qtest/fuzz/fuzz.c
@@ -211,5 +211,8 @@ int LLVMFuzzerInitialize(int *argc, char ***argv, char ***envp)
 
     qemu_init(result.we_wordc, result.we_wordv, NULL);
 
+    /* re-enable the rcu atfork, which was previously disabled in qemu_init */
+    rcu_enable_atfork();
+
     return 0;
 }
-- 
2.18.1



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

* [PULL 2/6] fuzz: do not use POSIX shm for coverage bitmap
  2020-07-06  7:28 [PULL 0/6] qtest and misc patches Thomas Huth
  2020-07-06  7:28 ` [PULL 1/6] fuzz: fix broken qtest check at rcu_disable_atfork Thomas Huth
@ 2020-07-06  7:28 ` Thomas Huth
  2020-07-06  7:28 ` [PULL 3/6] tests/qtest: Unify the test for the xenfv and xenpv machines Thomas Huth
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Thomas Huth @ 2020-07-06  7:28 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Alexander Bulekov, qemu-devel

From: Alexander Bulekov <alxndr@bu.edu>

We used shm_open with mmap to share libfuzzer's coverage bitmap with
child (runner) processes. The same functionality can be achieved with
MAP_SHARED | MAP_ANONYMOUS, since we do not care about naming or
permissioning the shared memory object.

Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
Message-Id: <20200622165040.15121-1-alxndr@bu.edu>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qtest/fuzz/fork_fuzz.c | 40 ++++++++++++------------------------
 1 file changed, 13 insertions(+), 27 deletions(-)

diff --git a/tests/qtest/fuzz/fork_fuzz.c b/tests/qtest/fuzz/fork_fuzz.c
index 2bd0851903..6ffb2a7937 100644
--- a/tests/qtest/fuzz/fork_fuzz.c
+++ b/tests/qtest/fuzz/fork_fuzz.c
@@ -17,39 +17,25 @@
 
 void counter_shm_init(void)
 {
-    char *shm_path = g_strdup_printf("/qemu-fuzz-cntrs.%d", getpid());
-    int fd = shm_open(shm_path, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR);
-    g_free(shm_path);
-
-    if (fd == -1) {
-        perror("Error: ");
-        exit(1);
-    }
-    if (ftruncate(fd, &__FUZZ_COUNTERS_END - &__FUZZ_COUNTERS_START) == -1) {
-        perror("Error: ");
-        exit(1);
-    }
-    /* Copy what's in the counter region to the shm.. */
-    void *rptr = mmap(NULL ,
-            &__FUZZ_COUNTERS_END - &__FUZZ_COUNTERS_START,
-            PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
-    memcpy(rptr,
+    /* Copy what's in the counter region to a temporary buffer.. */
+    void *copy = malloc(&__FUZZ_COUNTERS_END - &__FUZZ_COUNTERS_START);
+    memcpy(copy,
            &__FUZZ_COUNTERS_START,
            &__FUZZ_COUNTERS_END - &__FUZZ_COUNTERS_START);
 
-    munmap(rptr, &__FUZZ_COUNTERS_END - &__FUZZ_COUNTERS_START);
-
-    /* And map the shm over the counter region */
-    rptr = mmap(&__FUZZ_COUNTERS_START,
-            &__FUZZ_COUNTERS_END - &__FUZZ_COUNTERS_START,
-            PROT_READ | PROT_WRITE, MAP_SHARED | MAP_FIXED, fd, 0);
-
-    close(fd);
-
-    if (!rptr) {
+    /* Map a shared region over the counter region */
+    if (mmap(&__FUZZ_COUNTERS_START,
+             &__FUZZ_COUNTERS_END - &__FUZZ_COUNTERS_START,
+             PROT_READ | PROT_WRITE, MAP_SHARED | MAP_FIXED | MAP_ANONYMOUS,
+             0, 0) == MAP_FAILED) {
         perror("Error: ");
         exit(1);
     }
+
+    /* Copy the original data back to the counter-region */
+    memcpy(&__FUZZ_COUNTERS_START, copy,
+           &__FUZZ_COUNTERS_END - &__FUZZ_COUNTERS_START);
+    free(copy);
 }
 
 
-- 
2.18.1



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

* [PULL 3/6] tests/qtest: Unify the test for the xenfv and xenpv machines
  2020-07-06  7:28 [PULL 0/6] qtest and misc patches Thomas Huth
  2020-07-06  7:28 ` [PULL 1/6] fuzz: fix broken qtest check at rcu_disable_atfork Thomas Huth
  2020-07-06  7:28 ` [PULL 2/6] fuzz: do not use POSIX shm for coverage bitmap Thomas Huth
@ 2020-07-06  7:28 ` Thomas Huth
  2020-07-06  7:28 ` [PULL 4/6] configure / util: Auto-detect the availability of openpty() Thomas Huth
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Thomas Huth @ 2020-07-06  7:28 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-devel

We have the same check in three places. Let's unify it in a central
place instead.

Message-Id: <20200622104339.21000-1-thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qtest/device-introspect-test.c | 5 -----
 tests/qtest/libqtest.c               | 4 ++++
 tests/qtest/qom-test.c               | 5 -----
 tests/qtest/test-hmp.c               | 5 -----
 4 files changed, 4 insertions(+), 15 deletions(-)

diff --git a/tests/qtest/device-introspect-test.c b/tests/qtest/device-introspect-test.c
index f2c1576cae..9abb5ec889 100644
--- a/tests/qtest/device-introspect-test.c
+++ b/tests/qtest/device-introspect-test.c
@@ -287,11 +287,6 @@ static void add_machine_test_case(const char *mname)
 {
     char *path, *args;
 
-    /* Ignore blacklisted machines */
-    if (!memcmp("xenfv", mname, 5) || g_str_equal("xenpv", mname)) {
-        return;
-    }
-
     path = g_strdup_printf("device/introspect/concrete/defaults/%s", mname);
     args = g_strdup_printf("-M %s", mname);
     qtest_add_data_func(path, args, test_device_intro_concrete);
diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c
index 49075b55a1..fd4680590d 100644
--- a/tests/qtest/libqtest.c
+++ b/tests/qtest/libqtest.c
@@ -1232,6 +1232,10 @@ void qtest_cb_for_every_machine(void (*cb)(const char *machine),
         qstr = qobject_to(QString, qobj);
         g_assert(qstr);
         mname = qstring_get_str(qstr);
+        /* Ignore machines that cannot be used for qtests */
+        if (!memcmp("xenfv", mname, 5) || g_str_equal("xenpv", mname)) {
+            continue;
+        }
         if (!skip_old_versioned || !qtest_is_old_versioned_machine(mname)) {
             cb(mname);
         }
diff --git a/tests/qtest/qom-test.c b/tests/qtest/qom-test.c
index e338a41194..1acf0d7369 100644
--- a/tests/qtest/qom-test.c
+++ b/tests/qtest/qom-test.c
@@ -81,11 +81,6 @@ static void add_machine_test_case(const char *mname)
 {
     char *path;
 
-    /* Ignore blacklisted machines that have known problems */
-    if (!memcmp("xenfv", mname, 5) || g_str_equal("xenpv", mname)) {
-        return;
-    }
-
     path = g_strdup_printf("qom/%s", mname);
     qtest_add_data_func(path, g_strdup(mname), test_machine);
     g_free(path);
diff --git a/tests/qtest/test-hmp.c b/tests/qtest/test-hmp.c
index b8b1271b9e..d5e7ebd176 100644
--- a/tests/qtest/test-hmp.c
+++ b/tests/qtest/test-hmp.c
@@ -143,11 +143,6 @@ static void add_machine_test_case(const char *mname)
 {
     char *path;
 
-    /* Ignore blacklisted machines that have known problems */
-    if (!memcmp("xenfv", mname, 5) || g_str_equal("xenpv", mname)) {
-        return;
-    }
-
     path = g_strdup_printf("hmp/%s", mname);
     qtest_add_data_func(path, g_strdup(mname), test_machine);
     g_free(path);
-- 
2.18.1



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

* [PULL 4/6] configure / util: Auto-detect the availability of openpty()
  2020-07-06  7:28 [PULL 0/6] qtest and misc patches Thomas Huth
                   ` (2 preceding siblings ...)
  2020-07-06  7:28 ` [PULL 3/6] tests/qtest: Unify the test for the xenfv and xenpv machines Thomas Huth
@ 2020-07-06  7:28 ` Thomas Huth
  2020-07-06  7:28 ` [PULL 5/6] hw/m68k/mcf5206: Replace remaining hw_error()s by qemu_log_mask() Thomas Huth
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Thomas Huth @ 2020-07-06  7:28 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-devel

Recent versions of Solaris (v11.4) now feature an openpty() function,
too, causing a build failure since we ship our own implementation of
openpty() for Solaris in util/qemu-openpty.c so far. Since there are
now both variants available in the wild, with and without this function
(and illumos is said to not have this function yet), let's introduce a
proper HAVE_OPENPTY define for this to fix the build failure.

Message-Id: <20200702143955.678-1-thuth@redhat.com>
Tested-by: Michele Denber <denber@mindspring.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 configure           | 9 ++++++++-
 util/qemu-openpty.c | 5 ++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 8a65240d4a..f8dc64beab 100755
--- a/configure
+++ b/configure
@@ -5134,10 +5134,14 @@ extern int openpty(int *am, int *as, char *name, void *termp, void *winp);
 int main(void) { return openpty(0, 0, 0, 0, 0); }
 EOF
 
-if ! compile_prog "" "" ; then
+have_openpty="no"
+if compile_prog "" "" ; then
+  have_openpty="yes"
+else
   if compile_prog "" "-lutil" ; then
     libs_softmmu="-lutil $libs_softmmu"
     libs_tools="-lutil $libs_tools"
+    have_openpty="yes"
   fi
 fi
 
@@ -7380,6 +7384,9 @@ fi
 if test "$have_broken_size_max" = "yes" ; then
     echo "HAVE_BROKEN_SIZE_MAX=y" >> $config_host_mak
 fi
+if test "$have_openpty" = "yes" ; then
+    echo "HAVE_OPENPTY=y" >> $config_host_mak
+fi
 
 # Work around a system header bug with some kernel/XFS header
 # versions where they both try to define 'struct fsxattr':
diff --git a/util/qemu-openpty.c b/util/qemu-openpty.c
index 2e8b43bdf5..4b8df96f38 100644
--- a/util/qemu-openpty.c
+++ b/util/qemu-openpty.c
@@ -52,7 +52,9 @@
 #endif
 
 #ifdef __sun__
-/* Once Solaris has openpty(), this is going to be removed. */
+
+#if !defined(HAVE_OPENPTY)
+/* Once illumos has openpty(), this is going to be removed. */
 static int openpty(int *amaster, int *aslave, char *name,
                    struct termios *termp, struct winsize *winp)
 {
@@ -93,6 +95,7 @@ err:
         close(mfd);
         return -1;
 }
+#endif
 
 static void cfmakeraw (struct termios *termios_p)
 {
-- 
2.18.1



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

* [PULL 5/6] hw/m68k/mcf5206: Replace remaining hw_error()s by qemu_log_mask()
  2020-07-06  7:28 [PULL 0/6] qtest and misc patches Thomas Huth
                   ` (3 preceding siblings ...)
  2020-07-06  7:28 ` [PULL 4/6] configure / util: Auto-detect the availability of openpty() Thomas Huth
@ 2020-07-06  7:28 ` Thomas Huth
  2020-07-06  7:36   ` Thomas Huth
  2020-07-06  7:28 ` [PULL 6/6] tests/acceptance: Add a test for the sun4u sparc64 machine Thomas Huth
  2020-07-07 15:20 ` [PULL 0/6] qtest and misc patches Peter Maydell
  6 siblings, 1 reply; 9+ messages in thread
From: Thomas Huth @ 2020-07-06  7:28 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Thomas Huth, qemu-devel, Thomas Huth

From: Thomas Huth <huth@tuxfamily.org>

hw_error() dumps the CPU state and exits QEMU. This is ok during initial
code development (to see where the guest code is currently executing),
but it is certainly not the desired behavior that we want to present to
normal users, and it can also cause trouble when e.g. fuzzing devices.
Thus let's replace these hw_error()s by qemu_log_mask()s instead.

Message-Id: <20200611055807.15921-1-huth@tuxfamily.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Thomas Huth <thuth@tuxfamily.org>
---
 hw/m68k/mcf5206.c | 39 ++++++++++++++++++++++++++++-----------
 1 file changed, 28 insertions(+), 11 deletions(-)

diff --git a/hw/m68k/mcf5206.c b/hw/m68k/mcf5206.c
index a2fef04f8e..94a37a1a46 100644
--- a/hw/m68k/mcf5206.c
+++ b/hw/m68k/mcf5206.c
@@ -10,7 +10,6 @@
 #include "qemu/error-report.h"
 #include "qemu/log.h"
 #include "cpu.h"
-#include "hw/hw.h"
 #include "hw/irq.h"
 #include "hw/m68k/mcf.h"
 #include "qemu/timer.h"
@@ -69,10 +68,16 @@ static void m5206_timer_recalibrate(m5206_timer_state *s)
     if (mode == 2)
         prescale *= 16;
 
-    if (mode == 3 || mode == 0)
-        hw_error("m5206_timer: mode %d not implemented\n", mode);
-    if ((s->tmr & TMR_FRR) == 0)
-        hw_error("m5206_timer: free running mode not implemented\n");
+    if (mode == 3 || mode == 0) {
+        qemu_log_mask(LOG_UNIMP, "m5206_timer: mode %d not implemented\n",
+                      mode);
+        goto exit;
+    }
+    if ((s->tmr & TMR_FRR) == 0) {
+        qemu_log_mask(LOG_UNIMP,
+                      "m5206_timer: free running mode not implemented\n");
+        goto exit;
+    }
 
     /* Assume 66MHz system clock.  */
     ptimer_set_freq(s->timer, 66000000 / prescale);
@@ -391,7 +396,9 @@ static uint32_t m5206_mbar_readb(void *opaque, hwaddr offset)
     m5206_mbar_state *s = (m5206_mbar_state *)opaque;
     offset &= 0x3ff;
     if (offset >= 0x200) {
-        hw_error("Bad MBAR read offset 0x%x", (int)offset);
+        qemu_log_mask(LOG_GUEST_ERROR, "Bad MBAR read offset 0x%" HWADDR_PRIX,
+                      offset);
+        return 0;
     }
     if (m5206_mbar_width[offset >> 2] > 1) {
         uint16_t val;
@@ -410,7 +417,9 @@ static uint32_t m5206_mbar_readw(void *opaque, hwaddr offset)
     int width;
     offset &= 0x3ff;
     if (offset >= 0x200) {
-        hw_error("Bad MBAR read offset 0x%x", (int)offset);
+        qemu_log_mask(LOG_GUEST_ERROR, "Bad MBAR read offset 0x%" HWADDR_PRIX,
+                      offset);
+        return 0;
     }
     width = m5206_mbar_width[offset >> 2];
     if (width > 2) {
@@ -434,7 +443,9 @@ static uint32_t m5206_mbar_readl(void *opaque, hwaddr offset)
     int width;
     offset &= 0x3ff;
     if (offset >= 0x200) {
-        hw_error("Bad MBAR read offset 0x%x", (int)offset);
+        qemu_log_mask(LOG_GUEST_ERROR, "Bad MBAR read offset 0x%" HWADDR_PRIX,
+                      offset);
+        return 0;
     }
     width = m5206_mbar_width[offset >> 2];
     if (width < 4) {
@@ -458,7 +469,9 @@ static void m5206_mbar_writeb(void *opaque, hwaddr offset,
     int width;
     offset &= 0x3ff;
     if (offset >= 0x200) {
-        hw_error("Bad MBAR write offset 0x%x", (int)offset);
+        qemu_log_mask(LOG_GUEST_ERROR, "Bad MBAR write offset 0x%" HWADDR_PRIX,
+                      offset);
+        return;
     }
     width = m5206_mbar_width[offset >> 2];
     if (width > 1) {
@@ -482,7 +495,9 @@ static void m5206_mbar_writew(void *opaque, hwaddr offset,
     int width;
     offset &= 0x3ff;
     if (offset >= 0x200) {
-        hw_error("Bad MBAR write offset 0x%x", (int)offset);
+        qemu_log_mask(LOG_GUEST_ERROR, "Bad MBAR write offset 0x%" HWADDR_PRIX,
+                      offset);
+        return;
     }
     width = m5206_mbar_width[offset >> 2];
     if (width > 2) {
@@ -510,7 +525,9 @@ static void m5206_mbar_writel(void *opaque, hwaddr offset,
     int width;
     offset &= 0x3ff;
     if (offset >= 0x200) {
-        hw_error("Bad MBAR write offset 0x%x", (int)offset);
+        qemu_log_mask(LOG_GUEST_ERROR, "Bad MBAR write offset 0x%" HWADDR_PRIX,
+                      offset);
+        return;
     }
     width = m5206_mbar_width[offset >> 2];
     if (width < 4) {
-- 
2.18.1



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

* [PULL 6/6] tests/acceptance: Add a test for the sun4u sparc64 machine
  2020-07-06  7:28 [PULL 0/6] qtest and misc patches Thomas Huth
                   ` (4 preceding siblings ...)
  2020-07-06  7:28 ` [PULL 5/6] hw/m68k/mcf5206: Replace remaining hw_error()s by qemu_log_mask() Thomas Huth
@ 2020-07-06  7:28 ` Thomas Huth
  2020-07-07 15:20 ` [PULL 0/6] qtest and misc patches Peter Maydell
  6 siblings, 0 replies; 9+ messages in thread
From: Thomas Huth @ 2020-07-06  7:28 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-devel

We can use the image from the advent calendar 2018 to test the sun4u
machine. It's not using the "QEMU advent calendar" string, so we can
not use the do_test_advcal_2018() from boot_linux_console.py, thus
let's also put it into a separate file to also be able to add an
entry to the MAINTAINERS file.

Message-Id: <20200704173519.26087-1-thuth@redhat.com>
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 MAINTAINERS                               |  1 +
 tests/acceptance/machine_sparc64_sun4u.py | 36 +++++++++++++++++++++++
 2 files changed, 37 insertions(+)
 create mode 100644 tests/acceptance/machine_sparc64_sun4u.py

diff --git a/MAINTAINERS b/MAINTAINERS
index c31c878c63..a8e2d46e9d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1319,6 +1319,7 @@ F: include/hw/pci-host/sabre.h
 F: hw/pci-bridge/simba.c
 F: include/hw/pci-bridge/simba.h
 F: pc-bios/openbios-sparc64
+F: tests/acceptance/machine_sparc64_sun4u.py
 
 Sun4v
 M: Artyom Tarasenko <atar4qemu@gmail.com>
diff --git a/tests/acceptance/machine_sparc64_sun4u.py b/tests/acceptance/machine_sparc64_sun4u.py
new file mode 100644
index 0000000000..458165500e
--- /dev/null
+++ b/tests/acceptance/machine_sparc64_sun4u.py
@@ -0,0 +1,36 @@
+# Functional test that boots a Linux kernel and checks the console
+#
+# Copyright (c) 2020 Red Hat, Inc.
+#
+# Author:
+#  Thomas Huth <thuth@redhat.com>
+#
+# This work is licensed under the terms of the GNU GPL, version 2 or
+# later. See the COPYING file in the top-level directory.
+
+import os
+
+from avocado_qemu import wait_for_console_pattern
+from avocado.utils import archive
+from boot_linux_console import LinuxKernelTest
+
+class Sun4uMachine(LinuxKernelTest):
+    """Boots the Linux kernel and checks that the console is operational"""
+
+    timeout = 90
+
+    def test_sparc64_sun4u(self):
+        """
+        :avocado: tags=arch:sparc64
+        :avocado: tags=machine:sun4u
+        """
+        tar_url = ('https://www.qemu-advent-calendar.org'
+                   '/2018/download/day23.tar.xz')
+        tar_hash = '142db83cd974ffadc4f75c8a5cad5bcc5722c240'
+        file_path = self.fetch_asset(tar_url, asset_hash=tar_hash)
+        archive.extract(file_path, self.workdir)
+        self.vm.set_console()
+        self.vm.add_args('-kernel', self.workdir + '/day23/vmlinux',
+                         '-append', self.KERNEL_COMMON_COMMAND_LINE)
+        self.vm.launch()
+        wait_for_console_pattern(self, 'Starting logging: OK')
-- 
2.18.1



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

* Re: [PULL 5/6] hw/m68k/mcf5206: Replace remaining hw_error()s by qemu_log_mask()
  2020-07-06  7:28 ` [PULL 5/6] hw/m68k/mcf5206: Replace remaining hw_error()s by qemu_log_mask() Thomas Huth
@ 2020-07-06  7:36   ` Thomas Huth
  0 siblings, 0 replies; 9+ messages in thread
From: Thomas Huth @ 2020-07-06  7:36 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Thomas Huth, qemu-devel


[-- Attachment #1.1: Type: text/plain, Size: 940 bytes --]

On 06/07/2020 09.28, Thomas Huth wrote:
> From: Thomas Huth <huth@tuxfamily.org>
> 
> hw_error() dumps the CPU state and exits QEMU. This is ok during initial
> code development (to see where the guest code is currently executing),
> but it is certainly not the desired behavior that we want to present to
> normal users, and it can also cause trouble when e.g. fuzzing devices.
> Thus let's replace these hw_error()s by qemu_log_mask()s instead.
> 
> Message-Id: <20200611055807.15921-1-huth@tuxfamily.org>
> Reviewed-by: Laurent Vivier <laurent@vivier.eu>
> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> Signed-off-by: Thomas Huth <thuth@tuxfamily.org>

I just noticed that I had a typo in my e-mail address here :-(

Peter, FYI, I fixed it and pushed the same tag (pull-request-2020-07-06)
again, latest commit ID is now 8c4329214f1d4484205e6f7c48e98ff26969eb56.

Sorry for the inconvenience.

 Thomas


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PULL 0/6] qtest and misc patches
  2020-07-06  7:28 [PULL 0/6] qtest and misc patches Thomas Huth
                   ` (5 preceding siblings ...)
  2020-07-06  7:28 ` [PULL 6/6] tests/acceptance: Add a test for the sun4u sparc64 machine Thomas Huth
@ 2020-07-07 15:20 ` Peter Maydell
  6 siblings, 0 replies; 9+ messages in thread
From: Peter Maydell @ 2020-07-07 15:20 UTC (permalink / raw)
  To: Thomas Huth; +Cc: QEMU Developers

On Mon, 6 Jul 2020 at 08:28, Thomas Huth <thuth@redhat.com> wrote:
>
>  Hi Peter,
>
> the following changes since commit eb6490f544388dd24c0d054a96dd304bc7284450:
>
>   Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20200703' into staging (2020-07-04 16:08:41 +0100)
>
> are available in the Git repository at:
>
>   https://gitlab.com/huth/qemu.git tags/pull-request-2020-07-06
>
> for you to fetch changes up to 70f909b4eec6fa92a9e33a8d23e185cad7abd533:
>
>   tests/acceptance: Add a test for the sun4u sparc64 machine (2020-07-06 07:37:02 +0200)
>
> ----------------------------------------------------------------
> * Fuzzer fixes from Alexander
> * Clean-up patches for qtests, configure and mcf5206
> * Sparc64 sun4u acceptance test
> ----------------------------------------------------------------


Applied, thanks.

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

-- PMM


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

end of thread, other threads:[~2020-07-07 15:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-06  7:28 [PULL 0/6] qtest and misc patches Thomas Huth
2020-07-06  7:28 ` [PULL 1/6] fuzz: fix broken qtest check at rcu_disable_atfork Thomas Huth
2020-07-06  7:28 ` [PULL 2/6] fuzz: do not use POSIX shm for coverage bitmap Thomas Huth
2020-07-06  7:28 ` [PULL 3/6] tests/qtest: Unify the test for the xenfv and xenpv machines Thomas Huth
2020-07-06  7:28 ` [PULL 4/6] configure / util: Auto-detect the availability of openpty() Thomas Huth
2020-07-06  7:28 ` [PULL 5/6] hw/m68k/mcf5206: Replace remaining hw_error()s by qemu_log_mask() Thomas Huth
2020-07-06  7:36   ` Thomas Huth
2020-07-06  7:28 ` [PULL 6/6] tests/acceptance: Add a test for the sun4u sparc64 machine Thomas Huth
2020-07-07 15:20 ` [PULL 0/6] qtest and misc patches Peter Maydell

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).