All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: qemu-devel@nongnu.org
Cc: "Richard Henderson" <richard.henderson@linaro.org>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"David Gibson" <david@gibson.dropbear.id.au>
Subject: [PATCH v4 22/30] target/riscv: Restrict has_work() handler to sysemu and TCG
Date: Sun, 12 Sep 2021 19:27:23 +0200	[thread overview]
Message-ID: <20210912172731.789788-23-f4bug@amsat.org> (raw)
In-Reply-To: <20210912172731.789788-1-f4bug@amsat.org>

Restrict has_work() to TCG sysemu.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 target/riscv/cpu.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index 13575c14085..abb555a8bdb 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -335,9 +335,9 @@ static void riscv_cpu_synchronize_from_tb(CPUState *cs,
     env->pc = tb->pc;
 }
 
+#if defined(CONFIG_TCG) && !defined(CONFIG_USER_ONLY)
 static bool riscv_cpu_has_work(CPUState *cs)
 {
-#ifndef CONFIG_USER_ONLY
     RISCVCPU *cpu = RISCV_CPU(cs);
     CPURISCVState *env = &cpu->env;
     /*
@@ -345,10 +345,8 @@ static bool riscv_cpu_has_work(CPUState *cs)
      * mode and delegation registers, but respect individual enables
      */
     return (env->mip & env->mie) != 0;
-#else
-    return true;
-#endif
 }
+#endif /* CONFIG_TCG && !CONFIG_USER_ONLY */
 
 void restore_state_to_opc(CPURISCVState *env, TranslationBlock *tb,
                           target_ulong *data)
@@ -647,6 +645,7 @@ static const struct TCGCPUOps riscv_tcg_ops = {
     .tlb_fill = riscv_cpu_tlb_fill,
 
 #ifndef CONFIG_USER_ONLY
+    .has_work = riscv_cpu_has_work,
     .cpu_exec_interrupt = riscv_cpu_exec_interrupt,
     .do_interrupt = riscv_cpu_do_interrupt,
     .do_transaction_failed = riscv_cpu_do_transaction_failed,
@@ -666,7 +665,6 @@ static void riscv_cpu_class_init(ObjectClass *c, void *data)
     device_class_set_parent_reset(dc, riscv_cpu_reset, &mcc->parent_reset);
 
     cc->class_by_name = riscv_cpu_class_by_name;
-    cc->has_work = riscv_cpu_has_work;
     cc->dump_state = riscv_cpu_dump_state;
     cc->set_pc = riscv_cpu_set_pc;
     cc->gdb_read_register = riscv_cpu_gdb_read_register;
-- 
2.31.1



  parent reply	other threads:[~2021-09-12 17:43 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-12 17:27 [PATCH v4 00/30] accel: Move has_work() from SysemuCPUOps to AccelOpsClass Philippe Mathieu-Daudé
2021-09-12 17:27 ` [PATCH v4 01/30] accel/tcg: Restrict cpu_handle_halt() to sysemu Philippe Mathieu-Daudé
2021-09-12 18:34   ` Richard Henderson
2021-09-12 17:27 ` [PATCH v4 02/30] hw/core: Restrict cpu_has_work() " Philippe Mathieu-Daudé
2021-09-12 17:27 ` [PATCH v4 03/30] hw/core: Un-inline cpu_has_work() Philippe Mathieu-Daudé
2021-09-12 17:27 ` [PATCH v4 04/30] sysemu: Introduce AccelOpsClass::has_work() Philippe Mathieu-Daudé
2021-09-12 17:27 ` [PATCH v4 05/30] accel/kvm: Implement AccelOpsClass::has_work() Philippe Mathieu-Daudé
2021-09-12 17:27 ` [PATCH v4 06/30] accel/whpx: " Philippe Mathieu-Daudé
2021-09-12 17:27 ` [PATCH v4 07/30] accel/tcg: Implement AccelOpsClass::has_work() as stub Philippe Mathieu-Daudé
2021-09-12 17:27 ` [PATCH v4 08/30] target/alpha: Restrict has_work() handler to sysemu Philippe Mathieu-Daudé
2021-09-12 17:27 ` [PATCH v4 09/30] target/arm: Restrict has_work() handler to sysemu and TCG Philippe Mathieu-Daudé
2021-09-12 17:27 ` [PATCH v4 10/30] target/avr: Restrict has_work() handler to sysemu Philippe Mathieu-Daudé
2021-09-12 17:27 ` [PATCH v4 11/30] target/cris: " Philippe Mathieu-Daudé
2021-09-12 17:27 ` [PATCH v4 12/30] target/hexagon: Remove unused has_work() handler Philippe Mathieu-Daudé
2021-09-12 17:27 ` [PATCH v4 13/30] target/hppa: Restrict has_work() handler to sysemu Philippe Mathieu-Daudé
2021-09-12 17:27 ` [PATCH v4 14/30] target/i386: Restrict has_work() handler to sysemu and TCG Philippe Mathieu-Daudé
2021-09-12 17:27 ` [PATCH v4 15/30] target/m68k: Restrict has_work() handler to sysemu Philippe Mathieu-Daudé
2021-09-12 17:27 ` [PATCH v4 16/30] target/microblaze: " Philippe Mathieu-Daudé
2021-09-12 17:27 ` [PATCH v4 17/30] target/mips: Restrict has_work() handler to sysemu and TCG Philippe Mathieu-Daudé
2021-09-12 17:27 ` [PATCH v4 18/30] target/nios2: Restrict has_work() handler to sysemu Philippe Mathieu-Daudé
2021-09-12 17:27 ` [PATCH v4 19/30] target/openrisc: " Philippe Mathieu-Daudé
2021-09-12 17:27 ` [PATCH v4 20/30] target/ppc: Introduce PowerPCCPUClass::has_work() Philippe Mathieu-Daudé
2021-09-12 18:46   ` Richard Henderson
2021-09-12 17:27 ` [PATCH v4 21/30] target/ppc: Restrict has_work() handlers to sysemu and TCG Philippe Mathieu-Daudé
2021-09-12 18:49   ` Richard Henderson
2021-09-12 17:27 ` Philippe Mathieu-Daudé [this message]
2021-09-12 17:27 ` [PATCH v4 23/30] target/rx: Restrict has_work() handler to sysemu Philippe Mathieu-Daudé
2021-09-12 17:27 ` [PATCH v4 24/30] target/s390x: Restrict has_work() handler to sysemu and TCG Philippe Mathieu-Daudé
2021-09-12 17:27 ` [PATCH v4 25/30] target/sh4: Restrict has_work() handler to sysemu Philippe Mathieu-Daudé
2021-09-12 17:27 ` [PATCH v4 26/30] target/sparc: Remove pointless use of CONFIG_TCG definition Philippe Mathieu-Daudé
2021-09-12 18:36   ` Richard Henderson
2021-09-12 17:27 ` [PATCH v4 27/30] target/sparc: Restrict has_work() handler to sysemu Philippe Mathieu-Daudé
2021-09-12 17:27 ` [PATCH v4 28/30] target/tricore: " Philippe Mathieu-Daudé
2021-09-12 17:27 ` [PATCH v4 29/30] target/xtensa: " Philippe Mathieu-Daudé
2021-09-12 17:27 ` [PATCH v4 30/30] accel: Add missing AccelOpsClass::has_work() and drop SysemuCPUOps one Philippe Mathieu-Daudé
2021-09-15 18:06 ` [PATCH v4 00/30] accel: Move has_work() from SysemuCPUOps to AccelOpsClass 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=20210912172731.789788-23-f4bug@amsat.org \
    --to=f4bug@amsat.org \
    --cc=david@gibson.dropbear.id.au \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.