QEMU-Devel Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH  v1 0/8] plugins/next (cleanup, cpu_index and lockstep)
@ 2020-05-13 17:31 Alex Bennée
  2020-05-13 17:31 ` [PATCH v1 1/8] qemu/plugin: Trivial code movement Alex Bennée
                   ` (11 more replies)
  0 siblings, 12 replies; 21+ messages in thread
From: Alex Bennée @ 2020-05-13 17:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alex Bennée

Hi,

This is the current state of my plugins/next tree. It contains 3 bits
of work. 

First some minor clean-ups from Phillipe to help with his other
re-factoring work.

Next are some fixes for a crash reported by Nikolay on the list. The
root cause was a re-use of cpu_index although I've also tried to clean
up the handling of pthread termination.

Finally there is another iteration of my lockstep plugin which has had
a little more tinkering to better detect divergence between two
QEMU's. It's no Rehoboam but it will hopefully be helpful.

The following patches need review:

 - plugins: new lockstep plugin for debugging TCG changes
 - tests/tcg: add new threadcount test
 - linux-user: properly "unrealize" vCPU object
 - cpus-common: ensure auto-assigned cpu_indexes don't clash
 - MAINTAINERS: update the orphaned cpus-common.c file

Alex Bennée (5):
  MAINTAINERS: update the orphaned cpus-common.c file
  cpus-common: ensure auto-assigned cpu_indexes don't clash
  linux-user: properly "unrealize" vCPU object
  tests/tcg: add new threadcount test
  plugins: new lockstep plugin for debugging TCG changes

Philippe Mathieu-Daudé (3):
  qemu/plugin: Trivial code movement
  qemu/plugin: Move !CONFIG_PLUGIN stubs altogether
  qemu/qemu-plugin: Make qemu_plugin_hwaddr_is_io() hwaddr argument
    const

 include/qemu/plugin.h               |  65 +++---
 include/qemu/qemu-plugin.h          |   2 +-
 cpus-common.c                       |   9 +-
 linux-user/syscall.c                |  19 +-
 plugins/api.c                       |   4 +-
 tests/plugin/lockstep.c             | 345 ++++++++++++++++++++++++++++
 tests/tcg/multiarch/threadcount.c   |  62 +++++
 MAINTAINERS                         |   1 +
 tests/plugin/Makefile               |   1 +
 tests/tcg/Makefile.target           |   2 +-
 tests/tcg/multiarch/Makefile.target |   2 +
 11 files changed, 461 insertions(+), 51 deletions(-)
 create mode 100644 tests/plugin/lockstep.c
 create mode 100644 tests/tcg/multiarch/threadcount.c

-- 
2.20.1



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

* [PATCH  v1 1/8] qemu/plugin: Trivial code movement
  2020-05-13 17:31 [PATCH v1 0/8] plugins/next (cleanup, cpu_index and lockstep) Alex Bennée
@ 2020-05-13 17:31 ` Alex Bennée
  2020-05-13 17:31 ` [PATCH v1 2/8] qemu/plugin: Move !CONFIG_PLUGIN stubs altogether Alex Bennée
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 21+ messages in thread
From: Alex Bennée @ 2020-05-13 17:31 UTC (permalink / raw)
  To: qemu-devel
  Cc: open list:Trivial patches, Michael Tokarev, Alex Bennée,
	Philippe Mathieu-Daudé,
	Laurent Vivier

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

Move the qemu_plugin_event enum declaration earlier.
This will make the next commit easier to review.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20200510171119.20827-2-f4bug@amsat.org>
---
 include/qemu/plugin.h | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/include/qemu/plugin.h b/include/qemu/plugin.h
index 11687e8cdc3..e45f950fe36 100644
--- a/include/qemu/plugin.h
+++ b/include/qemu/plugin.h
@@ -13,6 +13,22 @@
 #include "qemu/queue.h"
 #include "qemu/option.h"
 
+/*
+ * Events that plugins can subscribe to.
+ */
+enum qemu_plugin_event {
+    QEMU_PLUGIN_EV_VCPU_INIT,
+    QEMU_PLUGIN_EV_VCPU_EXIT,
+    QEMU_PLUGIN_EV_VCPU_TB_TRANS,
+    QEMU_PLUGIN_EV_VCPU_IDLE,
+    QEMU_PLUGIN_EV_VCPU_RESUME,
+    QEMU_PLUGIN_EV_VCPU_SYSCALL,
+    QEMU_PLUGIN_EV_VCPU_SYSCALL_RET,
+    QEMU_PLUGIN_EV_FLUSH,
+    QEMU_PLUGIN_EV_ATEXIT,
+    QEMU_PLUGIN_EV_MAX, /* total number of plugin events we support */
+};
+
 /*
  * Option parsing/processing.
  * Note that we can load an arbitrary number of plugins.
@@ -47,22 +63,6 @@ static inline int qemu_plugin_load_list(QemuPluginList *head)
 }
 #endif /* !CONFIG_PLUGIN */
 
-/*
- * Events that plugins can subscribe to.
- */
-enum qemu_plugin_event {
-    QEMU_PLUGIN_EV_VCPU_INIT,
-    QEMU_PLUGIN_EV_VCPU_EXIT,
-    QEMU_PLUGIN_EV_VCPU_TB_TRANS,
-    QEMU_PLUGIN_EV_VCPU_IDLE,
-    QEMU_PLUGIN_EV_VCPU_RESUME,
-    QEMU_PLUGIN_EV_VCPU_SYSCALL,
-    QEMU_PLUGIN_EV_VCPU_SYSCALL_RET,
-    QEMU_PLUGIN_EV_FLUSH,
-    QEMU_PLUGIN_EV_ATEXIT,
-    QEMU_PLUGIN_EV_MAX, /* total number of plugin events we support */
-};
-
 union qemu_plugin_cb_sig {
     qemu_plugin_simple_cb_t          simple;
     qemu_plugin_udata_cb_t           udata;
-- 
2.20.1



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

* [PATCH  v1 2/8] qemu/plugin: Move !CONFIG_PLUGIN stubs altogether
  2020-05-13 17:31 [PATCH v1 0/8] plugins/next (cleanup, cpu_index and lockstep) Alex Bennée
  2020-05-13 17:31 ` [PATCH v1 1/8] qemu/plugin: Trivial code movement Alex Bennée
@ 2020-05-13 17:31 ` Alex Bennée
  2020-05-13 17:31 ` [PATCH v1 3/8] qemu/qemu-plugin: Make qemu_plugin_hwaddr_is_io() hwaddr argument const Alex Bennée
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 21+ messages in thread
From: Alex Bennée @ 2020-05-13 17:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alex Bennée, Philippe Mathieu-Daudé

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

Simplify the ifdef'ry by moving all stubs together.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20200510171119.20827-3-f4bug@amsat.org>
---
 include/qemu/plugin.h | 33 +++++++++++++++------------------
 1 file changed, 15 insertions(+), 18 deletions(-)

diff --git a/include/qemu/plugin.h b/include/qemu/plugin.h
index e45f950fe36..ab790ad105c 100644
--- a/include/qemu/plugin.h
+++ b/include/qemu/plugin.h
@@ -46,22 +46,6 @@ static inline void qemu_plugin_add_opts(void)
 
 void qemu_plugin_opt_parse(const char *optarg, QemuPluginList *head);
 int qemu_plugin_load_list(QemuPluginList *head);
-#else /* !CONFIG_PLUGIN */
-static inline void qemu_plugin_add_opts(void)
-{ }
-
-static inline void qemu_plugin_opt_parse(const char *optarg,
-                                         QemuPluginList *head)
-{
-    error_report("plugin interface not enabled in this build");
-    exit(1);
-}
-
-static inline int qemu_plugin_load_list(QemuPluginList *head)
-{
-    return 0;
-}
-#endif /* !CONFIG_PLUGIN */
 
 union qemu_plugin_cb_sig {
     qemu_plugin_simple_cb_t          simple;
@@ -182,8 +166,6 @@ struct qemu_plugin_insn *qemu_plugin_tb_insn_get(struct qemu_plugin_tb *tb)
     return insn;
 }
 
-#ifdef CONFIG_PLUGIN
-
 void qemu_plugin_vcpu_init_hook(CPUState *cpu);
 void qemu_plugin_vcpu_exit_hook(CPUState *cpu);
 void qemu_plugin_tb_trans_cb(CPUState *cpu, struct qemu_plugin_tb *tb);
@@ -207,6 +189,21 @@ void qemu_plugin_disable_mem_helpers(CPUState *cpu);
 
 #else /* !CONFIG_PLUGIN */
 
+static inline void qemu_plugin_add_opts(void)
+{ }
+
+static inline void qemu_plugin_opt_parse(const char *optarg,
+                                         QemuPluginList *head)
+{
+    error_report("plugin interface not enabled in this build");
+    exit(1);
+}
+
+static inline int qemu_plugin_load_list(QemuPluginList *head)
+{
+    return 0;
+}
+
 static inline void qemu_plugin_vcpu_init_hook(CPUState *cpu)
 { }
 
-- 
2.20.1



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

* [PATCH v1 3/8] qemu/qemu-plugin: Make qemu_plugin_hwaddr_is_io() hwaddr argument const
  2020-05-13 17:31 [PATCH v1 0/8] plugins/next (cleanup, cpu_index and lockstep) Alex Bennée
  2020-05-13 17:31 ` [PATCH v1 1/8] qemu/plugin: Trivial code movement Alex Bennée
  2020-05-13 17:31 ` [PATCH v1 2/8] qemu/plugin: Move !CONFIG_PLUGIN stubs altogether Alex Bennée
@ 2020-05-13 17:31 ` Alex Bennée
  2020-05-13 17:31 ` [PATCH v1 4/8] MAINTAINERS: update the orphaned cpus-common.c file Alex Bennée
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 21+ messages in thread
From: Alex Bennée @ 2020-05-13 17:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alex Bennée, Philippe Mathieu-Daudé

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

Rename qemu_plugin_hwaddr_is_io() address argument 'haddr'
similarly to qemu_plugin_hwaddr_device_offset(), and make
it const.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20200510171119.20827-4-f4bug@amsat.org>
---
 include/qemu/qemu-plugin.h | 2 +-
 plugins/api.c              | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h
index 5502e112c81..89ed579f559 100644
--- a/include/qemu/qemu-plugin.h
+++ b/include/qemu/qemu-plugin.h
@@ -331,7 +331,7 @@ struct qemu_plugin_hwaddr *qemu_plugin_get_hwaddr(qemu_plugin_meminfo_t info,
  * to return information about it. For non-IO accesses the device
  * offset will be into the appropriate block of RAM.
  */
-bool qemu_plugin_hwaddr_is_io(struct qemu_plugin_hwaddr *hwaddr);
+bool qemu_plugin_hwaddr_is_io(const struct qemu_plugin_hwaddr *haddr);
 uint64_t qemu_plugin_hwaddr_device_offset(const struct qemu_plugin_hwaddr *haddr);
 
 typedef void
diff --git a/plugins/api.c b/plugins/api.c
index 53c8a735823..bbdc5a4eb46 100644
--- a/plugins/api.c
+++ b/plugins/api.c
@@ -275,10 +275,10 @@ struct qemu_plugin_hwaddr *qemu_plugin_get_hwaddr(qemu_plugin_meminfo_t info,
 }
 #endif
 
-bool qemu_plugin_hwaddr_is_io(struct qemu_plugin_hwaddr *hwaddr)
+bool qemu_plugin_hwaddr_is_io(const struct qemu_plugin_hwaddr *haddr)
 {
 #ifdef CONFIG_SOFTMMU
-    return hwaddr->is_io;
+    return haddr->is_io;
 #else
     return false;
 #endif
-- 
2.20.1



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

* [PATCH  v1 4/8] MAINTAINERS: update the orphaned cpus-common.c file
  2020-05-13 17:31 [PATCH v1 0/8] plugins/next (cleanup, cpu_index and lockstep) Alex Bennée
                   ` (2 preceding siblings ...)
  2020-05-13 17:31 ` [PATCH v1 3/8] qemu/qemu-plugin: Make qemu_plugin_hwaddr_is_io() hwaddr argument const Alex Bennée
@ 2020-05-13 17:31 ` Alex Bennée
  2020-05-13 19:26   ` Philippe Mathieu-Daudé
  2020-05-13 17:31 ` [PATCH v1 5/8] cpus-common: ensure auto-assigned cpu_indexes don't clash Alex Bennée
                   ` (7 subsequent siblings)
  11 siblings, 1 reply; 21+ messages in thread
From: Alex Bennée @ 2020-05-13 17:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alex Bennée

We forgot to update MAINTAINERS when this code was re-factored.

Fixes: 267f685b8b
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 1f84e3ae2c6..cfe71898d2f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -115,6 +115,7 @@ M: Richard Henderson <rth@twiddle.net>
 R: Paolo Bonzini <pbonzini@redhat.com>
 S: Maintained
 F: cpus.c
+F: cpus-common.c
 F: exec.c
 F: accel/tcg/
 F: accel/stubs/tcg-stub.c
-- 
2.20.1



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

* [PATCH v1 5/8] cpus-common: ensure auto-assigned cpu_indexes don't clash
  2020-05-13 17:31 [PATCH v1 0/8] plugins/next (cleanup, cpu_index and lockstep) Alex Bennée
                   ` (3 preceding siblings ...)
  2020-05-13 17:31 ` [PATCH v1 4/8] MAINTAINERS: update the orphaned cpus-common.c file Alex Bennée
@ 2020-05-13 17:31 ` Alex Bennée
  2020-05-14 16:27   ` Alex Bennée
  2020-05-13 17:31 ` [PATCH v1 6/8] linux-user: properly "unrealize" vCPU object Alex Bennée
                   ` (6 subsequent siblings)
  11 siblings, 1 reply; 21+ messages in thread
From: Alex Bennée @ 2020-05-13 17:31 UTC (permalink / raw)
  To: qemu-devel
  Cc: Eduardo Habkost, Nikolay Igotti, Igor Mammedov, Paolo Bonzini,
	Alex Bennée, Richard Henderson

Basing the cpu_index on the number of currently allocated vCPUs fails
when vCPUs aren't removed in a LIFO manner. This is especially true
when we are allocating a cpu_index for each guest thread in
linux-user where there is no ordering constraint on their allocation
and de-allocation.

[I've dropped the assert which is there to guard against out-of-order
removal as this should probably be caught higher up the stack. Maybe
we could just ifdef CONFIG_SOFTTMU it?]

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Cc: Nikolay Igotti <igotti@gmail.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
---
 cpus-common.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/cpus-common.c b/cpus-common.c
index 55d5df89237..5a7d2f6132b 100644
--- a/cpus-common.c
+++ b/cpus-common.c
@@ -61,13 +61,14 @@ static bool cpu_index_auto_assigned;
 static int cpu_get_free_index(void)
 {
     CPUState *some_cpu;
-    int cpu_index = 0;
+    int max_cpu_index = 0;
 
     cpu_index_auto_assigned = true;
     CPU_FOREACH(some_cpu) {
-        cpu_index++;
+        max_cpu_index = MAX(some_cpu->cpu_index, max_cpu_index);
     }
-    return cpu_index;
+    max_cpu_index++;
+    return max_cpu_index;
 }
 
 void cpu_list_add(CPUState *cpu)
@@ -90,8 +91,6 @@ void cpu_list_remove(CPUState *cpu)
         return;
     }
 
-    assert(!(cpu_index_auto_assigned && cpu != QTAILQ_LAST(&cpus)));
-
     QTAILQ_REMOVE_RCU(&cpus, cpu, node);
     cpu->cpu_index = UNASSIGNED_CPU_INDEX;
 }
-- 
2.20.1



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

* [PATCH  v1 6/8] linux-user: properly "unrealize" vCPU object
  2020-05-13 17:31 [PATCH v1 0/8] plugins/next (cleanup, cpu_index and lockstep) Alex Bennée
                   ` (4 preceding siblings ...)
  2020-05-13 17:31 ` [PATCH v1 5/8] cpus-common: ensure auto-assigned cpu_indexes don't clash Alex Bennée
@ 2020-05-13 17:31 ` Alex Bennée
  2020-05-22  9:35   ` Philippe Mathieu-Daudé
  2020-05-13 17:31 ` [PATCH v1 7/8] tests/tcg: add new threadcount test Alex Bennée
                   ` (5 subsequent siblings)
  11 siblings, 1 reply; 21+ messages in thread
From: Alex Bennée @ 2020-05-13 17:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Riku Voipio, Alex Bennée, Laurent Vivier, Nikolay Igotti

We shouldn't be messing around with the CPU list in linux-user save
for the very special case of do_fork(). When threads end we need to
properly follow QOM object lifetime handling and allow the eventual
cpu_common_unrealizefn to both remove the CPU and ensure any clean-up
actions are taken place, for example calling plugin exit hooks.

There is still a race condition to avoid so use the linux-user
specific clone_lock instead of the cpu_list_lock to avoid it.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Cc: Nikolay Igotti <igotti@gmail.com>
---
 linux-user/syscall.c | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 05f03919ff0..7f6700c54e3 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7635,30 +7635,33 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
             return -TARGET_ERESTARTSYS;
         }
 
-        cpu_list_lock();
+        pthread_mutex_lock(&clone_lock);
 
         if (CPU_NEXT(first_cpu)) {
-            TaskState *ts;
+            TaskState *ts = cpu->opaque;
 
-            /* Remove the CPU from the list.  */
-            QTAILQ_REMOVE_RCU(&cpus, cpu, node);
+            object_property_set_bool(OBJECT(cpu), false, "realized", NULL);
+            object_unref(OBJECT(cpu));
+            /*
+             * At this point the CPU should be unrealized and removed
+             * from cpu lists. We can clean-up the rest of the thread
+             * data without the lock held.
+             */
 
-            cpu_list_unlock();
+            pthread_mutex_unlock(&clone_lock);
 
-            ts = cpu->opaque;
             if (ts->child_tidptr) {
                 put_user_u32(0, ts->child_tidptr);
                 do_sys_futex(g2h(ts->child_tidptr), FUTEX_WAKE, INT_MAX,
                           NULL, NULL, 0);
             }
             thread_cpu = NULL;
-            object_unref(OBJECT(cpu));
             g_free(ts);
             rcu_unregister_thread();
             pthread_exit(NULL);
         }
 
-        cpu_list_unlock();
+        pthread_mutex_unlock(&clone_lock);
         preexit_cleanup(cpu_env, arg1);
         _exit(arg1);
         return 0; /* avoid warning */
-- 
2.20.1



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

* [PATCH  v1 7/8] tests/tcg: add new threadcount test
  2020-05-13 17:31 [PATCH v1 0/8] plugins/next (cleanup, cpu_index and lockstep) Alex Bennée
                   ` (5 preceding siblings ...)
  2020-05-13 17:31 ` [PATCH v1 6/8] linux-user: properly "unrealize" vCPU object Alex Bennée
@ 2020-05-13 17:31 ` Alex Bennée
  2020-05-15 19:51   ` Nikolay Igotti
  2020-05-22  9:33   ` Philippe Mathieu-Daudé
  2020-05-13 17:32 ` [PATCH v1 8/8] plugins: new lockstep plugin for debugging TCG changes Alex Bennée
                   ` (4 subsequent siblings)
  11 siblings, 2 replies; 21+ messages in thread
From: Alex Bennée @ 2020-05-13 17:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alex Bennée, Nikolay Igotti

Based on the original testcase by Nikolay Igotti.

Message-ID: <CAEme+7GLKg_dNsHizzTKDymX9HyD+Ph2iZ=WKhOw2XG+zhViXg@mail.gmail.com>
Cc: Nikolay Igotti <igotti@gmail.com>
[Nikolay can we have your signed of by to add the testcase?]
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 tests/tcg/multiarch/threadcount.c   | 62 +++++++++++++++++++++++++++++
 tests/tcg/multiarch/Makefile.target |  2 +
 2 files changed, 64 insertions(+)
 create mode 100644 tests/tcg/multiarch/threadcount.c

diff --git a/tests/tcg/multiarch/threadcount.c b/tests/tcg/multiarch/threadcount.c
new file mode 100644
index 00000000000..546dd90eeb2
--- /dev/null
+++ b/tests/tcg/multiarch/threadcount.c
@@ -0,0 +1,62 @@
+/*
+ * Thread Exerciser
+ *
+ * Unlike testthread which is mainly concerned about testing thread
+ * semantics this test is used to exercise the thread creation and
+ * accounting. A version of this test found a problem with clashing
+ * cpu_indexes which caused a break in plugin handling.
+ *
+ * Based on the original test case by Nikolay Igotti.
+ *
+ * Copyright (c) 2020 Linaro Ltd
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <pthread.h>
+
+int max_threads = 10;
+
+typedef struct {
+    int delay;
+} ThreadArg;
+
+static void *thread_fn(void* varg)  {
+    ThreadArg* arg = varg;
+    usleep(arg->delay);
+    free(arg);
+    return NULL;
+}
+
+int main(int argc, char **argv) {
+    int i;
+    pthread_t *threads;
+
+    if (argc > 1) {
+        max_threads = atoi(argv[1]);
+    }
+    threads = calloc(sizeof(pthread_t), max_threads);
+
+    for (i = 0; i < max_threads; i++) {
+        ThreadArg* arg = calloc(sizeof(ThreadArg), 1);
+        arg->delay = i * 100;
+        pthread_create(threads + i, NULL, thread_fn, arg);
+    }
+
+    printf("Created %d threads\n", max_threads);
+
+    /* sleep until roughly half the threads have "finished" */
+    usleep(max_threads * 50);
+
+    for (i = 0; i < max_threads; i++) {
+        pthread_join(threads[i], NULL);
+    }
+
+    printf("Done\n");
+
+    return 0;
+}
diff --git a/tests/tcg/multiarch/Makefile.target b/tests/tcg/multiarch/Makefile.target
index 51fb75ecfdd..cb49cc9ccb2 100644
--- a/tests/tcg/multiarch/Makefile.target
+++ b/tests/tcg/multiarch/Makefile.target
@@ -28,6 +28,8 @@ run-float_%: float_%
 
 testthread: LDFLAGS+=-lpthread
 
+threadcount: LDFLAGS+=-lpthread
+
 # We define the runner for test-mmap after the individual
 # architectures have defined their supported pages sizes. If no
 # additional page sizes are defined we only run the default test.
-- 
2.20.1



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

* [PATCH v1 8/8] plugins: new lockstep plugin for debugging TCG changes
  2020-05-13 17:31 [PATCH v1 0/8] plugins/next (cleanup, cpu_index and lockstep) Alex Bennée
                   ` (6 preceding siblings ...)
  2020-05-13 17:31 ` [PATCH v1 7/8] tests/tcg: add new threadcount test Alex Bennée
@ 2020-05-13 17:32 ` Alex Bennée
  2020-05-13 19:25 ` [PATCH v1 0/8] plugins/next (cleanup, cpu_index and lockstep) Philippe Mathieu-Daudé
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 21+ messages in thread
From: Alex Bennée @ 2020-05-13 17:32 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, Mark Cave-Ayland, Alex Bennée,
	Philippe Mathieu-Daudé

When we make changes to the TCG we sometimes cause regressions that
are deep into the execution cycle of the guest. Debugging this often
requires comparing large volumes of trace information to figure out
where behaviour has diverged.

The lockstep plugin utilises a shared socket so two QEMU's running
with the plugin will write their current execution position and wait
to receive the position of their partner process. When execution
diverges the plugins output where they were and the previous few
blocks before unloading themselves and letting execution continue.

Originally I planned for this to be most useful with -icount but it
turns out you can get divergence pretty quickly due to asynchronous
qemu_cpu_kick_rr_cpus() events causing one side to eventually run into
a short block a few cycles before the other side. For this reason I've
added a bit of tracking and I think the divergence reporting could be
finessed to report only if we really start to diverge in execution.

An example run would be:

  qemu-system-sparc -monitor none -parallel none -net none \
    -M SS-20 -m 256 -kernel day11/zImage.elf \
    -plugin ./tests/plugin/liblockstep.so,arg=lockstep-sparc.sock \
    -d plugin,nochain

with an identical command in another window in the same working
directory.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Cc: Richard Henderson <richard.henderson@linaro.org>
Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-Id: <20200429200754.18327-1-alex.bennee@linaro.org>

---
v3
  - added verbose flag
  - basic heuristics to detect "real" divergence
---
 tests/plugin/lockstep.c   | 345 ++++++++++++++++++++++++++++++++++++++
 tests/plugin/Makefile     |   1 +
 tests/tcg/Makefile.target |   2 +-
 3 files changed, 347 insertions(+), 1 deletion(-)
 create mode 100644 tests/plugin/lockstep.c

diff --git a/tests/plugin/lockstep.c b/tests/plugin/lockstep.c
new file mode 100644
index 00000000000..4d1a5c3264e
--- /dev/null
+++ b/tests/plugin/lockstep.c
@@ -0,0 +1,345 @@
+/*
+ * Lockstep Execution Plugin
+ *
+ * Allows you to execute two QEMU instances in lockstep and report
+ * when their execution diverges. This is mainly useful for developers
+ * who want to see where a change to TCG code generation has
+ * introduced a subtle and hard to find bug.
+ *
+ * Caveats:
+ *   - single-threaded linux-user apps only with non-deterministic syscalls
+ *   - no MTTCG enabled system emulation (icount may help)
+ *
+ * While icount makes things more deterministic it doesn't mean a
+ * particular run may execute the exact same sequence of blocks. An
+ * asynchronous event (for example X11 graphics update) may cause a
+ * block to end early and a new partial block to start. This means
+ * serial only test cases are a better bet. -d nochain may also help.
+ *
+ * This code is not thread safe!
+ *
+ * Copyright (c) 2020 Linaro Ltd
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include <glib.h>
+#include <inttypes.h>
+#include <unistd.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <stdio.h>
+#include <errno.h>
+
+#include <qemu-plugin.h>
+
+QEMU_PLUGIN_EXPORT int qemu_plugin_version = QEMU_PLUGIN_VERSION;
+
+/* saved so we can uninstall later */
+static qemu_plugin_id_t our_id;
+
+static unsigned long bb_count;
+static unsigned long insn_count;
+
+/* Information about a translated block */
+typedef struct {
+    uint64_t pc;
+    uint64_t insns;
+} BlockInfo;
+
+/* Information about an execution state in the log */
+typedef struct {
+    BlockInfo *block;
+    unsigned long insn_count;
+    unsigned long block_count;
+} ExecInfo;
+
+/* The execution state we compare */
+typedef struct {
+    uint64_t pc;
+    unsigned long insn_count;
+} ExecState;
+
+typedef struct {
+    GSList *log_pos;
+    int distance;
+} DivergeState;
+
+/* list of translated block info */
+static GSList *blocks;
+
+/* execution log and points of divergence */
+static GSList *log, *divergence_log;
+
+static int socket_fd;
+static char *path_to_unlink;
+
+static bool verbose;
+
+static void plugin_cleanup(qemu_plugin_id_t id)
+{
+    /* Free our block data */
+    g_slist_free_full(blocks, &g_free);
+    g_slist_free_full(log, &g_free);
+    g_slist_free(divergence_log);
+
+    close(socket_fd);
+    if (path_to_unlink) {
+        unlink(path_to_unlink);
+    }
+}
+
+static void plugin_exit(qemu_plugin_id_t id, void *p)
+{
+    g_autoptr(GString) out = g_string_new("No divergence :-)\n");
+    g_string_append_printf(out, "Executed %ld/%d blocks\n",
+                           bb_count, g_slist_length(log));
+    g_string_append_printf(out, "Executed ~%ld instructions\n", insn_count);
+    qemu_plugin_outs(out->str);
+
+    plugin_cleanup(id);
+}
+
+static inline const char * ord_ind(int n) {
+    return  n > 3 ? "th" :
+        n == 3 ? "rd" :
+        n == 2 ? "nd" : "st";
+}
+
+static void report_divergance(ExecState *us, ExecState *them)
+{
+    DivergeState divrec = { log, 0 };
+    g_autoptr(GString) out = g_string_new("");
+    bool diverged = false;
+
+    /*
+     * If we have diverged before did we get back on track or are we
+     * totally loosing it?
+     */
+    if (divergence_log) {
+        DivergeState *last = (DivergeState *) divergence_log->data;
+        GSList *entry;
+
+        for (entry = log; g_slist_next(entry); entry = g_slist_next(entry)) {
+            if (entry == last->log_pos) {
+                break;
+            }
+            divrec.distance++;
+        }
+
+        /*
+         * If the last two records are so close it is likely we will
+         * not recover synchronisation with the other end.
+         */
+        if (divrec.distance == 1 && last->distance == 1) {
+            diverged = true;
+        }
+    }
+    divergence_log = g_slist_prepend(divergence_log,
+                                     g_memdup(&divrec, sizeof(divrec)));
+
+    /* Output short log entry of going out of sync... */
+    if (verbose || divrec.distance == 1 || diverged) {
+        g_string_printf(out, "@ %#016lx vs %#016lx (%d/%d since last)\n",
+                        us->pc, them->pc, g_slist_length(divergence_log),
+                        divrec.distance);
+        qemu_plugin_outs(out->str);
+    }
+
+    if (diverged) {
+        int i;
+        GSList *entry;
+
+        g_string_printf(out, "Δ insn_count @ %#016lx (%ld) vs %#016lx (%ld)\n",
+                        us->pc, us->insn_count, them->pc, them->insn_count);
+
+        for (entry = log, i = 0;
+             g_slist_next(entry) && i < 5;
+             entry = g_slist_next(entry), i++) {
+            ExecInfo *prev = (ExecInfo *) entry->data;
+            g_string_append_printf(out, "  previously @ %#016lx/%ld (%ld insns)\n",
+                                   prev->block->pc, prev->block->insns,
+                                   prev->insn_count);
+        }
+        qemu_plugin_outs(out->str);
+        qemu_plugin_outs("too much divergence... giving up.");
+        qemu_plugin_uninstall(our_id, plugin_cleanup);
+    }
+}
+
+static void vcpu_tb_exec(unsigned int cpu_index, void *udata)
+{
+    BlockInfo *bi = (BlockInfo *) udata;
+    ExecState us, them;
+    ssize_t bytes;
+    ExecInfo *exec;
+
+    us.pc = bi->pc;
+    us.insn_count = insn_count;
+
+    /*
+     * Write our current position to the other end. If we fail the
+     * other end has probably died and we should shut down gracefully.
+     */
+    bytes = write(socket_fd, &us, sizeof(ExecState));
+    if (bytes < sizeof(ExecState)) {
+        qemu_plugin_outs(bytes < 0 ?
+                         "problem writing to socket" :
+                         "wrote less than expected to socket");
+        qemu_plugin_uninstall(our_id, plugin_cleanup);
+        return;
+    }
+
+    /*
+     * Now read where our peer has reached. Again a failure probably
+     * indicates the other end died and we should close down cleanly.
+     */
+    bytes = read(socket_fd, &them, sizeof(ExecState));
+    if (bytes < sizeof(ExecState)) {
+        qemu_plugin_outs(bytes < 0 ?
+                         "problem reading from socket" :
+                         "read less than expected");
+        qemu_plugin_uninstall(our_id, plugin_cleanup);
+        return;
+    }
+
+    /*
+     * Compare and report if we have diverged.
+     */
+    if (us.pc != them.pc) {
+        report_divergance(&us, &them);
+    }
+
+    /*
+     * Assume this block will execute fully and record it
+     * in the execution log.
+     */
+    insn_count += bi->insns;
+    bb_count++;
+    exec = g_new0(ExecInfo, 1);
+    exec->block = bi;
+    exec->insn_count = insn_count;
+    exec->block_count = bb_count;
+    log = g_slist_prepend(log, exec);
+}
+
+static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb)
+{
+    BlockInfo *bi = g_new0(BlockInfo, 1);
+    bi->pc = qemu_plugin_tb_vaddr(tb);
+    bi->insns = qemu_plugin_tb_n_insns(tb);
+
+    // save a reference so we can free later
+    blocks = g_slist_prepend(blocks, bi);
+    qemu_plugin_register_vcpu_tb_exec_cb(tb, vcpu_tb_exec,
+                                         QEMU_PLUGIN_CB_NO_REGS, (void *)bi);
+}
+
+
+/*
+ * Instead of encoding master/slave status into what is essentially
+ * two peers we shall just take the simple approach of checking for
+ * the existence of the pipe and assuming if it's not there we are the
+ * first process.
+ */
+static bool setup_socket(const char *path)
+{
+    struct sockaddr_un sockaddr;
+    int fd;
+
+    fd = socket(AF_UNIX, SOCK_STREAM, 0);
+    if (fd < 0) {
+        perror("create socket");
+        return false;
+    }
+
+    sockaddr.sun_family = AF_UNIX;
+    g_strlcpy(sockaddr.sun_path, path, sizeof(sockaddr.sun_path) - 1);
+    if (bind(fd, (struct sockaddr *)&sockaddr, sizeof(sockaddr)) < 0) {
+        perror("bind socket");
+        close(fd);
+        return false;
+    }
+
+    /* remember to clean-up */
+    path_to_unlink = g_strdup(path);
+
+    if (listen(fd, 1) < 0) {
+        perror("listen socket");
+        close(fd);
+        return false;
+    }
+
+    socket_fd = accept(fd, NULL, NULL);
+    if (socket_fd < 0 && errno != EINTR) {
+        perror("accept socket");
+        return false;
+    }
+
+    qemu_plugin_outs("setup_socket::ready\n");
+
+    return true;
+}
+
+static bool connect_socket(const char *path)
+{
+    int fd;
+    struct sockaddr_un sockaddr;
+
+    fd = socket(AF_UNIX, SOCK_STREAM, 0);
+    if (fd < 0) {
+        perror("create socket");
+        return false;
+    }
+
+    sockaddr.sun_family = AF_UNIX;
+    g_strlcpy(sockaddr.sun_path, path, sizeof(sockaddr.sun_path) - 1);
+
+    if (connect(fd, (struct sockaddr *)&sockaddr, sizeof(sockaddr)) < 0) {
+        perror("failed to connect");
+        return false;
+    }
+
+    qemu_plugin_outs("connect_socket::ready\n");
+
+    socket_fd = fd;
+    return true;
+}
+
+static bool setup_unix_socket(const char *path)
+{
+    if (g_file_test(path, G_FILE_TEST_EXISTS)) {
+        return connect_socket(path);
+    } else {
+        return setup_socket(path);
+    }
+}
+
+
+QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id,
+                                           const qemu_info_t *info,
+                                           int argc, char **argv)
+{
+    int i;
+
+    if (!argc || !argv[0]) {
+        qemu_plugin_outs("Need a socket path to talk to other instance.");
+        return -1;
+    }
+
+    for (i = 0; i < argc; i++) {
+        char *p = argv[i];
+        if (strcmp(p, "verbose") == 0) {
+            verbose = true;
+        } else if (!setup_unix_socket(argv[0])) {
+            qemu_plugin_outs("Failed to setup socket for communications.");
+            return -1;
+        }
+    }
+
+    our_id = id;
+
+    qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans);
+    qemu_plugin_register_atexit_cb(id, plugin_exit, NULL);
+    return 0;
+}
diff --git a/tests/plugin/Makefile b/tests/plugin/Makefile
index 75467b6db85..b3250e2504c 100644
--- a/tests/plugin/Makefile
+++ b/tests/plugin/Makefile
@@ -13,6 +13,7 @@ NAMES += mem
 NAMES += hotblocks
 NAMES += howvec
 NAMES += hotpages
+NAMES += lockstep
 
 SONAMES := $(addsuffix .so,$(addprefix lib,$(NAMES)))
 
diff --git a/tests/tcg/Makefile.target b/tests/tcg/Makefile.target
index b3cff3cad1a..075daf3d22d 100644
--- a/tests/tcg/Makefile.target
+++ b/tests/tcg/Makefile.target
@@ -128,7 +128,7 @@ RUN_TESTS=$(patsubst %,run-%, $(TESTS))
 ifeq ($(CONFIG_PLUGIN),y)
 PLUGIN_DIR=../../plugin
 VPATH+=$(PLUGIN_DIR)
-PLUGINS=$(notdir $(wildcard $(PLUGIN_DIR)/*.so))
+PLUGINS=$(filter-out liblockstep.so,$(notdir $(wildcard $(PLUGIN_DIR)/*.so)))
 
 # We need to ensure expand the run-plugin-TEST-with-PLUGIN
 # pre-requistes manually here as we can't use stems to handle it. We
-- 
2.20.1



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

* Re: [PATCH v1 0/8] plugins/next (cleanup, cpu_index and lockstep)
  2020-05-13 17:31 [PATCH v1 0/8] plugins/next (cleanup, cpu_index and lockstep) Alex Bennée
                   ` (7 preceding siblings ...)
  2020-05-13 17:32 ` [PATCH v1 8/8] plugins: new lockstep plugin for debugging TCG changes Alex Bennée
@ 2020-05-13 19:25 ` Philippe Mathieu-Daudé
  2020-05-14  0:56 ` no-reply
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 21+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-05-13 19:25 UTC (permalink / raw)
  To: Alex Bennée, qemu-devel

On 5/13/20 7:31 PM, Alex Bennée wrote:
> Hi,
> 
> This is the current state of my plugins/next tree. It contains 3 bits
> of work.
> 
> First some minor clean-ups from Phillipe to help with his other
> re-factoring work.

Thanks for picking these. Note they already have:
Reviewed-by: Emilio G. Cota <cota@braap.org>
https://www.mail-archive.com/qemu-devel@nongnu.org/msg701882.html

> 
> Next are some fixes for a crash reported by Nikolay on the list. The
> root cause was a re-use of cpu_index although I've also tried to clean
> up the handling of pthread termination.
> 
> Finally there is another iteration of my lockstep plugin which has had
> a little more tinkering to better detect divergence between two
> QEMU's. It's no Rehoboam but it will hopefully be helpful.
> 
> The following patches need review:
> 
>   - plugins: new lockstep plugin for debugging TCG changes
>   - tests/tcg: add new threadcount test
>   - linux-user: properly "unrealize" vCPU object
>   - cpus-common: ensure auto-assigned cpu_indexes don't clash
>   - MAINTAINERS: update the orphaned cpus-common.c file
> 
> Alex Bennée (5):
>    MAINTAINERS: update the orphaned cpus-common.c file
>    cpus-common: ensure auto-assigned cpu_indexes don't clash
>    linux-user: properly "unrealize" vCPU object
>    tests/tcg: add new threadcount test
>    plugins: new lockstep plugin for debugging TCG changes
> 
> Philippe Mathieu-Daudé (3):
>    qemu/plugin: Trivial code movement
>    qemu/plugin: Move !CONFIG_PLUGIN stubs altogether
>    qemu/qemu-plugin: Make qemu_plugin_hwaddr_is_io() hwaddr argument
>      const
> 
>   include/qemu/plugin.h               |  65 +++---
>   include/qemu/qemu-plugin.h          |   2 +-
>   cpus-common.c                       |   9 +-
>   linux-user/syscall.c                |  19 +-
>   plugins/api.c                       |   4 +-
>   tests/plugin/lockstep.c             | 345 ++++++++++++++++++++++++++++
>   tests/tcg/multiarch/threadcount.c   |  62 +++++
>   MAINTAINERS                         |   1 +
>   tests/plugin/Makefile               |   1 +
>   tests/tcg/Makefile.target           |   2 +-
>   tests/tcg/multiarch/Makefile.target |   2 +
>   11 files changed, 461 insertions(+), 51 deletions(-)
>   create mode 100644 tests/plugin/lockstep.c
>   create mode 100644 tests/tcg/multiarch/threadcount.c
> 



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

* Re: [PATCH v1 4/8] MAINTAINERS: update the orphaned cpus-common.c file
  2020-05-13 17:31 ` [PATCH v1 4/8] MAINTAINERS: update the orphaned cpus-common.c file Alex Bennée
@ 2020-05-13 19:26   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 21+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-05-13 19:26 UTC (permalink / raw)
  To: Alex Bennée, qemu-devel

On 5/13/20 7:31 PM, Alex Bennée wrote:
> We forgot to update MAINTAINERS when this code was re-factored.
> 
> Fixes: 267f685b8b
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>   MAINTAINERS | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 1f84e3ae2c6..cfe71898d2f 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -115,6 +115,7 @@ M: Richard Henderson <rth@twiddle.net>
>   R: Paolo Bonzini <pbonzini@redhat.com>
>   S: Maintained
>   F: cpus.c
> +F: cpus-common.c
>   F: exec.c
>   F: accel/tcg/
>   F: accel/stubs/tcg-stub.c
> 

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>



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

* Re: [PATCH  v1 0/8] plugins/next (cleanup, cpu_index and lockstep)
  2020-05-13 17:31 [PATCH v1 0/8] plugins/next (cleanup, cpu_index and lockstep) Alex Bennée
                   ` (8 preceding siblings ...)
  2020-05-13 19:25 ` [PATCH v1 0/8] plugins/next (cleanup, cpu_index and lockstep) Philippe Mathieu-Daudé
@ 2020-05-14  0:56 ` no-reply
  2020-05-14  1:36 ` no-reply
  2020-05-14  1:36 ` no-reply
  11 siblings, 0 replies; 21+ messages in thread
From: no-reply @ 2020-05-14  0:56 UTC (permalink / raw)
  To: alex.bennee; +Cc: alex.bennee, qemu-devel

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



Hi,

This series failed the docker-quick@centos7 build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-centos7 V=1 NETWORK=1
time make docker-test-quick@centos7 SHOW_ENV=1 J=14 NETWORK=1
=== TEST SCRIPT END ===

  TEST    check-qtest-aarch64: tests/qtest/qom-test
Broken pipe
/tmp/qemu-test/src/tests/qtest/libqtest.c:175: kill_qemu() detected QEMU death from signal 11 (Segmentation fault) (core dumped)
ERROR - too few tests run (expected 65, got 0)
make: *** [check-qtest-aarch64] Error 1
make: *** Waiting for unfinished jobs....
  TEST    iotest-qcow2: 191
  TEST    iotest-qcow2: 192
---
qemu-system-x86_64: /tmp/qemu-test/src/hw/i386/x86.c:175: x86_cpu_index_to_props: Assertion `cpu_index < possible_cpus->len' failed.
Broken pipe
/tmp/qemu-test/src/tests/qtest/libqtest.c:175: kill_qemu() detected QEMU death from signal 6 (Aborted) (core dumped)
ERROR - too few tests run (expected 8, got 6)
make: *** [check-qtest-x86_64] Error 1
  TEST    iotest-qcow2: 220
  TEST    iotest-qcow2: 226
  TEST    iotest-qcow2: 229
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=08679829d9d5406eac35a1969274235b', '-u', '1003', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-82odvgxj/src/docker-src.2020-05-13-20.42.51.22402:/var/tmp/qemu:z,ro', 'qemu:centos7', '/var/tmp/qemu/run', 'test-quick']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=08679829d9d5406eac35a1969274235b
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-82odvgxj/src'
make: *** [docker-run-test-quick@centos7] Error 2

real    13m11.300s
user    0m8.296s


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

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

* Re: [PATCH  v1 0/8] plugins/next (cleanup, cpu_index and lockstep)
  2020-05-13 17:31 [PATCH v1 0/8] plugins/next (cleanup, cpu_index and lockstep) Alex Bennée
                   ` (9 preceding siblings ...)
  2020-05-14  0:56 ` no-reply
@ 2020-05-14  1:36 ` no-reply
  2020-05-14  1:36 ` no-reply
  11 siblings, 0 replies; 21+ messages in thread
From: no-reply @ 2020-05-14  1:36 UTC (permalink / raw)
  To: alex.bennee; +Cc: alex.bennee, qemu-devel

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



Hi,

This series failed the asan build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
export ARCH=x86_64
make docker-image-fedora V=1 NETWORK=1
time make docker-test-debug@fedora TARGET_LIST=x86_64-softmmu J=14 NETWORK=1
=== TEST SCRIPT END ===

PASS 25 test-qobject-output-visitor /visitor/output/list_union/string
PASS 26 test-qobject-output-visitor /visitor/output/list_union/number
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-clone-visitor -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-clone-visitor" 
==6834==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 4 fdc-test /x86_64/fdc/media_change
PASS 5 fdc-test /x86_64/fdc/sense_interrupt
PASS 6 fdc-test /x86_64/fdc/relative_seek
---
PASS 32 test-opts-visitor /visitor/opts/range/beyond
PASS 33 test-opts-visitor /visitor/opts/dict/unvisited
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-coroutine -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-coroutine" 
==6876==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-coroutine /basic/no-dangling-access
PASS 2 test-coroutine /basic/lifecycle
PASS 3 test-coroutine /basic/yield
==6876==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffd64376000; bottom 0x7f9487ba2000; size: 0x0068dc7d4000 (450375794688)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 4 test-coroutine /basic/nesting
---
PASS 11 test-aio /aio/event/wait
PASS 12 test-aio /aio/event/flush
PASS 13 test-aio /aio/event/wait/no-flush-cb
==6891==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 14 test-aio /aio/timer/schedule
PASS 15 test-aio /aio/coroutine/queue-chaining
PASS 16 test-aio /aio-gsource/flush
---
PASS 12 fdc-test /x86_64/fdc/read_no_dma_19
PASS 13 fdc-test /x86_64/fdc/fuzz-registers
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 QTEST_QEMU_IMG=qemu-img tests/qtest/ide-test -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="ide-test" 
==6899==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 ide-test /x86_64/ide/identify
PASS 28 test-aio /aio-gsource/timer/schedule
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-aio-multithread -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-aio-multithread" 
==6908==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-aio-multithread /aio/multi/lifecycle
==6905==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 2 ide-test /x86_64/ide/flush
==6925==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 2 test-aio-multithread /aio/multi/schedule
PASS 3 ide-test /x86_64/ide/bmdma/simple_rw
==6936==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 3 test-aio-multithread /aio/multi/mutex/contended
PASS 4 ide-test /x86_64/ide/bmdma/trim
==6947==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 4 test-aio-multithread /aio/multi/mutex/handoff
PASS 5 test-aio-multithread /aio/multi/mutex/mcs
PASS 6 test-aio-multithread /aio/multi/mutex/pthread
---
PASS 6 test-throttle /throttle/detach_attach
PASS 7 test-throttle /throttle/config_functions
PASS 8 test-throttle /throttle/accounting
==6964==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 9 test-throttle /throttle/groups
PASS 10 test-throttle /throttle/config/enabled
PASS 11 test-throttle /throttle/config/conflicting
---
PASS 14 test-throttle /throttle/config/max
PASS 15 test-throttle /throttle/config/iops_size
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-thread-pool -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-thread-pool" 
==6968==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-thread-pool /thread-pool/submit
PASS 2 test-thread-pool /thread-pool/submit-aio
PASS 3 test-thread-pool /thread-pool/submit-co
PASS 4 test-thread-pool /thread-pool/submit-many
==7010==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 5 test-thread-pool /thread-pool/cancel
PASS 6 test-thread-pool /thread-pool/cancel-async
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-hbitmap -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-hbitmap" 
---
PASS 14 test-hbitmap /hbitmap/set/twice
PASS 15 test-hbitmap /hbitmap/set/overlap
PASS 16 test-hbitmap /hbitmap/reset/empty
==7045==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 17 test-hbitmap /hbitmap/reset/general
PASS 18 test-hbitmap /hbitmap/reset/all
PASS 19 test-hbitmap /hbitmap/truncate/nop
---
PASS 39 test-hbitmap /hbitmap/next_dirty_area/next_dirty_area_4
PASS 40 test-hbitmap /hbitmap/next_dirty_area/next_dirty_area_after_truncate
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-bdrv-drain -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-bdrv-drain" 
==7052==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-bdrv-drain /bdrv-drain/nested
PASS 2 test-bdrv-drain /bdrv-drain/multiparent
PASS 3 test-bdrv-drain /bdrv-drain/set_aio_context
---
PASS 41 test-bdrv-drain /bdrv-drain/bdrv_drop_intermediate/poll
PASS 42 test-bdrv-drain /bdrv-drain/replace_child/mid-drain
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-bdrv-graph-mod -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-bdrv-graph-mod" 
==7091==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-bdrv-graph-mod /bdrv-graph-mod/update-perm-tree
PASS 2 test-bdrv-graph-mod /bdrv-graph-mod/should-update-child
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-blockjob -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-blockjob" 
==7095==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-blockjob /blockjob/ids
PASS 2 test-blockjob /blockjob/cancel/created
PASS 3 test-blockjob /blockjob/cancel/running
---
PASS 7 test-blockjob /blockjob/cancel/pending
PASS 8 test-blockjob /blockjob/cancel/concluded
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-blockjob-txn -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-blockjob-txn" 
==7099==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-blockjob-txn /single/success
PASS 2 test-blockjob-txn /single/failure
PASS 3 test-blockjob-txn /single/cancel
---
PASS 6 test-blockjob-txn /pair/cancel
PASS 7 test-blockjob-txn /pair/fail-cancel-race
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-block-backend -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-block-backend" 
==7103==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-block-backend /block-backend/drain_aio_error
PASS 2 test-block-backend /block-backend/drain_all_aio_error
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-block-iothread -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-block-iothread" 
==7107==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-block-iothread /sync-op/pread
PASS 2 test-block-iothread /sync-op/pwrite
PASS 3 test-block-iothread /sync-op/load_vmstate
---
PASS 15 test-block-iothread /propagate/diamond
PASS 16 test-block-iothread /propagate/mirror
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-image-locking -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-image-locking" 
==7127==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-image-locking /image-locking/basic
PASS 2 test-image-locking /image-locking/set-perm-abort
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-x86-cpuid -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-x86-cpuid" 
PASS 1 test-x86-cpuid /cpuid/topology/basic
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-xbzrle -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-xbzrle" 
==7129==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-xbzrle /xbzrle/uleb
PASS 2 test-xbzrle /xbzrle/encode_decode_zero
PASS 3 test-xbzrle /xbzrle/encode_decode_unchanged
---
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-rcu-list -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-rcu-list" 
PASS 1 test-rcu-list /rcu/qlist/single-threaded
PASS 2 test-rcu-list /rcu/qlist/short-few
==7197==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 3 test-rcu-list /rcu/qlist/long-many
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-rcu-simpleq -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-rcu-simpleq" 
PASS 1 test-rcu-simpleq /rcu/qsimpleq/single-threaded
PASS 2 test-rcu-simpleq /rcu/qsimpleq/short-few
==7257==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 3 test-rcu-simpleq /rcu/qsimpleq/long-many
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-rcu-tailq -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-rcu-tailq" 
PASS 1 test-rcu-tailq /rcu/qtailq/single-threaded
---
PASS 3 test-rcu-tailq /rcu/qtailq/long-many
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-rcu-slist -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-rcu-slist" 
PASS 1 test-rcu-slist /rcu/qslist/single-threaded
==7302==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 2 test-rcu-slist /rcu/qslist/short-few
PASS 3 test-rcu-slist /rcu/qslist/long-many
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-qdist -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-qdist" 
---
PASS 7 test-qdist /qdist/binning/expand
PASS 8 test-qdist /qdist/binning/shrink
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-qht -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-qht" 
==7342==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7348==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 5 ide-test /x86_64/ide/bmdma/various_prdts
==7354==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7354==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffe50f90000; bottom 0x7f55617dc000; size: 0x00a8ef7b4000 (725572337664)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 6 ide-test /x86_64/ide/bmdma/no_busmaster
---
PASS 2 test-qht /qht/mode/resize
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-qht-par -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-qht-par" 
PASS 7 ide-test /x86_64/ide/flush/nodev
==7371==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 8 ide-test /x86_64/ide/flush/empty_drive
PASS 1 test-qht-par /qht/parallel/2threads-0%updates-1s
==7379==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 9 ide-test /x86_64/ide/flush/retry_pci
==7391==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 2 test-qht-par /qht/parallel/2threads-20%updates-1s
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-bitops -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-bitops" 
PASS 10 ide-test /x86_64/ide/flush/retry_isa
---
PASS 3 test-bitcnt /bitcnt/ctpop32
PASS 4 test-bitcnt /bitcnt/ctpop64
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-qdev-global-props -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-qdev-global-props" 
==7400==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-qdev-global-props /qdev/properties/static/default
PASS 2 test-qdev-global-props /qdev/properties/static/global
PASS 3 test-qdev-global-props /qdev/properties/dynamic/global
---
PASS 9 test-keyval /keyval/visit/alternate
PASS 10 test-keyval /keyval/visit/any
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-write-threshold -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-write-threshold" 
==7427==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-write-threshold /write-threshold/not-set-on-init
PASS 2 test-write-threshold /write-threshold/set-get
PASS 3 test-write-threshold /write-threshold/multi-set-get
---
PASS 15 test-crypto-secret /crypto/secret/crypt/missingiv
PASS 16 test-crypto-secret /crypto/secret/crypt/badiv
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-crypto-tlscredsx509 -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-crypto-tlscredsx509" 
==7465==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 13 ide-test /x86_64/ide/cdrom/dma
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 QTEST_QEMU_IMG=qemu-img tests/qtest/ahci-test -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="ahci-test" 
PASS 1 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/perfectserver
PASS 2 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/perfectclient
==7483==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 ahci-test /x86_64/ahci/sanity
PASS 3 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/goodca1
PASS 4 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/goodca2
==7489==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 2 ahci-test /x86_64/ahci/pci_spec
PASS 5 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/goodca3
PASS 6 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/badca1
PASS 7 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/badca2
PASS 8 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/badca3
PASS 9 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/goodserver1
==7495==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 10 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/goodserver2
PASS 3 ahci-test /x86_64/ahci/pci_enable
==7501==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 11 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/goodserver3
PASS 4 ahci-test /x86_64/ahci/hba_spec
PASS 12 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/goodserver4
PASS 13 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/goodserver5
==7507==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 14 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/goodserver6
PASS 15 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/goodserver7
PASS 5 ahci-test /x86_64/ahci/hba_enable
---
PASS 32 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/inactive1
PASS 33 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/inactive2
PASS 34 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/inactive3
==7513==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 6 ahci-test /x86_64/ahci/identify
==7519==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 35 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/chain1
PASS 36 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/chain2
PASS 37 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/missingca
---
PASS 39 test-crypto-tlscredsx509 /qcrypto/tlscredsx509/missingclient
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-crypto-tlssession -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-crypto-tlssession" 
PASS 7 ahci-test /x86_64/ahci/max
==7529==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-crypto-tlssession /qcrypto/tlssession/psk
PASS 8 ahci-test /x86_64/ahci/reset
PASS 2 test-crypto-tlssession /qcrypto/tlssession/basicca
==7535==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7535==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffe4e9e7000; bottom 0x7f836fffe000; size: 0x007ade9e9000 (527720943616)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 9 ahci-test /x86_64/ahci/io/pio/lba28/simple/zero
==7541==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7541==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffd1a70f000; bottom 0x7f87295fe000; size: 0x0075f1111000 (506555600896)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 10 ahci-test /x86_64/ahci/io/pio/lba28/simple/low
PASS 3 test-crypto-tlssession /qcrypto/tlssession/differentca
PASS 4 test-crypto-tlssession /qcrypto/tlssession/altname1
==7547==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7547==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffd94770000; bottom 0x7f50a37fe000; size: 0x00acf0f72000 (742777102336)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 11 ahci-test /x86_64/ahci/io/pio/lba28/simple/high
PASS 5 test-crypto-tlssession /qcrypto/tlssession/altname2
PASS 6 test-crypto-tlssession /qcrypto/tlssession/altname3
==7553==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 7 test-crypto-tlssession /qcrypto/tlssession/altname4
==7553==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffd1047a000; bottom 0x7fd454ffe000; size: 0x0028bb47c000 (174940733440)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 12 ahci-test /x86_64/ahci/io/pio/lba28/double/zero
PASS 8 test-crypto-tlssession /qcrypto/tlssession/altname5
==7559==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7559==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffc16d53000; bottom 0x7ff0b03fe000; size: 0x000b66955000 (48965701632)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 13 ahci-test /x86_64/ahci/io/pio/lba28/double/low
PASS 9 test-crypto-tlssession /qcrypto/tlssession/altname6
==7565==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7565==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7fff499df000; bottom 0x7f2dcb5fe000; size: 0x00d17e3e1000 (899766161408)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 10 test-crypto-tlssession /qcrypto/tlssession/wildcard1
PASS 14 ahci-test /x86_64/ahci/io/pio/lba28/double/high
==7571==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7571==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7fffb35bd000; bottom 0x7ff2dedfe000; size: 0x000cd47bf000 (55104499712)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 11 test-crypto-tlssession /qcrypto/tlssession/wildcard2
PASS 15 ahci-test /x86_64/ahci/io/pio/lba28/long/zero
PASS 12 test-crypto-tlssession /qcrypto/tlssession/wildcard3
==7577==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7577==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffd4811b000; bottom 0x7f5b90d7c000; size: 0x00a1b739f000 (694563762176)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 16 ahci-test /x86_64/ahci/io/pio/lba28/long/low
PASS 13 test-crypto-tlssession /qcrypto/tlssession/wildcard4
==7583==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7583==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7fff16edf000; bottom 0x7f6e5fffe000; size: 0x0090b6ee1000 (621544345600)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 17 ahci-test /x86_64/ahci/io/pio/lba28/long/high
PASS 14 test-crypto-tlssession /qcrypto/tlssession/wildcard5
PASS 15 test-crypto-tlssession /qcrypto/tlssession/wildcard6
==7589==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 16 test-crypto-tlssession /qcrypto/tlssession/cachain
PASS 18 ahci-test /x86_64/ahci/io/pio/lba28/short/zero
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-qga -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-qga" 
==7595==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 19 ahci-test /x86_64/ahci/io/pio/lba28/short/low
PASS 1 test-qga /qga/sync-delimited
PASS 2 test-qga /qga/sync
---
PASS 15 test-qga /qga/invalid-cmd
PASS 16 test-qga /qga/invalid-args
PASS 17 test-qga /qga/fsfreeze-status
==7609==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 20 ahci-test /x86_64/ahci/io/pio/lba28/short/high
PASS 18 test-qga /qga/blacklist
==7618==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 19 test-qga /qga/config
PASS 20 test-qga /qga/guest-exec
PASS 21 test-qga /qga/guest-exec-invalid
==7618==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffc96103000; bottom 0x7f384a7fe000; size: 0x00c44b905000 (843081338880)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 21 ahci-test /x86_64/ahci/io/pio/lba48/simple/zero
==7636==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7636==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffe91c64000; bottom 0x7f858f3fe000; size: 0x007902866000 (519733403648)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 22 test-qga /qga/guest-get-osinfo
---
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-util-filemonitor -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-util-filemonitor" 
PASS 1 test-util-filemonitor /util/filemonitor
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-util-sockets -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-util-sockets" 
==7647==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-util-sockets /util/socket/is-socket/bad
PASS 2 test-util-sockets /util/socket/is-socket/good
PASS 3 test-util-sockets /socket/fd-pass/name/good
---
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-authz-simple -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-authz-simple" 
PASS 1 test-authz-simple /authz/simple
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-authz-list -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-authz-list" 
==7647==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffc5a9b2000; bottom 0x7fab941fe000; size: 0x0050c67b4000 (346927349760)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 1 test-authz-list /auth/list/complex
---
PASS 8 test-io-channel-socket /io/channel/socket/unix-fd-pass
PASS 9 test-io-channel-socket /io/channel/socket/unix-listen-cleanup
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-io-channel-file -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-io-channel-file" 
==7674==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-io-channel-file /io/channel/file
PASS 2 test-io-channel-file /io/channel/file/rdwr
PASS 3 test-io-channel-file /io/channel/file/fd
PASS 4 test-io-channel-file /io/channel/pipe/sync
PASS 5 test-io-channel-file /io/channel/pipe/async
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-io-channel-tls -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-io-channel-tls" 
==7674==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffe4885a000; bottom 0x7f97927fe000; size: 0x0066b605c000 (441140494336)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 24 ahci-test /x86_64/ahci/io/pio/lba48/double/zero
PASS 1 test-io-channel-tls /qio/channel/tls/basic
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-io-channel-command -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-io-channel-command" 
==7738==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-io-channel-command /io/channel/command/fifo/sync
PASS 2 test-io-channel-command /io/channel/command/fifo/async
PASS 3 test-io-channel-command /io/channel/command/echo/sync
PASS 4 test-io-channel-command /io/channel/command/echo/async
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-io-channel-buffer -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-io-channel-buffer" 
==7738==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffd817f0000; bottom 0x7fdf0d5fe000; size: 0x001e741f2000 (130797215744)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 1 test-io-channel-buffer /io/channel/buf
---
PASS 8 test-crypto-ivgen /crypto/ivgen/essiv/1f2e3d4c
PASS 9 test-crypto-ivgen /crypto/ivgen/essiv/1f2e3d4c5b6a7988
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-crypto-afsplit -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-crypto-afsplit" 
==7759==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-crypto-afsplit /crypto/afsplit/sha256/5
PASS 2 test-crypto-afsplit /crypto/afsplit/sha256/5000
PASS 3 test-crypto-afsplit /crypto/afsplit/sha256/big
---
PASS 16 test-crypto-xts /crypto/xts/t-15-key-32-ptx-25/unaligned
PASS 17 test-crypto-xts /crypto/xts/t-21-key-32-ptx-31/basic
PASS 18 test-crypto-xts /crypto/xts/t-21-key-32-ptx-31/unaligned
==7759==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7fff17af4000; bottom 0x7f479affe000; size: 0x00b77caf6000 (788070883328)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-crypto-block -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-crypto-block" 
---
PASS 3 test-logging /logging/logfile_write_path
PASS 4 test-logging /logging/logfile_lock_path
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-replication -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-replication" 
==7792==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7789==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-replication /replication/primary/read
==7789==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffe94999000; bottom 0x7f2994d7c000; size: 0x00d4ffc1d000 (914823958528)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 2 test-replication /replication/primary/write
---
PASS 4 test-replication /replication/primary/stop
PASS 5 test-replication /replication/primary/do_checkpoint
PASS 6 test-replication /replication/primary/get_error_all
==7800==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7800==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffc30ee1000; bottom 0x7f177f724000; size: 0x00e4b17bd000 (982230224896)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 7 test-replication /replication/secondary/read
PASS 28 ahci-test /x86_64/ahci/io/pio/lba48/long/low
PASS 8 test-replication /replication/secondary/write
==7806==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7806==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffd0c81c000; bottom 0x7efc0cffe000; size: 0x0100ff81e000 (1103798329344)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
==7792==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffe24bc7000; bottom 0x7f3d99c0c000; size: 0x00c08afbb000 (826965471232)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 29 ahci-test /x86_64/ahci/io/pio/lba48/long/high
==7843==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 30 ahci-test /x86_64/ahci/io/pio/lba48/short/zero
==7849==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 9 test-replication /replication/secondary/start
PASS 31 ahci-test /x86_64/ahci/io/pio/lba48/short/low
==7855==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 32 ahci-test /x86_64/ahci/io/pio/lba48/short/high
==7861==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 33 ahci-test /x86_64/ahci/io/dma/lba28/fragmented
==7867==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 10 test-replication /replication/secondary/stop
PASS 34 ahci-test /x86_64/ahci/io/dma/lba28/retry
==7873==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 35 ahci-test /x86_64/ahci/io/dma/lba28/simple/zero
==7879==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 36 ahci-test /x86_64/ahci/io/dma/lba28/simple/low
==7885==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 37 ahci-test /x86_64/ahci/io/dma/lba28/simple/high
PASS 11 test-replication /replication/secondary/continuous_replication
==7891==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 38 ahci-test /x86_64/ahci/io/dma/lba28/double/zero
==7897==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 39 ahci-test /x86_64/ahci/io/dma/lba28/double/low
==7903==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 12 test-replication /replication/secondary/do_checkpoint
PASS 40 ahci-test /x86_64/ahci/io/dma/lba28/double/high
PASS 13 test-replication /replication/secondary/get_error_all
==7909==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-bufferiszero -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-bufferiszero" 
==7909==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffd6ea23000; bottom 0x7f339b9fd000; size: 0x00c9d3026000 (866828574720)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 41 ahci-test /x86_64/ahci/io/dma/lba28/long/zero
==7919==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7919==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffda4381000; bottom 0x7fb7ec77b000; size: 0x0045b7c06000 (299435581440)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 42 ahci-test /x86_64/ahci/io/dma/lba28/long/low
==7926==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7926==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7fff9bf00000; bottom 0x7fc1e0f23000; size: 0x003dbafdd000 (265130201088)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 43 ahci-test /x86_64/ahci/io/dma/lba28/long/high
==7933==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 44 ahci-test /x86_64/ahci/io/dma/lba28/short/zero
==7939==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 45 ahci-test /x86_64/ahci/io/dma/lba28/short/low
==7945==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 46 ahci-test /x86_64/ahci/io/dma/lba28/short/high
==7951==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 47 ahci-test /x86_64/ahci/io/dma/lba48/simple/zero
==7957==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 48 ahci-test /x86_64/ahci/io/dma/lba48/simple/low
==7963==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 49 ahci-test /x86_64/ahci/io/dma/lba48/simple/high
==7969==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 50 ahci-test /x86_64/ahci/io/dma/lba48/double/zero
==7975==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 51 ahci-test /x86_64/ahci/io/dma/lba48/double/low
==7981==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 52 ahci-test /x86_64/ahci/io/dma/lba48/double/high
==7987==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7987==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffc36f64000; bottom 0x7f04f977b000; size: 0x00f73d7e9000 (1061888626688)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 53 ahci-test /x86_64/ahci/io/dma/lba48/long/zero
==7994==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==7994==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7fff75180000; bottom 0x7fa39e5fd000; size: 0x005bd6b83000 (394444419072)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 54 ahci-test /x86_64/ahci/io/dma/lba48/long/low
==8001==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8001==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7fffa583e000; bottom 0x7fb1a637b000; size: 0x004dff4c3000 (334995664896)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 55 ahci-test /x86_64/ahci/io/dma/lba48/long/high
==8008==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 56 ahci-test /x86_64/ahci/io/dma/lba48/short/zero
==8014==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 57 ahci-test /x86_64/ahci/io/dma/lba48/short/low
==8020==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 58 ahci-test /x86_64/ahci/io/dma/lba48/short/high
==8026==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 59 ahci-test /x86_64/ahci/io/ncq/simple
==8032==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 60 ahci-test /x86_64/ahci/io/ncq/retry
==8038==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 61 ahci-test /x86_64/ahci/flush/simple
==8044==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 62 ahci-test /x86_64/ahci/flush/retry
==8050==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8056==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 63 ahci-test /x86_64/ahci/flush/migrate
==8064==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8070==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 64 ahci-test /x86_64/ahci/migrate/sanity
==8078==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8084==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 65 ahci-test /x86_64/ahci/migrate/dma/simple
==8092==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8098==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-bufferiszero /cutils/bufferiszero
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-uuid -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-uuid" 
PASS 66 ahci-test /x86_64/ahci/migrate/dma/halted
---
PASS 1 test-qapi-util /qapi/util/qapi_enum_parse
PASS 2 test-qapi-util /qapi/util/parse_qapi_name
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  tests/test-qgraph -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-qgraph" 
==8109==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 test-qgraph /qgraph/init_nop
PASS 2 test-qgraph /qgraph/test_machine
PASS 3 test-qgraph /qgraph/test_contains
---
PASS 21 test-qgraph /qgraph/test_two_test_same_interface
PASS 22 test-qgraph /qgraph/test_test_in_path
PASS 23 test-qgraph /qgraph/test_double_edge
==8125==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 67 ahci-test /x86_64/ahci/migrate/ncq/simple
==8133==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8139==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 68 ahci-test /x86_64/ahci/migrate/ncq/halted
==8147==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 69 ahci-test /x86_64/ahci/cdrom/eject
==8152==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 70 ahci-test /x86_64/ahci/cdrom/dma/single
==8158==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 71 ahci-test /x86_64/ahci/cdrom/dma/multi
==8164==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 72 ahci-test /x86_64/ahci/cdrom/pio/single
==8170==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8170==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top: 0x7ffea416f000; bottom 0x7ff8503aa000; size: 0x000653dc5000 (27176751104)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
PASS 73 ahci-test /x86_64/ahci/cdrom/pio/multi
==8176==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 74 ahci-test /x86_64/ahci/cdrom/pio/bcl
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 QTEST_QEMU_IMG=qemu-img tests/qtest/hd-geo-test -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="hd-geo-test" 
PASS 1 hd-geo-test /x86_64/hd-geo/ide/none
==8190==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 2 hd-geo-test /x86_64/hd-geo/ide/drive/cd_0
==8196==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 3 hd-geo-test /x86_64/hd-geo/ide/drive/mbr/blank
==8202==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 4 hd-geo-test /x86_64/hd-geo/ide/drive/mbr/lba
==8208==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 5 hd-geo-test /x86_64/hd-geo/ide/drive/mbr/chs
==8214==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 6 hd-geo-test /x86_64/hd-geo/ide/device/mbr/blank
==8220==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 7 hd-geo-test /x86_64/hd-geo/ide/device/mbr/lba
==8226==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 8 hd-geo-test /x86_64/hd-geo/ide/device/mbr/chs
==8232==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 9 hd-geo-test /x86_64/hd-geo/ide/device/user/chs
==8237==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 10 hd-geo-test /x86_64/hd-geo/ide/device/user/chst
==8243==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8247==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8251==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8255==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8259==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8263==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8267==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8271==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8274==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 11 hd-geo-test /x86_64/hd-geo/override/ide
==8281==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8285==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8289==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8293==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8297==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8301==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8305==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8309==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8312==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 12 hd-geo-test /x86_64/hd-geo/override/scsi
==8319==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8323==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8327==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8331==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8335==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8339==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8343==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8347==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8350==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 13 hd-geo-test /x86_64/hd-geo/override/scsi_2_controllers
==8357==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8361==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8365==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8369==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8372==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 14 hd-geo-test /x86_64/hd-geo/override/virtio_blk
==8379==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8383==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8386==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 15 hd-geo-test /x86_64/hd-geo/override/zero_chs
==8393==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8397==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8401==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8405==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8408==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 16 hd-geo-test /x86_64/hd-geo/override/scsi_hot_unplug
==8415==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8419==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8423==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8427==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
==8430==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 17 hd-geo-test /x86_64/hd-geo/override/virtio_hot_unplug
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 QTEST_QEMU_IMG=qemu-img tests/qtest/boot-order-test -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="boot-order-test" 
PASS 1 boot-order-test /x86_64/boot-order/pc
---
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
qemu-system-x86_64: falling back to tcg
==8499==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!

Looking for expected file 'tests/data/acpi/pc/FACP'
Using expected file 'tests/data/acpi/pc/FACP'
---
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
qemu-system-x86_64: falling back to tcg
==8505==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!

Looking for expected file 'tests/data/acpi/q35/FACP'
Using expected file 'tests/data/acpi/q35/FACP'
---
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
qemu-system-x86_64: falling back to tcg
==8511==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!

Looking for expected file 'tests/data/acpi/pc/FACP.bridge'
Looking for expected file 'tests/data/acpi/pc/FACP'
---
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
qemu-system-x86_64: falling back to tcg
==8517==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!

Looking for expected file 'tests/data/acpi/pc/FACP.ipmikcs'
Looking for expected file 'tests/data/acpi/pc/FACP'
---
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
qemu-system-x86_64: falling back to tcg
==8523==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!

Looking for expected file 'tests/data/acpi/pc/FACP.cphp'
Looking for expected file 'tests/data/acpi/pc/FACP'
---
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
qemu-system-x86_64: falling back to tcg
==8530==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!

Looking for expected file 'tests/data/acpi/pc/FACP.memhp'
Looking for expected file 'tests/data/acpi/pc/FACP'
---
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
qemu-system-x86_64: falling back to tcg
==8536==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!

Looking for expected file 'tests/data/acpi/pc/FACP.numamem'
Looking for expected file 'tests/data/acpi/pc/FACP'
---
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
qemu-system-x86_64: falling back to tcg
==8542==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!

Looking for expected file 'tests/data/acpi/pc/FACP.dimmpxm'
Looking for expected file 'tests/data/acpi/pc/FACP'
---
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
qemu-system-x86_64: falling back to tcg
==8551==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!

Looking for expected file 'tests/data/acpi/pc/FACP.acpihmat'
Looking for expected file 'tests/data/acpi/pc/FACP'
---
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
qemu-system-x86_64: falling back to tcg
==8558==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!

Looking for expected file 'tests/data/acpi/q35/FACP.bridge'
Looking for expected file 'tests/data/acpi/q35/FACP'
---
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
qemu-system-x86_64: falling back to tcg
==8564==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!

Looking for expected file 'tests/data/acpi/q35/FACP.mmio64'
Looking for expected file 'tests/data/acpi/q35/FACP'
---
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
qemu-system-x86_64: falling back to tcg
==8570==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!

Looking for expected file 'tests/data/acpi/q35/FACP.ipmibt'
Looking for expected file 'tests/data/acpi/q35/FACP'
---
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
qemu-system-x86_64: falling back to tcg
==8576==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!

Looking for expected file 'tests/data/acpi/q35/FACP.cphp'
Looking for expected file 'tests/data/acpi/q35/FACP'
---
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
qemu-system-x86_64: falling back to tcg
==8583==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!

Looking for expected file 'tests/data/acpi/q35/FACP.memhp'
Looking for expected file 'tests/data/acpi/q35/FACP'
---
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
qemu-system-x86_64: falling back to tcg
==8589==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!

Looking for expected file 'tests/data/acpi/q35/FACP.numamem'
Looking for expected file 'tests/data/acpi/q35/FACP'
---
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
qemu-system-x86_64: falling back to tcg
==8595==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!

Looking for expected file 'tests/data/acpi/q35/FACP.dimmpxm'
Looking for expected file 'tests/data/acpi/q35/FACP'
---
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
qemu-system-x86_64: falling back to tcg
==8604==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!

Looking for expected file 'tests/data/acpi/q35/FACP.acpihmat'
Looking for expected file 'tests/data/acpi/q35/FACP'
---
PASS 1 i440fx-test /x86_64/i440fx/defaults
PASS 2 i440fx-test /x86_64/i440fx/pam
PASS 3 i440fx-test /x86_64/i440fx/firmware/bios
==8696==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 4 i440fx-test /x86_64/i440fx/firmware/pflash
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 QTEST_QEMU_IMG=qemu-img tests/qtest/fw_cfg-test -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="fw_cfg-test" 
PASS 1 fw_cfg-test /x86_64/fw_cfg/signature
---
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 QTEST_QEMU_IMG=qemu-img tests/qtest/drive_del-test -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="drive_del-test" 
PASS 1 drive_del-test /x86_64/drive_del/without-dev
PASS 2 drive_del-test /x86_64/drive_del/after_failed_device_add
==8789==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 3 drive_del-test /x86_64/blockdev/drive_del_device_del
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 QTEST_QEMU_IMG=qemu-img tests/qtest/wdt_ib700-test -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="wdt_ib700-test" 
PASS 1 wdt_ib700-test /x86_64/wdt_ib700/pause
---
PASS 1 usb-hcd-uhci-test /x86_64/uhci/pci/init
PASS 2 usb-hcd-uhci-test /x86_64/uhci/pci/port1
PASS 3 usb-hcd-uhci-test /x86_64/uhci/pci/hotplug
==8984==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 4 usb-hcd-uhci-test /x86_64/uhci/pci/hotplug/usb-storage
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 QTEST_QEMU_IMG=qemu-img tests/qtest/usb-hcd-ehci-test -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="usb-hcd-ehci-test" 
PASS 1 usb-hcd-ehci-test /x86_64/ehci/pci/uhci-port-1
---
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 QTEST_QEMU_IMG=qemu-img tests/qtest/usb-hcd-xhci-test -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="usb-hcd-xhci-test" 
PASS 1 usb-hcd-xhci-test /x86_64/xhci/pci/init
PASS 2 usb-hcd-xhci-test /x86_64/xhci/pci/hotplug
==9002==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 3 usb-hcd-xhci-test /x86_64/xhci/pci/hotplug/usb-uas
PASS 4 usb-hcd-xhci-test /x86_64/xhci/pci/hotplug/usb-ccid
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 QTEST_QEMU_IMG=qemu-img tests/qtest/cpu-plug-test -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="cpu-plug-test" 
---
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
qemu-system-x86_64: falling back to tcg
==9138==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 1 vmgenid-test /x86_64/vmgenid/vmgenid/set-guid
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
qemu-system-x86_64: falling back to tcg
==9144==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 2 vmgenid-test /x86_64/vmgenid/vmgenid/set-guid-auto
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
qemu-system-x86_64: falling back to tcg
==9150==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 3 vmgenid-test /x86_64/vmgenid/vmgenid/query-monitor
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 QTEST_QEMU_IMG=qemu-img tests/qtest/tpm-crb-swtpm-test -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="tpm-crb-swtpm-test" 
SKIP 1 tpm-crb-swtpm-test /x86_64/tpm/crb-swtpm/test # SKIP swtpm not in PATH or missing --tpm2 support
---
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
qemu-system-x86_64: falling back to tcg
==9249==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
qemu-system-x86_64: falling back to tcg
==9255==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 3 migration-test /x86_64/migration/fd_proto
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
qemu-system-x86_64: falling back to tcg
==9262==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
qemu-system-x86_64: falling back to tcg
==9268==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 4 migration-test /x86_64/migration/validate_uuid
PASS 5 migration-test /x86_64/migration/validate_uuid_error
PASS 6 migration-test /x86_64/migration/validate_uuid_src_not_set
---
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
qemu-system-x86_64: falling back to tcg
==9318==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
qemu-system-x86_64: falling back to tcg
==9324==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 8 migration-test /x86_64/migration/auto_converge
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
qemu-system-x86_64: falling back to tcg
==9332==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
qemu-system-x86_64: falling back to tcg
==9338==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 9 migration-test /x86_64/migration/postcopy/unix
PASS 10 migration-test /x86_64/migration/postcopy/recovery
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
qemu-system-x86_64: falling back to tcg
==9367==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
qemu-system-x86_64: falling back to tcg
==9373==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 11 migration-test /x86_64/migration/precopy/unix
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
qemu-system-x86_64: falling back to tcg
==9381==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
qemu-system-x86_64: falling back to tcg
==9387==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 12 migration-test /x86_64/migration/precopy/tcp
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
qemu-system-x86_64: falling back to tcg
==9395==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
qemu-system-x86_64: falling back to tcg
==9401==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 13 migration-test /x86_64/migration/xbzrle/unix
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
qemu-system-x86_64: falling back to tcg
==9409==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
qemu-system-x86_64: falling back to tcg
==9415==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 14 migration-test /x86_64/migration/multifd/tcp/none
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
qemu-system-x86_64: falling back to tcg
==9533==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 15 migration-test /x86_64/migration/multifd/tcp/cancel
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
qemu-system-x86_64: falling back to tcg
==9589==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
qemu-system-x86_64: falling back to tcg
==9595==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 16 migration-test /x86_64/migration/multifd/tcp/zlib
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
qemu-system-x86_64: falling back to tcg
==9651==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
qemu-system-x86_64: falling back to tcg
==9657==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 17 migration-test /x86_64/migration/multifd/tcp/zstd
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 QTEST_QEMU_IMG=qemu-img tests/qtest/test-x86-cpuid-compat -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="test-x86-cpuid-compat" 
PASS 1 test-x86-cpuid-compat /x86/cpuid/parsing-plus-minus
---
PASS 1 machine-none-test /x86_64/machine/none/cpu_option
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(( ${RANDOM:-0} % 255 + 1))}  QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 QTEST_QEMU_IMG=qemu-img tests/qtest/qmp-test -m=quick -k --tap < /dev/null | ./scripts/tap-driver.pl --test-name="qmp-test" 
PASS 1 qmp-test /x86_64/qmp/protocol
==10096==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
PASS 2 qmp-test /x86_64/qmp/oob
PASS 3 qmp-test /x86_64/qmp/preconfig
PASS 4 qmp-test /x86_64/qmp/missing-any-arg
---
qemu-system-x86_64: /tmp/qemu-test/src/hw/i386/x86.c:175: CpuInstanceProperties x86_cpu_index_to_props(MachineState *, unsigned int): Assertion `cpu_index < possible_cpus->len' failed.
Broken pipe
/tmp/qemu-test/src/tests/qtest/libqtest.c:175: kill_qemu() detected QEMU death from signal 6 (Aborted)
ERROR - too few tests run (expected 8, got 5)
make: *** [/tmp/qemu-test/src/tests/Makefile.include:637: check-qtest-x86_64] Error 1
Traceback (most recent call last):
  File "./tests/docker/docker.py", line 664, in <module>
    sys.exit(main())
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=012604bd862049fea9854ef7e3d56184', '-u', '1003', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=x86_64-softmmu', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-eeu95aym/src/docker-src.2020-05-13-20.56.43.28170:/var/tmp/qemu:z,ro', 'qemu:fedora', '/var/tmp/qemu/run', 'test-debug']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=012604bd862049fea9854ef7e3d56184
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-eeu95aym/src'
make: *** [docker-run-test-debug@fedora] Error 2

real    39m30.419s
user    0m9.110s


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

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

* Re: [PATCH  v1 0/8] plugins/next (cleanup, cpu_index and lockstep)
  2020-05-13 17:31 [PATCH v1 0/8] plugins/next (cleanup, cpu_index and lockstep) Alex Bennée
                   ` (10 preceding siblings ...)
  2020-05-14  1:36 ` no-reply
@ 2020-05-14  1:36 ` no-reply
  11 siblings, 0 replies; 21+ messages in thread
From: no-reply @ 2020-05-14  1:36 UTC (permalink / raw)
  To: alex.bennee; +Cc: alex.bennee, qemu-devel

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



Hi,

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

Message-id: 20200513173200.11830-1-alex.bennee@linaro.org
Subject: [PATCH  v1 0/8] plugins/next (cleanup, cpu_index and lockstep)
Type: series

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

Switched to a new branch 'test'
6edd795 plugins: new lockstep plugin for debugging TCG changes
4202a73 tests/tcg: add new threadcount test
1f6f667 linux-user: properly "unrealize" vCPU object
6200dd7 cpus-common: ensure auto-assigned cpu_indexes don't clash
888408f MAINTAINERS: update the orphaned cpus-common.c file
6c78116 qemu/qemu-plugin: Make qemu_plugin_hwaddr_is_io() hwaddr argument const
ce430e0 qemu/plugin: Move !CONFIG_PLUGIN stubs altogether
e69a9cc qemu/plugin: Trivial code movement

=== OUTPUT BEGIN ===
1/8 Checking commit e69a9cc66e44 (qemu/plugin: Trivial code movement)
2/8 Checking commit ce430e01e1b3 (qemu/plugin: Move !CONFIG_PLUGIN stubs altogether)
3/8 Checking commit 6c781160c4cd (qemu/qemu-plugin: Make qemu_plugin_hwaddr_is_io() hwaddr argument const)
4/8 Checking commit 888408f0e702 (MAINTAINERS: update the orphaned cpus-common.c file)
5/8 Checking commit 6200dd769e32 (cpus-common: ensure auto-assigned cpu_indexes don't clash)
6/8 Checking commit 1f6f66791a8f (linux-user: properly "unrealize" vCPU object)
7/8 Checking commit 4202a73ecb0e (tests/tcg: add new threadcount test)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#30: 
new file mode 100644

ERROR: open brace '{' following function declarations go on the next line
#62: FILE: tests/tcg/multiarch/threadcount.c:28:
+static void *thread_fn(void* varg)  {

ERROR: "foo* bar" should be "foo *bar"
#63: FILE: tests/tcg/multiarch/threadcount.c:29:
+    ThreadArg* arg = varg;

ERROR: open brace '{' following function declarations go on the next line
#69: FILE: tests/tcg/multiarch/threadcount.c:35:
+int main(int argc, char **argv) {

ERROR: "foo* bar" should be "foo *bar"
#79: FILE: tests/tcg/multiarch/threadcount.c:45:
+        ThreadArg* arg = calloc(sizeof(ThreadArg), 1);

total: 4 errors, 1 warnings, 70 lines checked

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

8/8 Checking commit 6edd795dd0a4 (plugins: new lockstep plugin for debugging TCG changes)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#56: 
new file mode 100644

ERROR: "foo * bar" should be "foo *bar"
#163: FILE: tests/plugin/lockstep.c:103:
+static inline const char * ord_ind(int n) {

ERROR: open brace '{' following function declarations go on the next line
#163: FILE: tests/plugin/lockstep.c:103:
+static inline const char * ord_ind(int n) {

WARNING: line over 80 characters
#220: FILE: tests/plugin/lockstep.c:160:
+            g_string_append_printf(out, "  previously @ %#016lx/%ld (%ld insns)\n",

ERROR: do not use C99 // comments
#292: FILE: tests/plugin/lockstep.c:232:
+    // save a reference so we can free later

total: 3 errors, 2 warnings, 360 lines checked

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

=== OUTPUT END ===

Test command exited with code: 1


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

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

* Re: [PATCH  v1 5/8] cpus-common: ensure auto-assigned cpu_indexes don't clash
  2020-05-13 17:31 ` [PATCH v1 5/8] cpus-common: ensure auto-assigned cpu_indexes don't clash Alex Bennée
@ 2020-05-14 16:27   ` Alex Bennée
  2020-05-21 15:53     ` Igor Mammedov
  0 siblings, 1 reply; 21+ messages in thread
From: Alex Bennée @ 2020-05-14 16:27 UTC (permalink / raw)
  To: qemu-devel
  Cc: Eduardo Habkost, Nikolay Igotti, Igor Mammedov, Paolo Bonzini,
	Alex Bennée, Richard Henderson

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

> Basing the cpu_index on the number of currently allocated vCPUs fails
> when vCPUs aren't removed in a LIFO manner. This is especially true
> when we are allocating a cpu_index for each guest thread in
> linux-user where there is no ordering constraint on their allocation
> and de-allocation.
>
> [I've dropped the assert which is there to guard against out-of-order
> removal as this should probably be caught higher up the stack. Maybe
> we could just ifdef CONFIG_SOFTTMU it?]
>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> Cc: Nikolay Igotti <igotti@gmail.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Igor Mammedov <imammedo@redhat.com>
> Cc: Eduardo Habkost <ehabkost@redhat.com>
> ---
>  cpus-common.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/cpus-common.c b/cpus-common.c
> index 55d5df89237..5a7d2f6132b 100644
> --- a/cpus-common.c
> +++ b/cpus-common.c
> @@ -61,13 +61,14 @@ static bool cpu_index_auto_assigned;
>  static int cpu_get_free_index(void)
>  {
>      CPUState *some_cpu;
> -    int cpu_index = 0;
> +    int max_cpu_index = 0;
>  
>      cpu_index_auto_assigned = true;
>      CPU_FOREACH(some_cpu) {
> -        cpu_index++;
> +        max_cpu_index = MAX(some_cpu->cpu_index, max_cpu_index);
>      }
> -    return cpu_index;
> +    max_cpu_index++;
> +    return max_cpu_index;
>  }

OK some ending up with cpu_index = 1 threw off devices that would do
qemu_get_cpu(0) so I've tweaked the algorithm to:

  static int cpu_get_free_index(void)
  {
      CPUState *some_cpu;
      int max_cpu_index = 0;

      cpu_index_auto_assigned = true;
      CPU_FOREACH(some_cpu) {
          if (some_cpu->cpu_index >= max_cpu_index) {
              max_cpu_index = some_cpu->cpu_index + 1;
          }
      }
      return max_cpu_index;
  }

>  
>  void cpu_list_add(CPUState *cpu)
> @@ -90,8 +91,6 @@ void cpu_list_remove(CPUState *cpu)
>          return;
>      }
>  
> -    assert(!(cpu_index_auto_assigned && cpu != QTAILQ_LAST(&cpus)));
> -
>      QTAILQ_REMOVE_RCU(&cpus, cpu, node);
>      cpu->cpu_index = UNASSIGNED_CPU_INDEX;
>  }


-- 
Alex Bennée


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

* Re: [PATCH v1 7/8] tests/tcg: add new threadcount test
  2020-05-13 17:31 ` [PATCH v1 7/8] tests/tcg: add new threadcount test Alex Bennée
@ 2020-05-15 19:51   ` Nikolay Igotti
  2020-05-22  9:33   ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 21+ messages in thread
From: Nikolay Igotti @ 2020-05-15 19:51 UTC (permalink / raw)
  To: Alex Bennée; +Cc: qemu-devel


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

Sure, use it for anything.

ср, 13 мая 2020 г. в 20:32, Alex Bennée <alex.bennee@linaro.org>:

> Based on the original testcase by Nikolay Igotti.
>
> Message-ID: <CAEme+7GLKg_dNsHizzTKDymX9HyD+Ph2iZ=
> WKhOw2XG+zhViXg@mail.gmail.com>
> Cc: Nikolay Igotti <igotti@gmail.com>
> [Nikolay can we have your signed of by to add the testcase?]
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>  tests/tcg/multiarch/threadcount.c   | 62 +++++++++++++++++++++++++++++
>  tests/tcg/multiarch/Makefile.target |  2 +
>  2 files changed, 64 insertions(+)
>  create mode 100644 tests/tcg/multiarch/threadcount.c
>
> diff --git a/tests/tcg/multiarch/threadcount.c
> b/tests/tcg/multiarch/threadcount.c
> new file mode 100644
> index 00000000000..546dd90eeb2
> --- /dev/null
> +++ b/tests/tcg/multiarch/threadcount.c
> @@ -0,0 +1,62 @@
> +/*
> + * Thread Exerciser
> + *
> + * Unlike testthread which is mainly concerned about testing thread
> + * semantics this test is used to exercise the thread creation and
> + * accounting. A version of this test found a problem with clashing
> + * cpu_indexes which caused a break in plugin handling.
> + *
> + * Based on the original test case by Nikolay Igotti.
> + *
> + * Copyright (c) 2020 Linaro Ltd
> + *
> + * SPDX-License-Identifier: GPL-2.0-or-later
> + */
> +
> +#include <stdint.h>
> +#include <stdio.h>
> +#include <stdlib.h>
> +#include <unistd.h>
> +#include <pthread.h>
> +
> +int max_threads = 10;
> +
> +typedef struct {
> +    int delay;
> +} ThreadArg;
> +
> +static void *thread_fn(void* varg)  {
> +    ThreadArg* arg = varg;
> +    usleep(arg->delay);
> +    free(arg);
> +    return NULL;
> +}
> +
> +int main(int argc, char **argv) {
> +    int i;
> +    pthread_t *threads;
> +
> +    if (argc > 1) {
> +        max_threads = atoi(argv[1]);
> +    }
> +    threads = calloc(sizeof(pthread_t), max_threads);
> +
> +    for (i = 0; i < max_threads; i++) {
> +        ThreadArg* arg = calloc(sizeof(ThreadArg), 1);
> +        arg->delay = i * 100;
> +        pthread_create(threads + i, NULL, thread_fn, arg);
> +    }
> +
> +    printf("Created %d threads\n", max_threads);
> +
> +    /* sleep until roughly half the threads have "finished" */
> +    usleep(max_threads * 50);
> +
> +    for (i = 0; i < max_threads; i++) {
> +        pthread_join(threads[i], NULL);
> +    }
> +
> +    printf("Done\n");
> +
> +    return 0;
> +}
> diff --git a/tests/tcg/multiarch/Makefile.target
> b/tests/tcg/multiarch/Makefile.target
> index 51fb75ecfdd..cb49cc9ccb2 100644
> --- a/tests/tcg/multiarch/Makefile.target
> +++ b/tests/tcg/multiarch/Makefile.target
> @@ -28,6 +28,8 @@ run-float_%: float_%
>
>  testthread: LDFLAGS+=-lpthread
>
> +threadcount: LDFLAGS+=-lpthread
> +
>  # We define the runner for test-mmap after the individual
>  # architectures have defined their supported pages sizes. If no
>  # additional page sizes are defined we only run the default test.
> --
> 2.20.1
>
>

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

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

* Re: [PATCH  v1 5/8] cpus-common: ensure auto-assigned cpu_indexes don't clash
  2020-05-14 16:27   ` Alex Bennée
@ 2020-05-21 15:53     ` Igor Mammedov
  2020-05-21 17:10       ` Alex Bennée
  0 siblings, 1 reply; 21+ messages in thread
From: Igor Mammedov @ 2020-05-21 15:53 UTC (permalink / raw)
  To: Alex Bennée
  Cc: Paolo Bonzini, Richard Henderson, qemu-devel, Eduardo Habkost,
	Nikolay Igotti

On Thu, 14 May 2020 17:27:53 +0100
Alex Bennée <alex.bennee@linaro.org> wrote:

> a
> Alex Bennée <alex.bennee@linaro.org> writes:
> 
> > Basing the cpu_index on the number of currently allocated vCPUs fails
> > when vCPUs aren't removed in a LIFO manner. This is especially true
> > when we are allocating a cpu_index for each guest thread in
> > linux-user where there is no ordering constraint on their allocation
> > and de-allocation.
> >
> > [I've dropped the assert which is there to guard against out-of-order
> > removal as this should probably be caught higher up the stack. Maybe
> > we could just ifdef CONFIG_SOFTTMU it?]

for machines where we care about cross version migration (arm/virt,s390,x86,spapr),
we do manual cpu_index assignment on keep control on its stability
So orderining probably shouldn't matter for other softmmu boards,
but what I'd watch for is arrays within devices where cpu_index is used as index
(ex: would be apic emulation (but its not affected by this patch since x86 control
cpu_index assignment))


> >
> > Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> > Cc: Nikolay Igotti <igotti@gmail.com>
> > Cc: Paolo Bonzini <pbonzini@redhat.com>
> > Cc: Igor Mammedov <imammedo@redhat.com>
> > Cc: Eduardo Habkost <ehabkost@redhat.com>
> > ---
> >  cpus-common.c | 9 ++++-----
> >  1 file changed, 4 insertions(+), 5 deletions(-)
> >
> > diff --git a/cpus-common.c b/cpus-common.c
> > index 55d5df89237..5a7d2f6132b 100644
> > --- a/cpus-common.c
> > +++ b/cpus-common.c
> > @@ -61,13 +61,14 @@ static bool cpu_index_auto_assigned;
> >  static int cpu_get_free_index(void)
> >  {
> >      CPUState *some_cpu;
> > -    int cpu_index = 0;
> > +    int max_cpu_index = 0;
> >  
> >      cpu_index_auto_assigned = true;
> >      CPU_FOREACH(some_cpu) {
> > -        cpu_index++;
> > +        max_cpu_index = MAX(some_cpu->cpu_index, max_cpu_index);
> >      }
> > -    return cpu_index;
> > +    max_cpu_index++;
> > +    return max_cpu_index;
> >  }  
> 
> OK some ending up with cpu_index = 1 threw off devices that would do
> qemu_get_cpu(0) so I've tweaked the algorithm to:
> 
>   static int cpu_get_free_index(void)
>   {
>       CPUState *some_cpu;
>       int max_cpu_index = 0;
> 
>       cpu_index_auto_assigned = true;
>       CPU_FOREACH(some_cpu) {
>           if (some_cpu->cpu_index >= max_cpu_index) {
>               max_cpu_index = some_cpu->cpu_index + 1;
>           }
>       }
>       return max_cpu_index;
>   }
> 
> >  
> >  void cpu_list_add(CPUState *cpu)
> > @@ -90,8 +91,6 @@ void cpu_list_remove(CPUState *cpu)
> >          return;
> >      }
> >  
> > -    assert(!(cpu_index_auto_assigned && cpu != QTAILQ_LAST(&cpus)));
> > -
> >      QTAILQ_REMOVE_RCU(&cpus, cpu, node);
> >      cpu->cpu_index = UNASSIGNED_CPU_INDEX;
> >  }  
> 
> 



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

* Re: [PATCH  v1 5/8] cpus-common: ensure auto-assigned cpu_indexes don't clash
  2020-05-21 15:53     ` Igor Mammedov
@ 2020-05-21 17:10       ` Alex Bennée
  2020-05-22  8:46         ` Igor Mammedow
  0 siblings, 1 reply; 21+ messages in thread
From: Alex Bennée @ 2020-05-21 17:10 UTC (permalink / raw)
  To: Igor Mammedov
  Cc: Paolo Bonzini, Richard Henderson, qemu-devel, Eduardo Habkost,
	Nikolay Igotti


Igor Mammedov <imammedo@redhat.com> writes:

> On Thu, 14 May 2020 17:27:53 +0100
> Alex Bennée <alex.bennee@linaro.org> wrote:
>
>> a
>> Alex Bennée <alex.bennee@linaro.org> writes:
>> 
>> > Basing the cpu_index on the number of currently allocated vCPUs fails
>> > when vCPUs aren't removed in a LIFO manner. This is especially true
>> > when we are allocating a cpu_index for each guest thread in
>> > linux-user where there is no ordering constraint on their allocation
>> > and de-allocation.
>> >
>> > [I've dropped the assert which is there to guard against out-of-order
>> > removal as this should probably be caught higher up the stack. Maybe
>> > we could just ifdef CONFIG_SOFTTMU it?]
>
> for machines where we care about cross version migration (arm/virt,s390,x86,spapr),
> we do manual cpu_index assignment on keep control on its stability
> So orderining probably shouldn't matter for other softmmu boards,
> but what I'd watch for is arrays within devices where cpu_index is
> used as index

With the updated version for softmmu you should get the same indexes as
before from startup. It only gets complicated if CPU hotplug is a thing
which I think is only the case for machines that also support migration?

> (ex: would be apic emulation (but its not affected by this patch since x86 control
> cpu_index assignment))

I've just noticed that the gdbstub uses the maximum cpu_index at startup
to size it's array in CONFIG_USER which is obviously wrong but it was
wrong before so I guess that's another bug to look into on my part :-/

>
>
>> >
>> > Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>> > Cc: Nikolay Igotti <igotti@gmail.com>
>> > Cc: Paolo Bonzini <pbonzini@redhat.com>
>> > Cc: Igor Mammedov <imammedo@redhat.com>
>> > Cc: Eduardo Habkost <ehabkost@redhat.com>
>> > ---
>> >  cpus-common.c | 9 ++++-----
>> >  1 file changed, 4 insertions(+), 5 deletions(-)
>> >
>> > diff --git a/cpus-common.c b/cpus-common.c
>> > index 55d5df89237..5a7d2f6132b 100644
>> > --- a/cpus-common.c
>> > +++ b/cpus-common.c
>> > @@ -61,13 +61,14 @@ static bool cpu_index_auto_assigned;
>> >  static int cpu_get_free_index(void)
>> >  {
>> >      CPUState *some_cpu;
>> > -    int cpu_index = 0;
>> > +    int max_cpu_index = 0;
>> >  
>> >      cpu_index_auto_assigned = true;
>> >      CPU_FOREACH(some_cpu) {
>> > -        cpu_index++;
>> > +        max_cpu_index = MAX(some_cpu->cpu_index, max_cpu_index);
>> >      }
>> > -    return cpu_index;
>> > +    max_cpu_index++;
>> > +    return max_cpu_index;
>> >  }  
>> 
>> OK some ending up with cpu_index = 1 threw off devices that would do
>> qemu_get_cpu(0) so I've tweaked the algorithm to:
>> 
>>   static int cpu_get_free_index(void)
>>   {
>>       CPUState *some_cpu;
>>       int max_cpu_index = 0;
>> 
>>       cpu_index_auto_assigned = true;
>>       CPU_FOREACH(some_cpu) {
>>           if (some_cpu->cpu_index >= max_cpu_index) {
>>               max_cpu_index = some_cpu->cpu_index + 1;
>>           }
>>       }
>>       return max_cpu_index;
>>   }
>> 
>> >  
>> >  void cpu_list_add(CPUState *cpu)
>> > @@ -90,8 +91,6 @@ void cpu_list_remove(CPUState *cpu)
>> >          return;
>> >      }
>> >  
>> > -    assert(!(cpu_index_auto_assigned && cpu != QTAILQ_LAST(&cpus)));
>> > -
>> >      QTAILQ_REMOVE_RCU(&cpus, cpu, node);
>> >      cpu->cpu_index = UNASSIGNED_CPU_INDEX;
>> >  }  
>> 
>> 


-- 
Alex Bennée


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

* Re: [PATCH  v1 5/8] cpus-common: ensure auto-assigned cpu_indexes don't clash
  2020-05-21 17:10       ` Alex Bennée
@ 2020-05-22  8:46         ` Igor Mammedow
  0 siblings, 0 replies; 21+ messages in thread
From: Igor Mammedow @ 2020-05-22  8:46 UTC (permalink / raw)
  To: Alex Bennée
  Cc: Paolo Bonzini, Richard Henderson, qemu-devel, Eduardo Habkost,
	Nikolay Igotti

On Thu, 21 May 2020 18:10:40 +0100
Alex Bennée <alex.bennee@linaro.org> wrote:

> Igor Mammedov <imammedo@redhat.com> writes:
> 
> > On Thu, 14 May 2020 17:27:53 +0100
> > Alex Bennée <alex.bennee@linaro.org> wrote:
> >  
> >> a
> >> Alex Bennée <alex.bennee@linaro.org> writes:
> >>   
> >> > Basing the cpu_index on the number of currently allocated vCPUs
> >> > fails when vCPUs aren't removed in a LIFO manner. This is
> >> > especially true when we are allocating a cpu_index for each
> >> > guest thread in linux-user where there is no ordering constraint
> >> > on their allocation and de-allocation.
> >> >
> >> > [I've dropped the assert which is there to guard against
> >> > out-of-order removal as this should probably be caught higher up
> >> > the stack. Maybe we could just ifdef CONFIG_SOFTTMU it?]  
> >
> > for machines where we care about cross version migration
> > (arm/virt,s390,x86,spapr), we do manual cpu_index assignment on
> > keep control on its stability So orderining probably shouldn't
> > matter for other softmmu boards, but what I'd watch for is arrays
> > within devices where cpu_index is used as index  
> 
> With the updated version for softmmu you should get the same indexes
> as before from startup. It only gets complicated if CPU hotplug is a
> thing which I think is only the case for machines that also support
> migration?
I'd think so, and those do not (should not) use cpu_get_free_index(), so

Acked-by: Igor Mammedow <imammedo@redhat.com>

> 
> > (ex: would be apic emulation (but its not affected by this patch
> > since x86 control cpu_index assignment))  
> 
> I've just noticed that the gdbstub uses the maximum cpu_index at
> startup to size it's array in CONFIG_USER which is obviously wrong
> but it was wrong before so I guess that's another bug to look into on
> my part :-/
> 
> >
> >  
> >> >
> >> > Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> >> > Cc: Nikolay Igotti <igotti@gmail.com>
> >> > Cc: Paolo Bonzini <pbonzini@redhat.com>
> >> > Cc: Igor Mammedov <imammedo@redhat.com>
> >> > Cc: Eduardo Habkost <ehabkost@redhat.com>
> >> > ---
> >> >  cpus-common.c | 9 ++++-----
> >> >  1 file changed, 4 insertions(+), 5 deletions(-)
> >> >
> >> > diff --git a/cpus-common.c b/cpus-common.c
> >> > index 55d5df89237..5a7d2f6132b 100644
> >> > --- a/cpus-common.c
> >> > +++ b/cpus-common.c
> >> > @@ -61,13 +61,14 @@ static bool cpu_index_auto_assigned;
> >> >  static int cpu_get_free_index(void)
> >> >  {
> >> >      CPUState *some_cpu;
> >> > -    int cpu_index = 0;
> >> > +    int max_cpu_index = 0;
> >> >  
> >> >      cpu_index_auto_assigned = true;
> >> >      CPU_FOREACH(some_cpu) {
> >> > -        cpu_index++;
> >> > +        max_cpu_index = MAX(some_cpu->cpu_index, max_cpu_index);
> >> >      }
> >> > -    return cpu_index;
> >> > +    max_cpu_index++;
> >> > +    return max_cpu_index;
> >> >  }    
> >> 
> >> OK some ending up with cpu_index = 1 threw off devices that would
> >> do qemu_get_cpu(0) so I've tweaked the algorithm to:
> >> 
> >>   static int cpu_get_free_index(void)
> >>   {
> >>       CPUState *some_cpu;
> >>       int max_cpu_index = 0;
> >> 
> >>       cpu_index_auto_assigned = true;
> >>       CPU_FOREACH(some_cpu) {
> >>           if (some_cpu->cpu_index >= max_cpu_index) {
> >>               max_cpu_index = some_cpu->cpu_index + 1;
> >>           }
> >>       }
> >>       return max_cpu_index;
> >>   }
> >>   
> >> >  
> >> >  void cpu_list_add(CPUState *cpu)
> >> > @@ -90,8 +91,6 @@ void cpu_list_remove(CPUState *cpu)
> >> >          return;
> >> >      }
> >> >  
> >> > -    assert(!(cpu_index_auto_assigned && cpu !=
> >> > QTAILQ_LAST(&cpus))); -
> >> >      QTAILQ_REMOVE_RCU(&cpus, cpu, node);
> >> >      cpu->cpu_index = UNASSIGNED_CPU_INDEX;
> >> >  }    
> >> 
> >>   
> 
> 



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

* Re: [PATCH v1 7/8] tests/tcg: add new threadcount test
  2020-05-13 17:31 ` [PATCH v1 7/8] tests/tcg: add new threadcount test Alex Bennée
  2020-05-15 19:51   ` Nikolay Igotti
@ 2020-05-22  9:33   ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 21+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-05-22  9:33 UTC (permalink / raw)
  To: Alex Bennée, qemu-devel; +Cc: Nikolay Igotti

On 5/13/20 7:31 PM, Alex Bennée wrote:
> Based on the original testcase by Nikolay Igotti.
> 
> Message-ID: <CAEme+7GLKg_dNsHizzTKDymX9HyD+Ph2iZ=WKhOw2XG+zhViXg@mail.gmail.com>
> Cc: Nikolay Igotti <igotti@gmail.com>
> [Nikolay can we have your signed of by to add the testcase?]
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>   tests/tcg/multiarch/threadcount.c   | 62 +++++++++++++++++++++++++++++
>   tests/tcg/multiarch/Makefile.target |  2 +
>   2 files changed, 64 insertions(+)
>   create mode 100644 tests/tcg/multiarch/threadcount.c
> 
> diff --git a/tests/tcg/multiarch/threadcount.c b/tests/tcg/multiarch/threadcount.c
> new file mode 100644
> index 00000000000..546dd90eeb2
> --- /dev/null
> +++ b/tests/tcg/multiarch/threadcount.c
> @@ -0,0 +1,62 @@
> +/*
> + * Thread Exerciser
> + *
> + * Unlike testthread which is mainly concerned about testing thread
> + * semantics this test is used to exercise the thread creation and
> + * accounting. A version of this test found a problem with clashing
> + * cpu_indexes which caused a break in plugin handling.
> + *
> + * Based on the original test case by Nikolay Igotti.
> + *
> + * Copyright (c) 2020 Linaro Ltd
> + *
> + * SPDX-License-Identifier: GPL-2.0-or-later
> + */
> +
> +#include <stdint.h>
> +#include <stdio.h>
> +#include <stdlib.h>
> +#include <unistd.h>
> +#include <pthread.h>
> +
> +int max_threads = 10;
> +
> +typedef struct {
> +    int delay;
> +} ThreadArg;
> +
> +static void *thread_fn(void* varg)  {
> +    ThreadArg* arg = varg;
> +    usleep(arg->delay);
> +    free(arg);
> +    return NULL;
> +}
> +
> +int main(int argc, char **argv) {
> +    int i;
> +    pthread_t *threads;
> +
> +    if (argc > 1) {
> +        max_threads = atoi(argv[1]);
> +    }
> +    threads = calloc(sizeof(pthread_t), max_threads);
> +
> +    for (i = 0; i < max_threads; i++) {
> +        ThreadArg* arg = calloc(sizeof(ThreadArg), 1);
> +        arg->delay = i * 100;
> +        pthread_create(threads + i, NULL, thread_fn, arg);
> +    }
> +
> +    printf("Created %d threads\n", max_threads);
> +
> +    /* sleep until roughly half the threads have "finished" */
> +    usleep(max_threads * 50);
> +
> +    for (i = 0; i < max_threads; i++) {
> +        pthread_join(threads[i], NULL);
> +    }
> +
> +    printf("Done\n");
> +
> +    return 0;
> +}
> diff --git a/tests/tcg/multiarch/Makefile.target b/tests/tcg/multiarch/Makefile.target
> index 51fb75ecfdd..cb49cc9ccb2 100644
> --- a/tests/tcg/multiarch/Makefile.target
> +++ b/tests/tcg/multiarch/Makefile.target
> @@ -28,6 +28,8 @@ run-float_%: float_%
>   
>   testthread: LDFLAGS+=-lpthread
>   
> +threadcount: LDFLAGS+=-lpthread
> +
>   # We define the runner for test-mmap after the individual
>   # architectures have defined their supported pages sizes. If no
>   # additional page sizes are defined we only run the default test.
> 

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


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

* Re: [PATCH v1 6/8] linux-user: properly "unrealize" vCPU object
  2020-05-13 17:31 ` [PATCH v1 6/8] linux-user: properly "unrealize" vCPU object Alex Bennée
@ 2020-05-22  9:35   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 21+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-05-22  9:35 UTC (permalink / raw)
  To: Alex Bennée, qemu-devel
  Cc: Paolo Bonzini, Riku Voipio, Laurent Vivier, Nikolay Igotti

+Paolo

On 5/13/20 7:31 PM, Alex Bennée wrote:
> We shouldn't be messing around with the CPU list in linux-user save
> for the very special case of do_fork(). When threads end we need to
> properly follow QOM object lifetime handling and allow the eventual
> cpu_common_unrealizefn to both remove the CPU and ensure any clean-up
> actions are taken place, for example calling plugin exit hooks.
> 
> There is still a race condition to avoid so use the linux-user
> specific clone_lock instead of the cpu_list_lock to avoid it.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> Cc: Nikolay Igotti <igotti@gmail.com>

I dare to add:
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

But I'd rather see someone else reviewing this too.

> ---
>   linux-user/syscall.c | 19 +++++++++++--------
>   1 file changed, 11 insertions(+), 8 deletions(-)
> 
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 05f03919ff0..7f6700c54e3 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -7635,30 +7635,33 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
>               return -TARGET_ERESTARTSYS;
>           }
>   
> -        cpu_list_lock();
> +        pthread_mutex_lock(&clone_lock);
>   
>           if (CPU_NEXT(first_cpu)) {
> -            TaskState *ts;
> +            TaskState *ts = cpu->opaque;
>   
> -            /* Remove the CPU from the list.  */
> -            QTAILQ_REMOVE_RCU(&cpus, cpu, node);
> +            object_property_set_bool(OBJECT(cpu), false, "realized", NULL);
> +            object_unref(OBJECT(cpu));
> +            /*
> +             * At this point the CPU should be unrealized and removed
> +             * from cpu lists. We can clean-up the rest of the thread
> +             * data without the lock held.
> +             */
>   
> -            cpu_list_unlock();
> +            pthread_mutex_unlock(&clone_lock);
>   
> -            ts = cpu->opaque;
>               if (ts->child_tidptr) {
>                   put_user_u32(0, ts->child_tidptr);
>                   do_sys_futex(g2h(ts->child_tidptr), FUTEX_WAKE, INT_MAX,
>                             NULL, NULL, 0);
>               }
>               thread_cpu = NULL;
> -            object_unref(OBJECT(cpu));
>               g_free(ts);
>               rcu_unregister_thread();
>               pthread_exit(NULL);
>           }
>   
> -        cpu_list_unlock();
> +        pthread_mutex_unlock(&clone_lock);
>           preexit_cleanup(cpu_env, arg1);
>           _exit(arg1);
>           return 0; /* avoid warning */
> 



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

end of thread, back to index

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-13 17:31 [PATCH v1 0/8] plugins/next (cleanup, cpu_index and lockstep) Alex Bennée
2020-05-13 17:31 ` [PATCH v1 1/8] qemu/plugin: Trivial code movement Alex Bennée
2020-05-13 17:31 ` [PATCH v1 2/8] qemu/plugin: Move !CONFIG_PLUGIN stubs altogether Alex Bennée
2020-05-13 17:31 ` [PATCH v1 3/8] qemu/qemu-plugin: Make qemu_plugin_hwaddr_is_io() hwaddr argument const Alex Bennée
2020-05-13 17:31 ` [PATCH v1 4/8] MAINTAINERS: update the orphaned cpus-common.c file Alex Bennée
2020-05-13 19:26   ` Philippe Mathieu-Daudé
2020-05-13 17:31 ` [PATCH v1 5/8] cpus-common: ensure auto-assigned cpu_indexes don't clash Alex Bennée
2020-05-14 16:27   ` Alex Bennée
2020-05-21 15:53     ` Igor Mammedov
2020-05-21 17:10       ` Alex Bennée
2020-05-22  8:46         ` Igor Mammedow
2020-05-13 17:31 ` [PATCH v1 6/8] linux-user: properly "unrealize" vCPU object Alex Bennée
2020-05-22  9:35   ` Philippe Mathieu-Daudé
2020-05-13 17:31 ` [PATCH v1 7/8] tests/tcg: add new threadcount test Alex Bennée
2020-05-15 19:51   ` Nikolay Igotti
2020-05-22  9:33   ` Philippe Mathieu-Daudé
2020-05-13 17:32 ` [PATCH v1 8/8] plugins: new lockstep plugin for debugging TCG changes Alex Bennée
2020-05-13 19:25 ` [PATCH v1 0/8] plugins/next (cleanup, cpu_index and lockstep) Philippe Mathieu-Daudé
2020-05-14  0:56 ` no-reply
2020-05-14  1:36 ` no-reply
2020-05-14  1:36 ` no-reply

QEMU-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/qemu-devel/0 qemu-devel/git/0.git
	git clone --mirror https://lore.kernel.org/qemu-devel/1 qemu-devel/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 qemu-devel qemu-devel/ https://lore.kernel.org/qemu-devel \
		qemu-devel@nongnu.org
	public-inbox-index qemu-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.nongnu.qemu-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git