From: Sergey Fedorov <sergey.fedorov@linaro.org>
To: qemu-devel@nongnu.org
Cc: patches@linaro.org, serge.fdrv@gmail.com,
"MTTCG Devel" <mttcg@listserver.greensocs.com>,
"KONRAD Frédéric" <fred.konrad@greensocs.com>,
"Alvise Rigo" <a.rigo@virtualopensystems.com>,
"Emilio G. Cota" <cota@braap.org>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Richard Henderson" <rth@twiddle.net>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Sergey Fedorov" <sergey.fedorov@linaro.org>,
"Stefan Hajnoczi" <stefanha@redhat.com>
Subject: [Qemu-devel] [PATCH v3 10/12] bsd-user: Support CPU work queue
Date: Thu, 14 Jul 2016 00:00:20 +0300 [thread overview]
Message-ID: <1468443622-17368-11-git-send-email-sergey.fedorov@linaro.org> (raw)
In-Reply-To: <1468443622-17368-1-git-send-email-sergey.fedorov@linaro.org>
From: Sergey Fedorov <serge.fdrv@gmail.com>
It is a minimalistic support because bsd-linux claims to be _not_
threadsafe.
Signed-off-by: Sergey Fedorov <serge.fdrv@gmail.com>
Signed-off-by: Sergey Fedorov <sergey.fedorov@linaro.org>
---
bsd-user/main.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/bsd-user/main.c b/bsd-user/main.c
index 4819b9ec6333..f738dd64d691 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -63,6 +63,19 @@ int cpu_get_pic_interrupt(CPUX86State *env)
}
#endif
+void qemu_init_cpu_loop(void)
+{
+ /* We need to do this becuase process_queued_cpu_work() calls
+ * qemu_cond_broadcast() on it
+ */
+ qemu_cond_init(&qemu_work_cond);
+}
+
+QemuMutex *qemu_get_cpu_work_mutex(void)
+{
+ return NULL; /* it will never be used */
+}
+
/* These are no-ops because we are not threadsafe. */
static inline void cpu_exec_start(CPUArchState *env)
{
@@ -70,6 +83,7 @@ static inline void cpu_exec_start(CPUArchState *env)
static inline void cpu_exec_end(CPUArchState *env)
{
+ process_queued_cpu_work(cpu);
}
static inline void start_exclusive(void)
@@ -740,6 +754,7 @@ int main(int argc, char **argv)
if (argc <= 1)
usage();
+ qemu_init_cpu_loop();
module_call_init(MODULE_INIT_QOM);
if ((envlist = envlist_create()) == NULL) {
--
1.9.1
next prev parent reply other threads:[~2016-07-13 21:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-13 21:00 [Qemu-devel] [PATCH v3 00/12] cpu-exec: Safe work in quiescent state Sergey Fedorov
2016-07-13 21:00 ` [Qemu-devel] [PATCH v3 01/12] atomic: introduce atomic_dec_fetch Sergey Fedorov
2016-07-13 21:00 ` [Qemu-devel] [PATCH v3 02/12] cpus: pass CPUState to run_on_cpu helpers Sergey Fedorov
2016-07-13 21:00 ` [Qemu-devel] [PATCH v3 03/12] cpus: Move common code out of {async_, }run_on_cpu() Sergey Fedorov
2016-07-13 21:00 ` [Qemu-devel] [PATCH v3 04/12] cpus: Wrap mutex used to protect CPU work Sergey Fedorov
2016-07-13 21:00 ` [Qemu-devel] [PATCH v3 05/12] cpus: Rename flush_queued_work() Sergey Fedorov
2016-07-13 21:00 ` [Qemu-devel] [PATCH v3 06/12] linux-user: Use QemuMutex and QemuCond Sergey Fedorov
2016-07-13 21:00 ` [Qemu-devel] [PATCH v3 07/12] linux-user: Rework exclusive operation mechanism Sergey Fedorov
2016-07-13 21:00 ` [Qemu-devel] [PATCH v3 08/12] linux-user: Add qemu_cpu_is_self() and qemu_cpu_kick() Sergey Fedorov
2016-07-13 21:00 ` [Qemu-devel] [PATCH v3 09/12] linux-user: Support CPU work queue Sergey Fedorov
2016-07-13 21:00 ` Sergey Fedorov [this message]
2016-07-13 21:00 ` [Qemu-devel] [PATCH v3 11/12] cpu-exec-common: Introduce async_safe_run_on_cpu() Sergey Fedorov
2016-07-13 21:00 ` [Qemu-devel] [PATCH v3 12/12] tcg: Make tb_flush() thread safe Sergey Fedorov
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=1468443622-17368-11-git-send-email-sergey.fedorov@linaro.org \
--to=sergey.fedorov@linaro.org \
--cc=a.rigo@virtualopensystems.com \
--cc=alex.bennee@linaro.org \
--cc=cota@braap.org \
--cc=fred.konrad@greensocs.com \
--cc=mttcg@listserver.greensocs.com \
--cc=patches@linaro.org \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
--cc=serge.fdrv@gmail.com \
--cc=stefanha@redhat.com \
/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).