* [PATCH v2 0/3] Add Xen CpusAccel
@ 2020-10-13 14:05 ` Jason Andryuk
0 siblings, 0 replies; 23+ messages in thread
From: Jason Andryuk @ 2020-10-13 14:05 UTC (permalink / raw)
To: qemu-devel
Cc: Laurent Vivier, Thomas Huth, Stefano Stabellini, Jason Andryuk,
Paul Durrant, Claudio Fontana, xen-devel, Anthony Perard,
Paolo Bonzini
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
--
2.25.1
^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH v2 0/3] Add Xen CpusAccel
@ 2020-10-13 14:05 ` Jason Andryuk
0 siblings, 0 replies; 23+ messages in thread
From: Jason Andryuk @ 2020-10-13 14:05 UTC (permalink / raw)
To: qemu-devel
Cc: Claudio Fontana, Jason Andryuk, Thomas Huth, Laurent Vivier,
Paolo Bonzini, Stefano Stabellini, Anthony Perard, Paul Durrant,
xen-devel
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
--
2.25.1
^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH v2 1/3] accel: Remove _WIN32 ifdef from qtest-cpus.c
2020-10-13 14:05 ` Jason Andryuk
(?)
@ 2020-10-13 14:05 ` Jason Andryuk
2020-10-13 14:06 ` Claudio Fontana
` (2 more replies)
-1 siblings, 3 replies; 23+ messages in thread
From: Jason Andryuk @ 2020-10-13 14:05 UTC (permalink / raw)
To: qemu-devel
Cc: Laurent Vivier, Paolo Bonzini, Thomas Huth, Claudio Fontana,
Jason Andryuk
dummy-cpus.c is only compiled with CONFIG_POSIX, so the _WIN32 condition
will never evaluate true. Remove it.
Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
---
v2: New in v2
---
accel/qtest/qtest-cpus.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/accel/qtest/qtest-cpus.c b/accel/qtest/qtest-cpus.c
index 7c5399ed9d..db094201c1 100644
--- a/accel/qtest/qtest-cpus.c
+++ b/accel/qtest/qtest-cpus.c
@@ -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)
--
2.25.1
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH v2 2/3] accel: move qtest CpusAccel functions to a common location
2020-10-13 14:05 ` Jason Andryuk
(?)
(?)
@ 2020-10-13 14:05 ` Jason Andryuk
2020-10-13 14:12 ` Claudio Fontana
2020-10-23 7:07 ` Thomas Huth
-1 siblings, 2 replies; 23+ messages in thread
From: Jason Andryuk @ 2020-10-13 14:05 UTC (permalink / raw)
To: qemu-devel
Cc: Laurent Vivier, Thomas Huth, Jason Andryuk, Claudio Fontana,
Paolo Bonzini, Richard Henderson
Move and rename accel/qtest/qtest-cpus.c files to accel/dummy-cpus.c so
it can be re-used by Xen.
Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
---
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
diff --git a/accel/qtest/qtest-cpus.c b/accel/dummy-cpus.c
similarity index 75%
rename from accel/qtest/qtest-cpus.c
rename to accel/dummy-cpus.c
index db094201c1..10429fdfb2 100644
--- a/accel/qtest/qtest-cpus.c
+++ b/accel/dummy-cpus.c
@@ -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,
-};
diff --git a/accel/meson.build b/accel/meson.build
index bb00d0fd13..9a417396bd 100644
--- a/accel/meson.build
+++ b/accel/meson.build
@@ -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)
diff --git a/accel/qtest/meson.build b/accel/qtest/meson.build
index e477cb2ae2..a2f3276459 100644
--- a/accel/qtest/meson.build
+++ b/accel/qtest/meson.build
@@ -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)
diff --git a/accel/qtest/qtest-cpus.h b/accel/qtest/qtest-cpus.h
deleted file mode 100644
index 739519a472..0000000000
--- a/accel/qtest/qtest-cpus.h
+++ /dev/null
@@ -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 */
diff --git a/accel/qtest/qtest.c b/accel/qtest/qtest.c
index 537e8b449c..b282cea5cf 100644
--- a/accel/qtest/qtest.c
+++ b/accel/qtest/qtest.c
@@ -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)
{
diff --git a/include/sysemu/cpus.h b/include/sysemu/cpus.h
index 231685955d..e8156728c6 100644
--- a/include/sysemu/cpus.h
+++ b/include/sysemu/cpus.h
@@ -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 */
--
2.25.1
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH v2 3/3] accel: Add xen CpusAccel using dummy-cpus
2020-10-13 14:05 ` Jason Andryuk
@ 2020-10-13 14:05 ` Jason Andryuk
-1 siblings, 0 replies; 23+ messages in thread
From: Jason Andryuk @ 2020-10-13 14:05 UTC (permalink / raw)
To: qemu-devel
Cc: Stefano Stabellini, Paul Durrant, Jason Andryuk, Claudio Fontana,
Anthony Perard, open list:X86 Xen CPUs
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.
Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
---
accel/meson.build | 1 +
accel/xen/xen-all.c | 8 ++++++++
2 files changed, 9 insertions(+)
diff --git a/accel/meson.build b/accel/meson.build
index 9a417396bd..b26cca227a 100644
--- a/accel/meson.build
+++ b/accel/meson.build
@@ -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)
diff --git a/accel/xen/xen-all.c b/accel/xen/xen-all.c
index 60b971d0a8..878a4089d9 100644
--- a/accel/xen/xen-all.c
+++ b/accel/xen/xen-all.c
@@ -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;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH v2 3/3] accel: Add xen CpusAccel using dummy-cpus
@ 2020-10-13 14:05 ` Jason Andryuk
0 siblings, 0 replies; 23+ messages in thread
From: Jason Andryuk @ 2020-10-13 14:05 UTC (permalink / raw)
To: qemu-devel
Cc: Claudio Fontana, Jason Andryuk, Stefano Stabellini,
Anthony Perard, Paul Durrant, open list:X86 Xen CPUs
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.
Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
---
accel/meson.build | 1 +
accel/xen/xen-all.c | 8 ++++++++
2 files changed, 9 insertions(+)
diff --git a/accel/meson.build b/accel/meson.build
index 9a417396bd..b26cca227a 100644
--- a/accel/meson.build
+++ b/accel/meson.build
@@ -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)
diff --git a/accel/xen/xen-all.c b/accel/xen/xen-all.c
index 60b971d0a8..878a4089d9 100644
--- a/accel/xen/xen-all.c
+++ b/accel/xen/xen-all.c
@@ -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;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 23+ messages in thread
* Re: [PATCH v2 1/3] accel: Remove _WIN32 ifdef from qtest-cpus.c
2020-10-13 14:05 ` [PATCH v2 1/3] accel: Remove _WIN32 ifdef from qtest-cpus.c Jason Andryuk
@ 2020-10-13 14:06 ` Claudio Fontana
2020-10-23 7:05 ` Thomas Huth
2020-10-23 8:04 ` Philippe Mathieu-Daudé
2 siblings, 0 replies; 23+ messages in thread
From: Claudio Fontana @ 2020-10-13 14:06 UTC (permalink / raw)
To: Jason Andryuk, qemu-devel; +Cc: Laurent Vivier, Paolo Bonzini, Thomas Huth
On 10/13/20 4:05 PM, Jason Andryuk wrote:
> dummy-cpus.c is only compiled with CONFIG_POSIX, so the _WIN32 condition
> will never evaluate true. Remove it.
>
> Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
> ---
> v2: New in v2
> ---
> accel/qtest/qtest-cpus.c | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/accel/qtest/qtest-cpus.c b/accel/qtest/qtest-cpus.c
> index 7c5399ed9d..db094201c1 100644
> --- a/accel/qtest/qtest-cpus.c
> +++ b/accel/qtest/qtest-cpus.c
> @@ -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)
>
Reviewed-by: Claudio Fontana <cfontana@suse.de>
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v2 2/3] accel: move qtest CpusAccel functions to a common location
2020-10-13 14:05 ` [PATCH v2 2/3] accel: move qtest CpusAccel functions to a common location Jason Andryuk
@ 2020-10-13 14:12 ` Claudio Fontana
2020-10-23 7:07 ` Thomas Huth
1 sibling, 0 replies; 23+ messages in thread
From: Claudio Fontana @ 2020-10-13 14:12 UTC (permalink / raw)
To: Jason Andryuk, qemu-devel
Cc: Laurent Vivier, Paolo Bonzini, Thomas Huth, Richard Henderson
On 10/13/20 4:05 PM, Jason Andryuk wrote:
> Move and rename accel/qtest/qtest-cpus.c files to accel/dummy-cpus.c so
> it can be re-used by Xen.
>
> Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
>
> ---
> 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
>
> diff --git a/accel/qtest/qtest-cpus.c b/accel/dummy-cpus.c
> similarity index 75%
> rename from accel/qtest/qtest-cpus.c
> rename to accel/dummy-cpus.c
> index db094201c1..10429fdfb2 100644
> --- a/accel/qtest/qtest-cpus.c
> +++ b/accel/dummy-cpus.c
> @@ -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,
> -};
> diff --git a/accel/meson.build b/accel/meson.build
> index bb00d0fd13..9a417396bd 100644
> --- a/accel/meson.build
> +++ b/accel/meson.build
> @@ -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)
> diff --git a/accel/qtest/meson.build b/accel/qtest/meson.build
> index e477cb2ae2..a2f3276459 100644
> --- a/accel/qtest/meson.build
> +++ b/accel/qtest/meson.build
> @@ -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)
> diff --git a/accel/qtest/qtest-cpus.h b/accel/qtest/qtest-cpus.h
> deleted file mode 100644
> index 739519a472..0000000000
> --- a/accel/qtest/qtest-cpus.h
> +++ /dev/null
> @@ -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 */
> diff --git a/accel/qtest/qtest.c b/accel/qtest/qtest.c
> index 537e8b449c..b282cea5cf 100644
> --- a/accel/qtest/qtest.c
> +++ b/accel/qtest/qtest.c
> @@ -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)
> {
> diff --git a/include/sysemu/cpus.h b/include/sysemu/cpus.h
> index 231685955d..e8156728c6 100644
> --- a/include/sysemu/cpus.h
> +++ b/include/sysemu/cpus.h
> @@ -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 */
>
Reviewed-by: Claudio Fontana <cfontana@suse.de>
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v2 3/3] accel: Add xen CpusAccel using dummy-cpus
2020-10-13 14:05 ` Jason Andryuk
@ 2020-10-13 14:12 ` Claudio Fontana
-1 siblings, 0 replies; 23+ messages in thread
From: Claudio Fontana @ 2020-10-13 14:12 UTC (permalink / raw)
To: Jason Andryuk, qemu-devel
Cc: Anthony Perard, open list:X86 Xen CPUs, Stefano Stabellini, Paul Durrant
On 10/13/20 4:05 PM, Jason Andryuk wrote:
> 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.
>
> Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
> ---
> accel/meson.build | 1 +
> accel/xen/xen-all.c | 8 ++++++++
> 2 files changed, 9 insertions(+)
>
> diff --git a/accel/meson.build b/accel/meson.build
> index 9a417396bd..b26cca227a 100644
> --- a/accel/meson.build
> +++ b/accel/meson.build
> @@ -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)
> diff --git a/accel/xen/xen-all.c b/accel/xen/xen-all.c
> index 60b971d0a8..878a4089d9 100644
> --- a/accel/xen/xen-all.c
> +++ b/accel/xen/xen-all.c
> @@ -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;
> }
>
>
Reviewed-by: Claudio Fontana <cfontana@suse.de>
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v2 3/3] accel: Add xen CpusAccel using dummy-cpus
@ 2020-10-13 14:12 ` Claudio Fontana
0 siblings, 0 replies; 23+ messages in thread
From: Claudio Fontana @ 2020-10-13 14:12 UTC (permalink / raw)
To: Jason Andryuk, qemu-devel
Cc: Stefano Stabellini, Anthony Perard, Paul Durrant, open list:X86 Xen CPUs
On 10/13/20 4:05 PM, Jason Andryuk wrote:
> 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.
>
> Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
> ---
> accel/meson.build | 1 +
> accel/xen/xen-all.c | 8 ++++++++
> 2 files changed, 9 insertions(+)
>
> diff --git a/accel/meson.build b/accel/meson.build
> index 9a417396bd..b26cca227a 100644
> --- a/accel/meson.build
> +++ b/accel/meson.build
> @@ -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)
> diff --git a/accel/xen/xen-all.c b/accel/xen/xen-all.c
> index 60b971d0a8..878a4089d9 100644
> --- a/accel/xen/xen-all.c
> +++ b/accel/xen/xen-all.c
> @@ -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;
> }
>
>
Reviewed-by: Claudio Fontana <cfontana@suse.de>
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v2 0/3] Add Xen CpusAccel
2020-10-13 14:05 ` Jason Andryuk
@ 2020-10-13 17:16 ` Paolo Bonzini
-1 siblings, 0 replies; 23+ messages in thread
From: Paolo Bonzini @ 2020-10-13 17:16 UTC (permalink / raw)
To: Jason Andryuk, qemu-devel
Cc: Laurent Vivier, Thomas Huth, Stefano Stabellini, Paul Durrant,
Claudio Fontana, Anthony Perard, xen-devel
On 13/10/20 16:05, Jason Andryuk wrote:
> 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
>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v2 0/3] Add Xen CpusAccel
@ 2020-10-13 17:16 ` Paolo Bonzini
0 siblings, 0 replies; 23+ messages in thread
From: Paolo Bonzini @ 2020-10-13 17:16 UTC (permalink / raw)
To: Jason Andryuk, qemu-devel
Cc: Claudio Fontana, Thomas Huth, Laurent Vivier, Stefano Stabellini,
Anthony Perard, Paul Durrant, xen-devel
On 13/10/20 16:05, Jason Andryuk wrote:
> 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
>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v2 3/3] accel: Add xen CpusAccel using dummy-cpus
2020-10-13 14:05 ` Jason Andryuk
@ 2020-10-16 15:05 ` Anthony PERARD
-1 siblings, 0 replies; 23+ messages in thread
From: Anthony PERARD via @ 2020-10-16 15:05 UTC (permalink / raw)
To: Jason Andryuk
Cc: qemu-devel, Claudio Fontana, Stefano Stabellini, Paul Durrant,
open list:X86 Xen CPUs
On Tue, Oct 13, 2020 at 10:05:11AM -0400, Jason Andryuk wrote:
> 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.
>
> Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
Thanks,
--
Anthony PERARD
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v2 3/3] accel: Add xen CpusAccel using dummy-cpus
@ 2020-10-16 15:05 ` Anthony PERARD
0 siblings, 0 replies; 23+ messages in thread
From: Anthony PERARD @ 2020-10-16 15:05 UTC (permalink / raw)
To: Jason Andryuk
Cc: qemu-devel, Claudio Fontana, Stefano Stabellini, Paul Durrant,
open list:X86 Xen CPUs
On Tue, Oct 13, 2020 at 10:05:11AM -0400, Jason Andryuk wrote:
> 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.
>
> Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
Thanks,
--
Anthony PERARD
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v2 0/3] Add Xen CpusAccel
2020-10-13 17:16 ` Paolo Bonzini
@ 2020-10-22 15:17 ` Jason Andryuk
-1 siblings, 0 replies; 23+ messages in thread
From: Jason Andryuk @ 2020-10-22 15:17 UTC (permalink / raw)
To: Paolo Bonzini
Cc: Laurent Vivier, Thomas Huth, Stefano Stabellini, Paul Durrant,
QEMU, Claudio Fontana, Anthony Perard, xen-devel
On Tue, Oct 13, 2020 at 1:16 PM Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> On 13/10/20 16:05, Jason Andryuk wrote:
> > 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
> >
>
> Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Thank you, Paolo. Also Anthony Acked and Claudio Reviewed patch 3.
How can we get this into the tree?
Regards,
Jason
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v2 0/3] Add Xen CpusAccel
@ 2020-10-22 15:17 ` Jason Andryuk
0 siblings, 0 replies; 23+ messages in thread
From: Jason Andryuk @ 2020-10-22 15:17 UTC (permalink / raw)
To: Paolo Bonzini
Cc: QEMU, Claudio Fontana, Thomas Huth, Laurent Vivier,
Stefano Stabellini, Anthony Perard, Paul Durrant, xen-devel
On Tue, Oct 13, 2020 at 1:16 PM Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> On 13/10/20 16:05, Jason Andryuk wrote:
> > 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
> >
>
> Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Thank you, Paolo. Also Anthony Acked and Claudio Reviewed patch 3.
How can we get this into the tree?
Regards,
Jason
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v2 0/3] Add Xen CpusAccel
2020-10-22 15:17 ` Jason Andryuk
@ 2020-10-22 15:29 ` Paolo Bonzini
-1 siblings, 0 replies; 23+ messages in thread
From: Paolo Bonzini @ 2020-10-22 15:29 UTC (permalink / raw)
To: Jason Andryuk
Cc: Laurent Vivier, Thomas Huth, Stefano Stabellini, Paul Durrant,
QEMU, Claudio Fontana, Anthony Perard, xen-devel
On 22/10/20 17:17, Jason Andryuk wrote:
> On Tue, Oct 13, 2020 at 1:16 PM Paolo Bonzini <pbonzini@redhat.com> wrote:
>>
>> On 13/10/20 16:05, Jason Andryuk wrote:
>>> 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
>>>
>>
>> Acked-by: Paolo Bonzini <pbonzini@redhat.com>
>
> 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
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v2 0/3] Add Xen CpusAccel
@ 2020-10-22 15:29 ` Paolo Bonzini
0 siblings, 0 replies; 23+ messages in thread
From: Paolo Bonzini @ 2020-10-22 15:29 UTC (permalink / raw)
To: Jason Andryuk
Cc: QEMU, Claudio Fontana, Thomas Huth, Laurent Vivier,
Stefano Stabellini, Anthony Perard, Paul Durrant, xen-devel
On 22/10/20 17:17, Jason Andryuk wrote:
> On Tue, Oct 13, 2020 at 1:16 PM Paolo Bonzini <pbonzini@redhat.com> wrote:
>>
>> On 13/10/20 16:05, Jason Andryuk wrote:
>>> 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
>>>
>>
>> Acked-by: Paolo Bonzini <pbonzini@redhat.com>
>
> 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
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v2 1/3] accel: Remove _WIN32 ifdef from qtest-cpus.c
2020-10-13 14:05 ` [PATCH v2 1/3] accel: Remove _WIN32 ifdef from qtest-cpus.c Jason Andryuk
2020-10-13 14:06 ` Claudio Fontana
@ 2020-10-23 7:05 ` Thomas Huth
2020-10-23 8:04 ` Philippe Mathieu-Daudé
2 siblings, 0 replies; 23+ messages in thread
From: Thomas Huth @ 2020-10-23 7:05 UTC (permalink / raw)
To: Jason Andryuk, qemu-devel; +Cc: Laurent Vivier, Paolo Bonzini, Claudio Fontana
On 13/10/2020 16.05, Jason Andryuk wrote:
> dummy-cpus.c is only compiled with CONFIG_POSIX, so the _WIN32 condition
> will never evaluate true. Remove it.
>
> Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
> ---
> v2: New in v2
> ---
> accel/qtest/qtest-cpus.c | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/accel/qtest/qtest-cpus.c b/accel/qtest/qtest-cpus.c
> index 7c5399ed9d..db094201c1 100644
> --- a/accel/qtest/qtest-cpus.c
> +++ b/accel/qtest/qtest-cpus.c
> @@ -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)
>
Reviewed-by: Thomas Huth <thuth@redhat.com>
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v2 2/3] accel: move qtest CpusAccel functions to a common location
2020-10-13 14:05 ` [PATCH v2 2/3] accel: move qtest CpusAccel functions to a common location Jason Andryuk
2020-10-13 14:12 ` Claudio Fontana
@ 2020-10-23 7:07 ` Thomas Huth
1 sibling, 0 replies; 23+ messages in thread
From: Thomas Huth @ 2020-10-23 7:07 UTC (permalink / raw)
To: Jason Andryuk, qemu-devel
Cc: Laurent Vivier, Paolo Bonzini, Claudio Fontana, Richard Henderson
On 13/10/2020 16.05, Jason Andryuk wrote:
> Move and rename accel/qtest/qtest-cpus.c files to accel/dummy-cpus.c so
> it can be re-used by Xen.
>
> Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
>
> ---
> 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
Acked-by: Thomas Huth <thuth@redhat.com>
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v2 0/3] Add Xen CpusAccel
2020-10-22 15:29 ` Paolo Bonzini
(?)
@ 2020-10-23 7:09 ` Thomas Huth
2020-10-23 9:34 ` Paolo Bonzini
-1 siblings, 1 reply; 23+ messages in thread
From: Thomas Huth @ 2020-10-23 7:09 UTC (permalink / raw)
To: Paolo Bonzini, Jason Andryuk
Cc: Laurent Vivier, Stefano Stabellini, Paul Durrant, QEMU,
Claudio Fontana, Anthony Perard, xen-devel
On 22/10/2020 17.29, Paolo Bonzini wrote:
> On 22/10/20 17:17, Jason Andryuk wrote:
>> On Tue, Oct 13, 2020 at 1:16 PM Paolo Bonzini <pbonzini@redhat.com> wrote:
>>>
>>> On 13/10/20 16:05, Jason Andryuk wrote:
>>>> 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
>>>>
>>>
>>> Acked-by: Paolo Bonzini <pbonzini@redhat.com>
>>
>> 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
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v2 1/3] accel: Remove _WIN32 ifdef from qtest-cpus.c
2020-10-13 14:05 ` [PATCH v2 1/3] accel: Remove _WIN32 ifdef from qtest-cpus.c Jason Andryuk
2020-10-13 14:06 ` Claudio Fontana
2020-10-23 7:05 ` Thomas Huth
@ 2020-10-23 8:04 ` Philippe Mathieu-Daudé
2 siblings, 0 replies; 23+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-10-23 8:04 UTC (permalink / raw)
To: Jason Andryuk, qemu-devel
Cc: Laurent Vivier, Paolo Bonzini, Thomas Huth, Claudio Fontana
On 10/13/20 4:05 PM, Jason Andryuk wrote:
> 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.
>
> Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
> ---
> v2: New in v2
> ---
> accel/qtest/qtest-cpus.c | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/accel/qtest/qtest-cpus.c b/accel/qtest/qtest-cpus.c
> index 7c5399ed9d..db094201c1 100644
> --- a/accel/qtest/qtest-cpus.c
> +++ b/accel/qtest/qtest-cpus.c
> @@ -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)
>
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v2 0/3] Add Xen CpusAccel
2020-10-23 7:09 ` Thomas Huth
@ 2020-10-23 9:34 ` Paolo Bonzini
0 siblings, 0 replies; 23+ messages in thread
From: Paolo Bonzini @ 2020-10-23 9:34 UTC (permalink / raw)
To: Thomas Huth, Jason Andryuk
Cc: Laurent Vivier, Stefano Stabellini, Paul Durrant, QEMU,
Claudio Fontana, Anthony Perard, xen-devel
On 23/10/20 09:09, Thomas Huth wrote:
> On 22/10/2020 17.29, Paolo Bonzini wrote:
>> On 22/10/20 17:17, Jason Andryuk wrote:
>>> On Tue, Oct 13, 2020 at 1:16 PM Paolo Bonzini <pbonzini@redhat.com> wrote:
>>>>
>>>> On 13/10/20 16:05, Jason Andryuk wrote:
>>>>> 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
>>>>>
>>>>
>>>> Acked-by: Paolo Bonzini <pbonzini@redhat.com>
>>>
>>> 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
^ permalink raw reply [flat|nested] 23+ messages in thread
end of thread, other threads:[~2020-10-23 9:36 UTC | newest]
Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-13 14:05 [PATCH v2 0/3] Add Xen CpusAccel Jason Andryuk
2020-10-13 14:05 ` Jason Andryuk
2020-10-13 14:05 ` [PATCH v2 1/3] accel: Remove _WIN32 ifdef from qtest-cpus.c Jason Andryuk
2020-10-13 14:06 ` Claudio Fontana
2020-10-23 7:05 ` Thomas Huth
2020-10-23 8:04 ` Philippe Mathieu-Daudé
2020-10-13 14:05 ` [PATCH v2 2/3] accel: move qtest CpusAccel functions to a common location Jason Andryuk
2020-10-13 14:12 ` Claudio Fontana
2020-10-23 7:07 ` Thomas Huth
2020-10-13 14:05 ` [PATCH v2 3/3] accel: Add xen CpusAccel using dummy-cpus Jason Andryuk
2020-10-13 14:05 ` Jason Andryuk
2020-10-13 14:12 ` Claudio Fontana
2020-10-13 14:12 ` Claudio Fontana
2020-10-16 15:05 ` Anthony PERARD via
2020-10-16 15:05 ` Anthony PERARD
2020-10-13 17:16 ` [PATCH v2 0/3] Add Xen CpusAccel Paolo Bonzini
2020-10-13 17:16 ` Paolo Bonzini
2020-10-22 15:17 ` Jason Andryuk
2020-10-22 15:17 ` Jason Andryuk
2020-10-22 15:29 ` Paolo Bonzini
2020-10-22 15:29 ` Paolo Bonzini
2020-10-23 7:09 ` Thomas Huth
2020-10-23 9:34 ` Paolo Bonzini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.