xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] Add Xen CpusAccel
@ 2020-10-13 14:05 Jason Andryuk
  2020-10-13 14:05 ` [PATCH v2 3/3] accel: Add xen CpusAccel using dummy-cpus Jason Andryuk
  2020-10-13 17:16 ` [PATCH v2 0/3] Add Xen CpusAccel Paolo Bonzini
  0 siblings, 2 replies; 9+ 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] 9+ messages in thread

* [PATCH v2 3/3] accel: Add xen CpusAccel using dummy-cpus
  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:12   ` Claudio Fontana
  2020-10-16 15:05   ` Anthony PERARD
  2020-10-13 17:16 ` [PATCH v2 0/3] Add Xen CpusAccel Paolo Bonzini
  1 sibling, 2 replies; 9+ 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] 9+ messages in thread

* Re: [PATCH v2 3/3] accel: Add xen CpusAccel using dummy-cpus
  2020-10-13 14:05 ` [PATCH v2 3/3] accel: Add xen CpusAccel using dummy-cpus Jason Andryuk
@ 2020-10-13 14:12   ` Claudio Fontana
  2020-10-16 15:05   ` Anthony PERARD
  1 sibling, 0 replies; 9+ 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] 9+ messages in thread

* Re: [PATCH v2 0/3] Add Xen CpusAccel
  2020-10-13 14:05 [PATCH v2 0/3] Add Xen CpusAccel Jason Andryuk
  2020-10-13 14:05 ` [PATCH v2 3/3] accel: Add xen CpusAccel using dummy-cpus Jason Andryuk
@ 2020-10-13 17:16 ` Paolo Bonzini
  2020-10-22 15:17   ` Jason Andryuk
  1 sibling, 1 reply; 9+ 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] 9+ messages in thread

* Re: [PATCH v2 3/3] accel: Add xen CpusAccel using dummy-cpus
  2020-10-13 14:05 ` [PATCH v2 3/3] accel: Add xen CpusAccel using dummy-cpus Jason Andryuk
  2020-10-13 14:12   ` Claudio Fontana
@ 2020-10-16 15:05   ` Anthony PERARD
  1 sibling, 0 replies; 9+ 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] 9+ messages in thread

* Re: [PATCH v2 0/3] Add Xen CpusAccel
  2020-10-13 17:16 ` [PATCH v2 0/3] Add Xen CpusAccel Paolo Bonzini
@ 2020-10-22 15:17   ` Jason Andryuk
  2020-10-22 15:29     ` Paolo Bonzini
  0 siblings, 1 reply; 9+ 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] 9+ 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
  2020-10-23  7:09       ` Thomas Huth
  0 siblings, 1 reply; 9+ 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] 9+ 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
  0 siblings, 1 reply; 9+ 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] 9+ 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; 9+ 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] 9+ messages in thread

end of thread, other threads:[~2020-10-23  9:35 UTC | newest]

Thread overview: 9+ 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 ` [PATCH v2 3/3] accel: Add xen CpusAccel using dummy-cpus Jason Andryuk
2020-10-13 14:12   ` Claudio Fontana
2020-10-16 15:05   ` Anthony PERARD
2020-10-13 17:16 ` [PATCH v2 0/3] Add Xen CpusAccel Paolo Bonzini
2020-10-22 15:17   ` Jason Andryuk
2020-10-22 15:29     ` Paolo Bonzini
2020-10-23  7:09       ` Thomas Huth
2020-10-23  9:34         ` Paolo Bonzini

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