Skip to contentSkip to conversation

Add Xen CpusAccel

PATCH In review Jason Andryuk 6 participants 16 messages Oct 13, 2020 – Oct 23, 2020 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

v2 cover Add Xen CpusAccel

Xen was left behind when CpusAccel became mandatory and fails the assert in qemu_init_vcpu(). It relied on the same dummy cpu threads as qtest. Move the qtest cpu functions to a common location and reuse them for Xen.

v2:
New patch "accel: Remove _WIN32 ifdef from qtest-cpus.c" Use accel/dummy-cpus.c for filename
Put prototype in include/sysemu/cpus.h

Jason Andryuk (3):
accel: Remove _WIN32 ifdef from qtest-cpus.c
accel: move qtest CpusAccel functions to a common location
accel: Add xen CpusAccel using dummy-cpus

 accel/{qtest/qtest-cpus.c => dummy-cpus.c} | 27 ++++------------------
 accel/meson.build                          |  8 +++++++
 accel/qtest/meson.build                    |  1 -
 accel/qtest/qtest-cpus.h                   | 17 --------------
 accel/qtest/qtest.c                        |  5 +++-
 accel/xen/xen-all.c                        |  8 +++++++
 include/sysemu/cpus.h                      |  3 +++
 7 files changed, 27 insertions(+), 42 deletions(-)
 rename accel/{qtest/qtest-cpus.c => dummy-cpus.c} (71%)
 delete mode 100644 accel/qtest/qtest-cpus.h
Signature · 1 line
2.25.1
#1 lore raw

PATCH v2 1/3 accel: Remove _WIN32 ifdef from qtest-cpus.c

dummy-cpus.c is only compiled with CONFIG_POSIX, so the _WIN32 condition will never evaluate true. Remove it.

---
v2: New in v2

---
 accel/qtest/qtest-cpus.c | 5 -----
 1 file changed, 5 deletions(-)
accel/qtest/qtest-cpus.c +0 -5
index 7c5399ed9d..db094201c1 100644
@@ -29,10 +29,6 @@
 
 static void *qtest_cpu_thread_fn(void *arg)
 {
-#ifdef _WIN32
-    error_report("qtest is not supported under Windows");
-    exit(1);
-#else
     CPUState *cpu = arg;
     sigset_t waitset;
     int r;
@@ -69,7 +65,6 @@ static void *qtest_cpu_thread_fn(void *arg)
     qemu_mutex_unlock_iothread();
     rcu_unregister_thread();
     return NULL;
-#endif
 }
 
 static void qtest_start_vcpu_thread(CPUState *cpu)
Signature · 1 line
2.25.1
Reviewed-by on v2 1/3
#2 lore raw

Re: [PATCH v2 1/3] accel: Remove _WIN32 ifdef from qtest-cpus.c

Quoted 27 lines · Jason Andryuk

dummy-cpus.c is only compiled with CONFIG_POSIX, so the _WIN32 condition will never evaluate true. Remove it.

---
v2: New in v2

---
 accel/qtest/qtest-cpus.c | 5 -----
 1 file changed, 5 deletions(-)
accel/qtest/qtest-cpus.c +0 -4
index 7c5399ed9d..db094201c1 100644
@@ -29,10 +29,6 @@
 
 static void *qtest_cpu_thread_fn(void *arg)
 {
-#ifdef _WIN32
-    error_report("qtest is not supported under Windows");
-    exit(1);
-#else
     CPUState *cpu = arg;
     sigset_t waitset;
     int r;

accel/qtest/qtest-cpus.c static void *qtest_cpu_thread_fn(void *arg) · line 70

Quoted 7 lines
accel/qtest/qtest-cpus.c +0 -1
@@ -69,7 +65,6 @@ static void *qtest_cpu_thread_fn(void *arg)
     qemu_mutex_unlock_iothread();
     rcu_unregister_thread();
     return NULL;
-#endif
 }
 
 static void qtest_start_vcpu_thread(CPUState *cpu)
Reviewed-by on v2 1/3
#3 lore raw

Re: [PATCH v2 1/3] accel: Remove _WIN32 ifdef from qtest-cpus.c

In reply to Jason Andryuk
Quoted 27 lines · Jason Andryuk

dummy-cpus.c is only compiled with CONFIG_POSIX, so the _WIN32 condition will never evaluate true. Remove it.

---
v2: New in v2

---
 accel/qtest/qtest-cpus.c | 5 -----
 1 file changed, 5 deletions(-)
accel/qtest/qtest-cpus.c +0 -4
index 7c5399ed9d..db094201c1 100644
@@ -29,10 +29,6 @@
 
 static void *qtest_cpu_thread_fn(void *arg)
 {
-#ifdef _WIN32
-    error_report("qtest is not supported under Windows");
-    exit(1);
-#else
     CPUState *cpu = arg;
     sigset_t waitset;
     int r;

accel/qtest/qtest-cpus.c static void *qtest_cpu_thread_fn(void *arg) · line 70

Quoted 7 lines
accel/qtest/qtest-cpus.c +0 -1
@@ -69,7 +65,6 @@ static void *qtest_cpu_thread_fn(void *arg)
     qemu_mutex_unlock_iothread();
     rcu_unregister_thread();
     return NULL;
-#endif
 }
 
 static void qtest_start_vcpu_thread(CPUState *cpu)
#4 lore raw

Re: [PATCH v2 1/3] accel: Remove _WIN32 ifdef from qtest-cpus.c

In reply to Jason Andryuk
Quoted 2 lines · Jason Andryuk

dummy-cpus.c is only compiled with CONFIG_POSIX, so the _WIN32 condition will never evaluate true. Remove it.

I disagree with this removal, as you are making this a generic accelerator out of QTest. I'd rather keep this and replace the error message with "Dummy accelerator is not supported on Windows" and not make it POSIX-specific. As Paolo already acked this patch so I am not objecting to it.

Quoted 32 lines

---
v2: New in v2

---
  accel/qtest/qtest-cpus.c | 5 -----
  1 file changed, 5 deletions(-)
accel/qtest/qtest-cpus.c +0 -5
index 7c5399ed9d..db094201c1 100644
@@ -29,10 +29,6 @@
 
  static void *qtest_cpu_thread_fn(void *arg)
  {
-#ifdef _WIN32
-    error_report("qtest is not supported under Windows");
-    exit(1);
-#else
      CPUState *cpu = arg;
      sigset_t waitset;
      int r;
@@ -69,7 +65,6 @@ static void *qtest_cpu_thread_fn(void *arg)
      qemu_mutex_unlock_iothread();
      rcu_unregister_thread();
      return NULL;
-#endif
  }
 
  static void qtest_start_vcpu_thread(CPUState *cpu)
#5 lore raw

PATCH v2 2/3 accel: move qtest CpusAccel functions to a common location

In reply to Jason Andryuk

Move and rename accel/qtest/qtest-cpus.c files to accel/dummy-cpus.c so it can be re-used by Xen.

---
v2:
- Use accel/dummy-cpus.c
- Put prototype in include/sysemu/cpus.h

---
 accel/{qtest/qtest-cpus.c => dummy-cpus.c} | 22 ++++------------------
 accel/meson.build                          |  7 +++++++
 accel/qtest/meson.build                    |  1 -
 accel/qtest/qtest-cpus.h                   | 17 -----------------
 accel/qtest/qtest.c                        |  5 ++++-
 include/sysemu/cpus.h                      |  3 +++
 6 files changed, 18 insertions(+), 37 deletions(-)
 rename accel/{qtest/qtest-cpus.c => dummy-cpus.c} (75%)
 delete mode 100644 accel/qtest/qtest-cpus.h
accel/dummy-cpus.c renamed from accel/qtest/qtest-cpus.c +4 -18
similarity index 75%
rename from accel/qtest/qtest-cpus.c
rename to accel/dummy-cpus.c
index db094201c1..10429fdfb2 100644
@@ -1,5 +1,5 @@
 /*
- * QTest accelerator code
+ * Dummy cpu thread code
  *
  * Copyright IBM, Corp. 2011
  *
@@ -13,21 +13,12 @@
 
 #include "qemu/osdep.h"
 #include "qemu/rcu.h"
-#include "qapi/error.h"
-#include "qemu/module.h"
-#include "qemu/option.h"
-#include "qemu/config-file.h"
-#include "sysemu/accel.h"
-#include "sysemu/qtest.h"
 #include "sysemu/cpus.h"
-#include "sysemu/cpu-timers.h"
 #include "qemu/guest-random.h"
 #include "qemu/main-loop.h"
 #include "hw/core/cpu.h"
 
-#include "qtest-cpus.h"
-
-static void *qtest_cpu_thread_fn(void *arg)
+static void *dummy_cpu_thread_fn(void *arg)
 {
     CPUState *cpu = arg;
     sigset_t waitset;
@@ -67,7 +58,7 @@ static void *qtest_cpu_thread_fn(void *arg)
     return NULL;
 }
 
-static void qtest_start_vcpu_thread(CPUState *cpu)
+void dummy_start_vcpu_thread(CPUState *cpu)
 {
     char thread_name[VCPU_THREAD_NAME_SIZE];
 
@@ -76,11 +67,6 @@ static void qtest_start_vcpu_thread(CPUState *cpu)
     qemu_cond_init(cpu->halt_cond);
     snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "CPU %d/DUMMY",
              cpu->cpu_index);
-    qemu_thread_create(cpu->thread, thread_name, qtest_cpu_thread_fn, cpu,
+    qemu_thread_create(cpu->thread, thread_name, dummy_cpu_thread_fn, cpu,
                        QEMU_THREAD_JOINABLE);
 }
-
-const CpusAccel qtest_cpus = {
-    .create_vcpu_thread = qtest_start_vcpu_thread,
-    .get_virtual_clock = qtest_get_virtual_clock,
-};
accel/meson.build +7 -0
index bb00d0fd13..9a417396bd 100644
@@ -5,3 +5,10 @@ subdir('kvm')
 subdir('tcg')
 subdir('xen')
 subdir('stubs')
+
+dummy_ss = ss.source_set()
+dummy_ss.add(files(
+  'dummy-cpus.c',
+))
+
+specific_ss.add_all(when: ['CONFIG_SOFTMMU', 'CONFIG_POSIX'], if_true: dummy_ss)
accel/qtest/meson.build +0 -1
index e477cb2ae2..a2f3276459 100644
@@ -1,7 +1,6 @@
 qtest_ss = ss.source_set()
 qtest_ss.add(files(
   'qtest.c',
-  'qtest-cpus.c',
 ))
 
 specific_ss.add_all(when: ['CONFIG_SOFTMMU', 'CONFIG_POSIX'], if_true: qtest_ss)
accel/qtest/qtest-cpus.h deleted +0 -17
deleted file mode 100644
index 739519a472..0000000000
@@ -1,17 +0,0 @@
-/*
- * Accelerator CPUS Interface
- *
- * Copyright 2020 SUSE LLC
- *
- * This work is licensed under the terms of the GNU GPL, version 2 or later.
- * See the COPYING file in the top-level directory.
- */
-
-#ifndef QTEST_CPUS_H
-#define QTEST_CPUS_H
-
-#include "sysemu/cpus.h"
-
-extern const CpusAccel qtest_cpus;
-
-#endif /* QTEST_CPUS_H */
accel/qtest/qtest.c +4 -1
index 537e8b449c..b282cea5cf 100644
@@ -25,7 +25,10 @@
 #include "qemu/main-loop.h"
 #include "hw/core/cpu.h"
 
-#include "qtest-cpus.h"
+const CpusAccel qtest_cpus = {
+    .create_vcpu_thread = dummy_start_vcpu_thread,
+    .get_virtual_clock = qtest_get_virtual_clock,
+};
 
 static int qtest_init_accel(MachineState *ms)
 {
include/sysemu/cpus.h +3 -0
index 231685955d..e8156728c6 100644
@@ -25,6 +25,9 @@ typedef struct CpusAccel {
 /* register accel-specific cpus interface implementation */
 void cpus_register_accel(const CpusAccel *i);
 
+/* Create a dummy vcpu for CpusAccel->create_vcpu_thread */
+void dummy_start_vcpu_thread(CPUState *);
+
 /* interface available for cpus accelerator threads */
 
 /* For temporary buffers for forming a name */
Signature · 1 line
2.25.1
Reviewed-by on v2 2/3
#6 lore raw

Re: [PATCH v2 2/3] accel: move qtest CpusAccel functions to a common location

Quoted 151 lines · Jason Andryuk

Move and rename accel/qtest/qtest-cpus.c files to accel/dummy-cpus.c so it can be re-used by Xen.

---
v2:
- Use accel/dummy-cpus.c
- Put prototype in include/sysemu/cpus.h

---
 accel/{qtest/qtest-cpus.c => dummy-cpus.c} | 22 ++++------------------
 accel/meson.build                          |  7 +++++++
 accel/qtest/meson.build                    |  1 -
 accel/qtest/qtest-cpus.h                   | 17 -----------------
 accel/qtest/qtest.c                        |  5 ++++-
 include/sysemu/cpus.h                      |  3 +++
 6 files changed, 18 insertions(+), 37 deletions(-)
 rename accel/{qtest/qtest-cpus.c => dummy-cpus.c} (75%)
 delete mode 100644 accel/qtest/qtest-cpus.h
accel/dummy-cpus.c renamed from accel/qtest/qtest-cpus.c +4 -18
similarity index 75%
rename from accel/qtest/qtest-cpus.c
rename to accel/dummy-cpus.c
index db094201c1..10429fdfb2 100644
@@ -1,5 +1,5 @@
 /*
- * QTest accelerator code
+ * Dummy cpu thread code
  *
  * Copyright IBM, Corp. 2011
  *
@@ -13,21 +13,12 @@
 
 #include "qemu/osdep.h"
 #include "qemu/rcu.h"
-#include "qapi/error.h"
-#include "qemu/module.h"
-#include "qemu/option.h"
-#include "qemu/config-file.h"
-#include "sysemu/accel.h"
-#include "sysemu/qtest.h"
 #include "sysemu/cpus.h"
-#include "sysemu/cpu-timers.h"
 #include "qemu/guest-random.h"
 #include "qemu/main-loop.h"
 #include "hw/core/cpu.h"
 
-#include "qtest-cpus.h"
-
-static void *qtest_cpu_thread_fn(void *arg)
+static void *dummy_cpu_thread_fn(void *arg)
 {
     CPUState *cpu = arg;
     sigset_t waitset;
@@ -67,7 +58,7 @@ static void *qtest_cpu_thread_fn(void *arg)
     return NULL;
 }
 
-static void qtest_start_vcpu_thread(CPUState *cpu)
+void dummy_start_vcpu_thread(CPUState *cpu)
 {
     char thread_name[VCPU_THREAD_NAME_SIZE];
 
@@ -76,11 +67,6 @@ static void qtest_start_vcpu_thread(CPUState *cpu)
     qemu_cond_init(cpu->halt_cond);
     snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "CPU %d/DUMMY",
              cpu->cpu_index);
-    qemu_thread_create(cpu->thread, thread_name, qtest_cpu_thread_fn, cpu,
+    qemu_thread_create(cpu->thread, thread_name, dummy_cpu_thread_fn, cpu,
                        QEMU_THREAD_JOINABLE);
 }
-
-const CpusAccel qtest_cpus = {
-    .create_vcpu_thread = qtest_start_vcpu_thread,
-    .get_virtual_clock = qtest_get_virtual_clock,
-};
accel/meson.build +7 -0
index bb00d0fd13..9a417396bd 100644
@@ -5,3 +5,10 @@ subdir('kvm')
 subdir('tcg')
 subdir('xen')
 subdir('stubs')
+
+dummy_ss = ss.source_set()
+dummy_ss.add(files(
+  'dummy-cpus.c',
+))
+
+specific_ss.add_all(when: ['CONFIG_SOFTMMU', 'CONFIG_POSIX'], if_true: dummy_ss)
accel/qtest/meson.build +0 -1
index e477cb2ae2..a2f3276459 100644
@@ -1,7 +1,6 @@
 qtest_ss = ss.source_set()
 qtest_ss.add(files(
   'qtest.c',
-  'qtest-cpus.c',
 ))
 
 specific_ss.add_all(when: ['CONFIG_SOFTMMU', 'CONFIG_POSIX'], if_true: qtest_ss)
accel/qtest/qtest-cpus.h deleted +0 -17
deleted file mode 100644
index 739519a472..0000000000
@@ -1,17 +0,0 @@
-/*
- * Accelerator CPUS Interface
- *
- * Copyright 2020 SUSE LLC
- *
- * This work is licensed under the terms of the GNU GPL, version 2 or later.
- * See the COPYING file in the top-level directory.
- */
-
-#ifndef QTEST_CPUS_H
-#define QTEST_CPUS_H
-
-#include "sysemu/cpus.h"
-
-extern const CpusAccel qtest_cpus;
-
-#endif /* QTEST_CPUS_H */
accel/qtest/qtest.c +4 -1
index 537e8b449c..b282cea5cf 100644
@@ -25,7 +25,10 @@
 #include "qemu/main-loop.h"
 #include "hw/core/cpu.h"
 
-#include "qtest-cpus.h"
+const CpusAccel qtest_cpus = {
+    .create_vcpu_thread = dummy_start_vcpu_thread,
+    .get_virtual_clock = qtest_get_virtual_clock,
+};
 
 static int qtest_init_accel(MachineState *ms)
 {
include/sysemu/cpus.h +0 -0
index 231685955d..e8156728c6 100644

include/sysemu/cpus.h typedef struct CpusAccel { · line 33

Quoted 9 lines
include/sysemu/cpus.h +3 -0
@@ -25,6 +25,9 @@ typedef struct CpusAccel {
 /* register accel-specific cpus interface implementation */
 void cpus_register_accel(const CpusAccel *i);
 
+/* Create a dummy vcpu for CpusAccel->create_vcpu_thread */
+void dummy_start_vcpu_thread(CPUState *);
+
 /* interface available for cpus accelerator threads */
 
 /* For temporary buffers for forming a name */
Acked-by on v2 2/3
#7 lore raw

Re: [PATCH v2 2/3] accel: move qtest CpusAccel functions to a common location

In reply to Jason Andryuk
Quoted 9 lines · Jason Andryuk

Move and rename accel/qtest/qtest-cpus.c files to accel/dummy-cpus.c so it can be re-used by Xen.

---
v2:
- Use accel/dummy-cpus.c
- Put prototype in include/sysemu/cpus.h

Quoted 10 lines
---
 accel/{qtest/qtest-cpus.c => dummy-cpus.c} | 22 ++++------------------
 accel/meson.build                          |  7 +++++++
 accel/qtest/meson.build                    |  1 -
 accel/qtest/qtest-cpus.h                   | 17 -----------------
 accel/qtest/qtest.c                        |  5 ++++-
 include/sysemu/cpus.h                      |  3 +++
 6 files changed, 18 insertions(+), 37 deletions(-)
 rename accel/{qtest/qtest-cpus.c => dummy-cpus.c} (75%)
 delete mode 100644 accel/qtest/qtest-cpus.h
#8 lore raw

PATCH v2 3/3 accel: Add xen CpusAccel using dummy-cpus

In reply to Jason Andryuk

Xen was broken by commit 1583a3898853 ("cpus: extract out qtest-specific code to accel/qtest"). Xen relied on qemu_init_vcpu() calling qemu_dummy_start_vcpu() in the default case, but that was replaced by g_assert_not_reached().

Add a minimal "CpusAccel" for Xen using the dummy-cpus implementation used by qtest.

---
 accel/meson.build   | 1 +
 accel/xen/xen-all.c | 8 ++++++++
 2 files changed, 9 insertions(+)
accel/meson.build +1 -0
index 9a417396bd..b26cca227a 100644
@@ -12,3 +12,4 @@ dummy_ss.add(files(
 ))
 
 specific_ss.add_all(when: ['CONFIG_SOFTMMU', 'CONFIG_POSIX'], if_true: dummy_ss)
+specific_ss.add_all(when: ['CONFIG_XEN'], if_true: dummy_ss)
accel/xen/xen-all.c +8 -0
index 60b971d0a8..878a4089d9 100644
@@ -16,6 +16,7 @@
 #include "hw/xen/xen_pt.h"
 #include "chardev/char.h"
 #include "sysemu/accel.h"
+#include "sysemu/cpus.h"
 #include "sysemu/xen.h"
 #include "sysemu/runstate.h"
 #include "migration/misc.h"
@@ -153,6 +154,10 @@ static void xen_setup_post(MachineState *ms, AccelState *accel)
     }
 }
 
+const CpusAccel xen_cpus = {
+    .create_vcpu_thread = dummy_start_vcpu_thread,
+};
+
 static int xen_init(MachineState *ms)
 {
     MachineClass *mc = MACHINE_GET_CLASS(ms);
@@ -180,6 +185,9 @@ static int xen_init(MachineState *ms)
      * opt out of system RAM being allocated by generic code
      */
     mc->default_ram_id = NULL;
+
+    cpus_register_accel(&xen_cpus);
+
     return 0;
 }
 
Signature · 1 line
2.25.1
Reviewed-by on v2 3/3
#9 lore raw

Re: [PATCH v2 3/3] accel: Add xen CpusAccel using dummy-cpus

Quoted 48 lines · Jason Andryuk

Xen was broken by commit 1583a3898853 ("cpus: extract out qtest-specific code to accel/qtest"). Xen relied on qemu_init_vcpu() calling qemu_dummy_start_vcpu() in the default case, but that was replaced by g_assert_not_reached().

Add a minimal "CpusAccel" for Xen using the dummy-cpus implementation used by qtest.

---
 accel/meson.build   | 1 +
 accel/xen/xen-all.c | 8 ++++++++
 2 files changed, 9 insertions(+)
accel/meson.build +1 -0
index 9a417396bd..b26cca227a 100644
@@ -12,3 +12,4 @@ dummy_ss.add(files(
 ))
 
 specific_ss.add_all(when: ['CONFIG_SOFTMMU', 'CONFIG_POSIX'], if_true: dummy_ss)
+specific_ss.add_all(when: ['CONFIG_XEN'], if_true: dummy_ss)
accel/xen/xen-all.c +5 -0
index 60b971d0a8..878a4089d9 100644
@@ -16,6 +16,7 @@
 #include "hw/xen/xen_pt.h"
 #include "chardev/char.h"
 #include "sysemu/accel.h"
+#include "sysemu/cpus.h"
 #include "sysemu/xen.h"
 #include "sysemu/runstate.h"
 #include "migration/misc.h"
@@ -153,6 +154,10 @@ static void xen_setup_post(MachineState *ms, AccelState *accel)
     }
 }
 
+const CpusAccel xen_cpus = {
+    .create_vcpu_thread = dummy_start_vcpu_thread,
+};
+
 static int xen_init(MachineState *ms)
 {
     MachineClass *mc = MACHINE_GET_CLASS(ms);

accel/xen/xen-all.c static int xen_init(MachineState *ms) · line 193

Quoted 9 lines
accel/xen/xen-all.c +3 -0
@@ -180,6 +185,9 @@ static int xen_init(MachineState *ms)
      * opt out of system RAM being allocated by generic code
      */
     mc->default_ram_id = NULL;
+
+    cpus_register_accel(&xen_cpus);
+
     return 0;
 }
 
Acked-by Anthony PERARD on v2 3/3
#10 lore raw

Re: [PATCH v2 3/3] accel: Add xen CpusAccel using dummy-cpus

In reply to Jason Andryuk
Quoted 9 lines · Jason Andryuk

Xen was broken by commit 1583a3898853 ("cpus: extract out qtest-specific code to accel/qtest"). Xen relied on qemu_init_vcpu() calling qemu_dummy_start_vcpu() in the default case, but that was replaced by g_assert_not_reached().

Add a minimal "CpusAccel" for Xen using the dummy-cpus implementation used by qtest.

Thanks,

Signature · 1 line
Anthony PERARD
Acked-by on the v2 series
#11 lore raw
In reply to Jason Andryuk
Quoted 15 lines · Jason Andryuk

Xen was left behind when CpusAccel became mandatory and fails the assert in qemu_init_vcpu(). It relied on the same dummy cpu threads as qtest. Move the qtest cpu functions to a common location and reuse them for Xen.

v2:
New patch "accel: Remove _WIN32 ifdef from qtest-cpus.c" Use accel/dummy-cpus.c for filename
Put prototype in include/sysemu/cpus.h

Jason Andryuk (3):
accel: Remove _WIN32 ifdef from qtest-cpus.c
accel: move qtest CpusAccel functions to a common location
accel: Add xen CpusAccel using dummy-cpus

Quoted 11 lines
 accel/{qtest/qtest-cpus.c => dummy-cpus.c} | 27 ++++------------------
 accel/meson.build                          |  8 +++++++
 accel/qtest/meson.build                    |  1 -
 accel/qtest/qtest-cpus.h                   | 17 --------------
 accel/qtest/qtest.c                        |  5 +++-
 accel/xen/xen-all.c                        |  8 +++++++
 include/sysemu/cpus.h                      |  3 +++
 7 files changed, 27 insertions(+), 42 deletions(-)
 rename accel/{qtest/qtest-cpus.c => dummy-cpus.c} (71%)
 delete mode 100644 accel/qtest/qtest-cpus.h
#12 lore raw
Quoted 29 lines · Paolo Bonzini
Quoted 15 lines · Jason Andryuk

Xen was left behind when CpusAccel became mandatory and fails the assert in qemu_init_vcpu(). It relied on the same dummy cpu threads as qtest. Move the qtest cpu functions to a common location and reuse them for Xen.

v2:
New patch "accel: Remove _WIN32 ifdef from qtest-cpus.c" Use accel/dummy-cpus.c for filename
Put prototype in include/sysemu/cpus.h

Jason Andryuk (3):
accel: Remove _WIN32 ifdef from qtest-cpus.c
accel: move qtest CpusAccel functions to a common location
accel: Add xen CpusAccel using dummy-cpus

Quoted 11 lines
 accel/{qtest/qtest-cpus.c => dummy-cpus.c} | 27 ++++------------------
 accel/meson.build                          |  8 +++++++
 accel/qtest/meson.build                    |  1 -
 accel/qtest/qtest-cpus.h                   | 17 --------------
 accel/qtest/qtest.c                        |  5 +++-
 accel/xen/xen-all.c                        |  8 +++++++
 include/sysemu/cpus.h                      |  3 +++
 7 files changed, 27 insertions(+), 42 deletions(-)
 rename accel/{qtest/qtest-cpus.c => dummy-cpus.c} (71%)
 delete mode 100644 accel/qtest/qtest-cpus.h
Quoted 1 line

Thank you, Paolo. Also Anthony Acked and Claudio Reviewed patch 3. How can we get this into the tree?

Regards,
Jason

#13 lore raw
Quoted 30 lines · Jason Andryuk
Quoted 29 lines · Paolo Bonzini
Quoted 26 lines · Jason Andryuk

Xen was left behind when CpusAccel became mandatory and fails the assert in qemu_init_vcpu(). It relied on the same dummy cpu threads as qtest. Move the qtest cpu functions to a common location and reuse them for Xen.

v2:
New patch "accel: Remove _WIN32 ifdef from qtest-cpus.c" Use accel/dummy-cpus.c for filename
Put prototype in include/sysemu/cpus.h

Jason Andryuk (3):
accel: Remove _WIN32 ifdef from qtest-cpus.c
accel: move qtest CpusAccel functions to a common location
accel: Add xen CpusAccel using dummy-cpus

 accel/{qtest/qtest-cpus.c => dummy-cpus.c} | 27 ++++------------------
 accel/meson.build                          |  8 +++++++
 accel/qtest/meson.build                    |  1 -
 accel/qtest/qtest-cpus.h                   | 17 --------------
 accel/qtest/qtest.c                        |  5 +++-
 accel/xen/xen-all.c                        |  8 +++++++
 include/sysemu/cpus.h                      |  3 +++
 7 files changed, 27 insertions(+), 42 deletions(-)
 rename accel/{qtest/qtest-cpus.c => dummy-cpus.c} (71%)
 delete mode 100644 accel/qtest/qtest-cpus.h
Quoted 4 lines
Quoted 1 line

Thank you, Paolo. Also Anthony Acked and Claudio Reviewed patch 3. How can we get this into the tree?

I think Anthony should send a pull request?

Paolo

#14 lore raw
Quoted 31 lines · Paolo Bonzini
Quoted 30 lines · Jason Andryuk
Quoted 29 lines · Paolo Bonzini
Quoted 26 lines · Jason Andryuk

Xen was left behind when CpusAccel became mandatory and fails the assert in qemu_init_vcpu(). It relied on the same dummy cpu threads as qtest. Move the qtest cpu functions to a common location and reuse them for Xen.

v2:
New patch "accel: Remove _WIN32 ifdef from qtest-cpus.c" Use accel/dummy-cpus.c for filename
Put prototype in include/sysemu/cpus.h

Jason Andryuk (3):
accel: Remove _WIN32 ifdef from qtest-cpus.c
accel: move qtest CpusAccel functions to a common location
accel: Add xen CpusAccel using dummy-cpus

 accel/{qtest/qtest-cpus.c => dummy-cpus.c} | 27 ++++------------------
 accel/meson.build                          |  8 +++++++
 accel/qtest/meson.build                    |  1 -
 accel/qtest/qtest-cpus.h                   | 17 --------------
 accel/qtest/qtest.c                        |  5 +++-
 accel/xen/xen-all.c                        |  8 +++++++
 include/sysemu/cpus.h                      |  3 +++
 7 files changed, 27 insertions(+), 42 deletions(-)
 rename accel/{qtest/qtest-cpus.c => dummy-cpus.c} (71%)
 delete mode 100644 accel/qtest/qtest-cpus.h
Quoted 6 lines
Quoted 4 lines
Quoted 1 line

Thank you, Paolo. Also Anthony Acked and Claudio Reviewed patch 3. How can we get this into the tree?

I think Anthony should send a pull request?

Since Anthony acked patch 3, I think I can also take it through the qtest tree.

Thomas

#15 lore raw
Quoted 32 lines · Thomas Huth
Quoted 31 lines · Paolo Bonzini
Quoted 30 lines · Jason Andryuk
Quoted 29 lines · Paolo Bonzini
Quoted 26 lines · Jason Andryuk

Xen was left behind when CpusAccel became mandatory and fails the assert in qemu_init_vcpu(). It relied on the same dummy cpu threads as qtest. Move the qtest cpu functions to a common location and reuse them for Xen.

v2:
New patch "accel: Remove _WIN32 ifdef from qtest-cpus.c" Use accel/dummy-cpus.c for filename
Put prototype in include/sysemu/cpus.h

Jason Andryuk (3):
accel: Remove _WIN32 ifdef from qtest-cpus.c
accel: move qtest CpusAccel functions to a common location
accel: Add xen CpusAccel using dummy-cpus

 accel/{qtest/qtest-cpus.c => dummy-cpus.c} | 27 ++++------------------
 accel/meson.build                          |  8 +++++++
 accel/qtest/meson.build                    |  1 -
 accel/qtest/qtest-cpus.h                   | 17 --------------
 accel/qtest/qtest.c                        |  5 +++-
 accel/xen/xen-all.c                        |  8 +++++++
 include/sysemu/cpus.h                      |  3 +++
 7 files changed, 27 insertions(+), 42 deletions(-)
 rename accel/{qtest/qtest-cpus.c => dummy-cpus.c} (71%)
 delete mode 100644 accel/qtest/qtest-cpus.h
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 1 line

Thank you, Paolo. Also Anthony Acked and Claudio Reviewed patch 3. How can we get this into the tree?

I think Anthony should send a pull request?

Since Anthony acked patch 3, I think I can also take it through the qtest tree.

No objections, thanks!

Paolo