From: Jason Andryuk <jandryuk@gmail.com>
To: qemu-devel@nongnu.org
Cc: Anthony Perard <anthony.perard@citrix.com>,
"open list:X86 Xen CPUs" <xen-devel@lists.xenproject.org>,
Stefano Stabellini <sstabellini@kernel.org>,
Paul Durrant <paul@xen.org>, Jason Andryuk <jandryuk@gmail.com>
Subject: [PATCH 2/2] accel: Add xen CpusAccel using dummy-cpu
Date: Mon, 12 Oct 2020 16:07:24 -0400 [thread overview]
Message-ID: <20201012200725.64137-3-jandryuk@gmail.com> (raw)
In-Reply-To: <20201012200725.64137-1-jandryuk@gmail.com>
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
next prev parent reply other threads:[~2020-10-12 20:09 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-12 20:07 [PATCH 0/2] Add Xen CpusAccel Jason Andryuk
2020-10-12 20:07 ` [PATCH 1/2] accel: move qtest CpusAccel functions to a common location Jason Andryuk
2020-10-12 20:23 ` Claudio Fontana
2020-10-12 20:30 ` Paolo Bonzini
2020-10-12 20:38 ` Jason Andryuk
2020-10-12 20:40 ` Jason Andryuk
2020-10-12 20:44 ` Paolo Bonzini
2020-10-12 20:07 ` Jason Andryuk [this message]
2020-10-12 20:25 ` [PATCH 2/2] accel: Add xen CpusAccel using dummy-cpu Claudio Fontana
2020-10-12 20:16 ` [PATCH 0/2] Add Xen CpusAccel Claudio Fontana
2020-10-13 8:42 ` Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201012200725.64137-3-jandryuk@gmail.com \
--to=jandryuk@gmail.com \
--cc=anthony.perard@citrix.com \
--cc=paul@xen.org \
--cc=qemu-devel@nongnu.org \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).