xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Add Xen CpusAccel
@ 2020-10-12 20:07 Jason Andryuk
  2020-10-12 20:07 ` [PATCH 2/2] accel: Add xen CpusAccel using dummy-cpu Jason Andryuk
  2020-10-12 20:16 ` [PATCH 0/2] Add Xen CpusAccel Claudio Fontana
  0 siblings, 2 replies; 5+ messages in thread
From: Jason Andryuk @ 2020-10-12 20:07 UTC (permalink / raw)
  To: qemu-devel
  Cc: 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.

Jason Andryuk (2):
  accel: move qtest CpusAccel functions to a common location
  accel: Add xen CpusAccel using dummy-cpu

 .../qtest-cpus.c => dummy/dummy-cpus.c}       | 22 +++++--------------
 .../qtest-cpus.h => dummy/dummy-cpus.h}       | 10 ++++-----
 accel/dummy/meson.build                       |  7 ++++++
 accel/meson.build                             |  1 +
 accel/qtest/meson.build                       |  1 -
 accel/qtest/qtest.c                           |  7 +++++-
 accel/xen/xen-all.c                           | 10 +++++++++
 7 files changed, 34 insertions(+), 24 deletions(-)
 rename accel/{qtest/qtest-cpus.c => dummy/dummy-cpus.c} (76%)
 rename accel/{qtest/qtest-cpus.h => dummy/dummy-cpus.h} (59%)
 create mode 100644 accel/dummy/meson.build

-- 
2.25.1



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

* [PATCH 2/2] accel: Add xen CpusAccel using dummy-cpu
  2020-10-12 20:07 [PATCH 0/2] Add Xen CpusAccel Jason Andryuk
@ 2020-10-12 20:07 ` Jason Andryuk
  2020-10-12 20:25   ` Claudio Fontana
  2020-10-12 20:16 ` [PATCH 0/2] Add Xen CpusAccel Claudio Fontana
  1 sibling, 1 reply; 5+ messages in thread
From: Jason Andryuk @ 2020-10-12 20:07 UTC (permalink / raw)
  To: qemu-devel
  Cc: 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-cpu implementation
used by qtest.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
---
 accel/dummy/meson.build |  1 +
 accel/xen/xen-all.c     | 10 ++++++++++
 2 files changed, 11 insertions(+)

diff --git a/accel/dummy/meson.build b/accel/dummy/meson.build
index 5fbe27de90..cdff0ba746 100644
--- a/accel/dummy/meson.build
+++ b/accel/dummy/meson.build
@@ -4,3 +4,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..2d243c58d4 100644
--- a/accel/xen/xen-all.c
+++ b/accel/xen/xen-all.c
@@ -16,12 +16,15 @@
 #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"
 #include "migration/global_state.h"
 #include "hw/boards.h"
 
+#include "accel/dummy/dummy-cpus.h"
+
 //#define DEBUG_XEN
 
 #ifdef DEBUG_XEN
@@ -153,6 +156,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 +187,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] 5+ messages in thread

* Re: [PATCH 0/2] Add Xen CpusAccel
  2020-10-12 20:07 [PATCH 0/2] Add Xen CpusAccel Jason Andryuk
  2020-10-12 20:07 ` [PATCH 2/2] accel: Add xen CpusAccel using dummy-cpu Jason Andryuk
@ 2020-10-12 20:16 ` Claudio Fontana
  2020-10-13  8:42   ` Philippe Mathieu-Daudé
  1 sibling, 1 reply; 5+ messages in thread
From: Claudio Fontana @ 2020-10-12 20:16 UTC (permalink / raw)
  To: Jason Andryuk
  Cc: qemu-devel, Laurent Vivier, Thomas Huth, Stefano Stabellini,
	Paul Durrant, xen-devel, Anthony Perard, Paolo Bonzini

On 10/12/20 10:07 PM, 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.
> 
> Jason Andryuk (2):
>   accel: move qtest CpusAccel functions to a common location
>   accel: Add xen CpusAccel using dummy-cpu
> 
>  .../qtest-cpus.c => dummy/dummy-cpus.c}       | 22 +++++--------------
>  .../qtest-cpus.h => dummy/dummy-cpus.h}       | 10 ++++-----
>  accel/dummy/meson.build                       |  7 ++++++
>  accel/meson.build                             |  1 +
>  accel/qtest/meson.build                       |  1 -
>  accel/qtest/qtest.c                           |  7 +++++-
>  accel/xen/xen-all.c                           | 10 +++++++++
>  7 files changed, 34 insertions(+), 24 deletions(-)
>  rename accel/{qtest/qtest-cpus.c => dummy/dummy-cpus.c} (76%)
>  rename accel/{qtest/qtest-cpus.h => dummy/dummy-cpus.h} (59%)
>  create mode 100644 accel/dummy/meson.build
> 

Yep, forgot completely, sorry.

Acked-by: Claudio Fontana <cfontana@suse.de>




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

* Re: [PATCH 2/2] accel: Add xen CpusAccel using dummy-cpu
  2020-10-12 20:07 ` [PATCH 2/2] accel: Add xen CpusAccel using dummy-cpu Jason Andryuk
@ 2020-10-12 20:25   ` Claudio Fontana
  0 siblings, 0 replies; 5+ messages in thread
From: Claudio Fontana @ 2020-10-12 20:25 UTC (permalink / raw)
  To: Jason Andryuk, qemu-devel
  Cc: Anthony Perard, open list:X86 Xen CPUs, Stefano Stabellini, Paul Durrant

On 10/12/20 10:07 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-cpu implementation
> used by qtest.
> 
> Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
> ---
>  accel/dummy/meson.build |  1 +
>  accel/xen/xen-all.c     | 10 ++++++++++
>  2 files changed, 11 insertions(+)
> 
> diff --git a/accel/dummy/meson.build b/accel/dummy/meson.build
> index 5fbe27de90..cdff0ba746 100644
> --- a/accel/dummy/meson.build
> +++ b/accel/dummy/meson.build
> @@ -4,3 +4,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..2d243c58d4 100644
> --- a/accel/xen/xen-all.c
> +++ b/accel/xen/xen-all.c
> @@ -16,12 +16,15 @@
>  #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"
>  #include "migration/global_state.h"
>  #include "hw/boards.h"
>  
> +#include "accel/dummy/dummy-cpus.h"

it seems this should be in includes/sysemu/accel.h or so.

> +
>  //#define DEBUG_XEN
>  
>  #ifdef DEBUG_XEN
> @@ -153,6 +156,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 +187,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;
>  }
>  
> 

Ciao,

Claudio


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

* Re: [PATCH 0/2] Add Xen CpusAccel
  2020-10-12 20:16 ` [PATCH 0/2] Add Xen CpusAccel Claudio Fontana
@ 2020-10-13  8:42   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-10-13  8:42 UTC (permalink / raw)
  To: Claudio Fontana, Jason Andryuk
  Cc: Laurent Vivier, Thomas Huth, Stefano Stabellini, Paul Durrant,
	qemu-devel, Paolo Bonzini, Anthony Perard, xen-devel

On 10/12/20 10:16 PM, Claudio Fontana wrote:
> On 10/12/20 10:07 PM, 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.
>>
>> Jason Andryuk (2):
>>    accel: move qtest CpusAccel functions to a common location
>>    accel: Add xen CpusAccel using dummy-cpu
>>
>>   .../qtest-cpus.c => dummy/dummy-cpus.c}       | 22 +++++--------------
>>   .../qtest-cpus.h => dummy/dummy-cpus.h}       | 10 ++++-----
>>   accel/dummy/meson.build                       |  7 ++++++
>>   accel/meson.build                             |  1 +
>>   accel/qtest/meson.build                       |  1 -
>>   accel/qtest/qtest.c                           |  7 +++++-
>>   accel/xen/xen-all.c                           | 10 +++++++++
>>   7 files changed, 34 insertions(+), 24 deletions(-)
>>   rename accel/{qtest/qtest-cpus.c => dummy/dummy-cpus.c} (76%)
>>   rename accel/{qtest/qtest-cpus.h => dummy/dummy-cpus.h} (59%)
>>   create mode 100644 accel/dummy/meson.build
>>
> 
> Yep, forgot completely, sorry.

Good opportunity to ask the Xen folks to add testing
to our Gitlab CI, so this doesn't happen again :)

> 
> Acked-by: Claudio Fontana <cfontana@suse.de>
> 
> 
> 



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

end of thread, other threads:[~2020-10-13  8:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-12 20:07 [PATCH 0/2] Add Xen CpusAccel Jason Andryuk
2020-10-12 20:07 ` [PATCH 2/2] accel: Add xen CpusAccel using dummy-cpu Jason Andryuk
2020-10-12 20:25   ` Claudio Fontana
2020-10-12 20:16 ` [PATCH 0/2] Add Xen CpusAccel Claudio Fontana
2020-10-13  8:42   ` Philippe Mathieu-Daudé

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