From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: qemu-devel@nongnu.org
Cc: "Bin Meng" <bin.meng@windriver.com>,
"Eduardo Habkost" <ehabkost@redhat.com>,
"Greg Kurz" <groug@kaod.org>,
haxm-team@intel.com, "Kamil Rytarowski" <kamil@netbsd.org>,
qemu-ppc@nongnu.org, "Anthony Perard" <anthony.perard@citrix.com>,
"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
"Michael Rolnik" <mrolnik@gmail.com>,
qemu-riscv@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
"Jiaxun Yang" <jiaxun.yang@flygoat.com>,
"Thomas Huth" <thuth@redhat.com>,
"David Hildenbrand" <david@redhat.com>,
"Chris Wulff" <crwulff@gmail.com>,
"Laurent Vivier" <lvivier@redhat.com>,
"Cameron Esfahani" <dirty@apple.com>,
"Sunil Muthuswamy" <sunilmut@microsoft.com>,
"Max Filippov" <jcmvbkbc@gmail.com>,
"Taylor Simpson" <tsimpson@quicinc.com>,
qemu-s390x@nongnu.org,
"Richard Henderson" <richard.henderson@linaro.org>,
"Bastian Koppelmann" <kbastian@mail.uni-paderborn.de>,
"Yoshinori Sato" <ysato@users.sourceforge.jp>,
"Artyom Tarasenko" <atar4qemu@gmail.com>,
"Aurelien Jarno" <aurelien@aurel32.net>,
"Paul Durrant" <paul@xen.org>,
"Peter Maydell" <peter.maydell@linaro.org>,
"David Gibson" <david@gibson.dropbear.id.au>,
"Alistair Francis" <alistair.francis@wdc.com>,
"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
"Roman Bolshakov" <r.bolshakov@yadro.com>,
"Laurent Vivier" <laurent@vivier.eu>,
"Cornelia Huck" <cohuck@redhat.com>,
qemu-arm@nongnu.org, "Wenchao Wang" <wenchao.wang@intel.com>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
xen-devel@lists.xenproject.org, "Marek Vasut" <marex@denx.de>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Aleksandar Rikalo" <aleksandar.rikalo@syrmia.com>,
"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
"Colin Xu" <colin.xu@intel.com>,
"Claudio Fontana" <cfontana@suse.de>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Stafford Horne" <shorne@gmail.com>,
"Reinoud Zandijk" <reinoud@netbsd.org>,
kvm@vger.kernel.org
Subject: [PATCH v3 07/30] accel/tcg: Implement AccelOpsClass::has_work() as stub
Date: Thu, 2 Sep 2021 18:15:20 +0200 [thread overview]
Message-ID: <20210902161543.417092-8-f4bug@amsat.org> (raw)
In-Reply-To: <20210902161543.417092-1-f4bug@amsat.org>
Add TCG target-specific has_work() handler in TCGCPUOps,
and add tcg_cpu_has_work() as AccelOpsClass has_work()
implementation.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
include/hw/core/tcg-cpu-ops.h | 4 ++++
accel/tcg/tcg-accel-ops.c | 12 ++++++++++++
2 files changed, 16 insertions(+)
diff --git a/include/hw/core/tcg-cpu-ops.h b/include/hw/core/tcg-cpu-ops.h
index bbec7760f48..919d9006e24 100644
--- a/include/hw/core/tcg-cpu-ops.h
+++ b/include/hw/core/tcg-cpu-ops.h
@@ -66,6 +66,10 @@ struct TCGCPUOps {
void (*do_interrupt)(CPUState *cpu);
#endif /* !CONFIG_USER_ONLY || !TARGET_I386 */
#ifdef CONFIG_SOFTMMU
+ /**
+ * @has_work: Callback for checking if there is work to do.
+ */
+ bool (*has_work)(CPUState *cpu);
/** @cpu_exec_interrupt: Callback for processing interrupts in cpu_exec */
bool (*cpu_exec_interrupt)(CPUState *cpu, int interrupt_request);
/**
diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c
index 1a8e8390bd6..ed4ebe735fe 100644
--- a/accel/tcg/tcg-accel-ops.c
+++ b/accel/tcg/tcg-accel-ops.c
@@ -32,6 +32,7 @@
#include "qemu/main-loop.h"
#include "qemu/guest-random.h"
#include "exec/exec-all.h"
+#include "hw/core/tcg-cpu-ops.h"
#include "tcg-accel-ops.h"
#include "tcg-accel-ops-mttcg.h"
@@ -73,6 +74,16 @@ int tcg_cpus_exec(CPUState *cpu)
return ret;
}
+static bool tcg_cpu_has_work(CPUState *cpu)
+{
+ CPUClass *cc = CPU_GET_CLASS(cpu);
+
+ if (!cc->tcg_ops->has_work) {
+ return false;
+ }
+ return cc->tcg_ops->has_work(cpu);
+}
+
/* mask must never be zero, except for A20 change call */
void tcg_handle_interrupt(CPUState *cpu, int mask)
{
@@ -108,6 +119,7 @@ static void tcg_accel_ops_init(AccelOpsClass *ops)
ops->kick_vcpu_thread = rr_kick_vcpu_thread;
ops->handle_interrupt = tcg_handle_interrupt;
}
+ ops->has_work = tcg_cpu_has_work;
}
static void tcg_accel_ops_class_init(ObjectClass *oc, void *data)
--
2.31.1
next prev parent reply other threads:[~2021-09-02 16:25 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-02 16:15 [PATCH v3 00/30] accel: Move has_work() from SysemuCPUOps to AccelOpsClass Philippe Mathieu-Daudé
2021-09-02 16:15 ` [PATCH v3 01/30] accel/tcg: Restrict cpu_handle_halt() to sysemu Philippe Mathieu-Daudé
2021-09-03 19:31 ` Richard Henderson
2021-09-02 16:15 ` [PATCH v3 02/30] hw/core: Restrict cpu_has_work() " Philippe Mathieu-Daudé
2021-09-03 20:11 ` Richard Henderson
2021-09-02 16:15 ` [PATCH v3 03/30] hw/core: Un-inline cpu_has_work() Philippe Mathieu-Daudé
2021-09-03 20:11 ` Richard Henderson
2021-09-02 16:15 ` [PATCH v3 04/30] sysemu: Introduce AccelOpsClass::has_work() Philippe Mathieu-Daudé
2021-09-03 20:14 ` Richard Henderson
2021-09-02 16:15 ` [PATCH v3 05/30] accel/kvm: Implement AccelOpsClass::has_work() Philippe Mathieu-Daudé
2021-09-03 20:15 ` Richard Henderson
2021-09-02 16:15 ` [PATCH v3 06/30] accel/whpx: " Philippe Mathieu-Daudé
2021-09-03 20:16 ` Richard Henderson
2021-09-02 16:15 ` Philippe Mathieu-Daudé [this message]
2021-09-03 20:17 ` [PATCH v3 07/30] accel/tcg: Implement AccelOpsClass::has_work() as stub Richard Henderson
2021-09-02 16:15 ` [PATCH v3 08/30] target/alpha: Restrict has_work() handler to sysemu and TCG Philippe Mathieu-Daudé
2021-09-03 20:18 ` Richard Henderson
2021-09-03 20:34 ` Philippe Mathieu-Daudé
2021-09-03 20:38 ` Richard Henderson
2021-09-02 16:15 ` [PATCH v3 09/30] target/arm: " Philippe Mathieu-Daudé
2021-09-03 20:19 ` Richard Henderson
2021-09-02 16:15 ` [PATCH v3 10/30] target/avr: " Philippe Mathieu-Daudé
2021-09-03 20:20 ` Richard Henderson
2021-09-02 16:15 ` [PATCH v3 11/30] target/cris: " Philippe Mathieu-Daudé
2021-09-03 20:21 ` Richard Henderson
2021-09-02 16:15 ` [PATCH v3 12/30] target/hexagon: Remove unused has_work() handler Philippe Mathieu-Daudé
2021-09-03 20:21 ` Richard Henderson
2021-09-02 16:15 ` [PATCH v3 13/30] target/hppa: Restrict has_work() handler to sysemu and TCG Philippe Mathieu-Daudé
2021-09-03 20:22 ` Richard Henderson
2021-09-02 16:15 ` [PATCH v3 14/30] target/i386: " Philippe Mathieu-Daudé
2021-09-03 20:23 ` Richard Henderson
2021-09-02 16:15 ` [PATCH v3 15/30] target/m68k: " Philippe Mathieu-Daudé
2021-09-03 20:24 ` Richard Henderson
2021-09-02 16:15 ` [PATCH v3 16/30] target/microblaze: " Philippe Mathieu-Daudé
2021-09-03 20:25 ` Richard Henderson
2021-09-02 16:15 ` [PATCH v3 17/30] target/mips: " Philippe Mathieu-Daudé
2021-09-03 20:26 ` Richard Henderson
2021-09-02 16:15 ` [PATCH v3 18/30] target/nios2: " Philippe Mathieu-Daudé
2021-09-03 20:31 ` Richard Henderson
2021-09-02 16:15 ` [PATCH v3 19/30] target/openrisc: " Philippe Mathieu-Daudé
2021-09-03 20:31 ` Richard Henderson
2021-09-02 16:15 ` [PATCH v3 20/30] target/ppc: " Philippe Mathieu-Daudé
2021-09-03 0:49 ` David Gibson
2021-09-03 20:43 ` Richard Henderson
2021-09-02 16:15 ` [PATCH v3 21/30] target/ppc: Introduce PowerPCCPUClass::has_work() Philippe Mathieu-Daudé
2021-09-03 0:50 ` David Gibson
2021-09-03 20:38 ` Philippe Mathieu-Daudé
2021-09-03 20:42 ` Richard Henderson
2021-09-03 21:11 ` Philippe Mathieu-Daudé
2021-09-11 22:31 ` Philippe Mathieu-Daudé
2021-09-12 12:31 ` Richard Henderson
2021-09-02 16:15 ` [PATCH v3 22/30] target/ppc: Simplify has_work() handlers Philippe Mathieu-Daudé
2021-09-03 20:43 ` Richard Henderson
2021-09-02 16:15 ` [PATCH v3 23/30] target/riscv: Restrict has_work() handler to sysemu and TCG Philippe Mathieu-Daudé
2021-09-03 20:43 ` Richard Henderson
2021-09-02 16:15 ` [PATCH v3 24/30] target/rx: " Philippe Mathieu-Daudé
2021-09-03 20:44 ` Richard Henderson
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=20210902161543.417092-8-f4bug@amsat.org \
--to=f4bug@amsat.org \
--cc=aleksandar.rikalo@syrmia.com \
--cc=alistair.francis@wdc.com \
--cc=anthony.perard@citrix.com \
--cc=atar4qemu@gmail.com \
--cc=aurelien@aurel32.net \
--cc=bin.meng@windriver.com \
--cc=cfontana@suse.de \
--cc=cohuck@redhat.com \
--cc=colin.xu@intel.com \
--cc=crwulff@gmail.com \
--cc=david@gibson.dropbear.id.au \
--cc=david@redhat.com \
--cc=dirty@apple.com \
--cc=edgar.iglesias@gmail.com \
--cc=ehabkost@redhat.com \
--cc=groug@kaod.org \
--cc=haxm-team@intel.com \
--cc=jcmvbkbc@gmail.com \
--cc=jiaxun.yang@flygoat.com \
--cc=kamil@netbsd.org \
--cc=kbastian@mail.uni-paderborn.de \
--cc=kvm@vger.kernel.org \
--cc=laurent@vivier.eu \
--cc=lvivier@redhat.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=marex@denx.de \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=mrolnik@gmail.com \
--cc=palmer@dabbelt.com \
--cc=paul@xen.org \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=r.bolshakov@yadro.com \
--cc=reinoud@netbsd.org \
--cc=richard.henderson@linaro.org \
--cc=shorne@gmail.com \
--cc=sstabellini@kernel.org \
--cc=sunilmut@microsoft.com \
--cc=thuth@redhat.com \
--cc=tsimpson@quicinc.com \
--cc=wenchao.wang@intel.com \
--cc=xen-devel@lists.xenproject.org \
--cc=ysato@users.sourceforge.jp \
/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).