qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: qemu-devel@nongnu.org
Cc: "Richard Henderson" <richard.henderson@linaro.org>,
	"Laurent Vivier" <laurent@vivier.eu>,
	"Warner Losh" <imp@bsdimp.com>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>
Subject: [PATCH v2 06/24] target/alpha: Restrict cpu_exec_interrupt() handler to sysemu
Date: Sun,  5 Sep 2021 01:55:24 +0200	[thread overview]
Message-ID: <20210904235542.1092641-7-f4bug@amsat.org> (raw)
In-Reply-To: <20210904235542.1092641-1-f4bug@amsat.org>

Restrict cpu_exec_interrupt() and its callees to sysemu.

Reviewed-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 target/alpha/cpu.h    | 2 +-
 target/alpha/cpu.c    | 2 +-
 target/alpha/helper.c | 5 ++---
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/target/alpha/cpu.h b/target/alpha/cpu.h
index 82df108967b..4e993bd15bd 100644
--- a/target/alpha/cpu.h
+++ b/target/alpha/cpu.h
@@ -274,10 +274,10 @@ struct AlphaCPU {
 
 #ifndef CONFIG_USER_ONLY
 extern const VMStateDescription vmstate_alpha_cpu;
-#endif
 
 void alpha_cpu_do_interrupt(CPUState *cpu);
 bool alpha_cpu_exec_interrupt(CPUState *cpu, int int_req);
+#endif /* !CONFIG_USER_ONLY */
 void alpha_cpu_dump_state(CPUState *cs, FILE *f, int flags);
 hwaddr alpha_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
 int alpha_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg);
diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c
index 4871ad0c0a6..93e16a2ffb4 100644
--- a/target/alpha/cpu.c
+++ b/target/alpha/cpu.c
@@ -218,10 +218,10 @@ static const struct SysemuCPUOps alpha_sysemu_ops = {
 
 static const struct TCGCPUOps alpha_tcg_ops = {
     .initialize = alpha_translate_init,
-    .cpu_exec_interrupt = alpha_cpu_exec_interrupt,
     .tlb_fill = alpha_cpu_tlb_fill,
 
 #ifndef CONFIG_USER_ONLY
+    .cpu_exec_interrupt = alpha_cpu_exec_interrupt,
     .do_interrupt = alpha_cpu_do_interrupt,
     .do_transaction_failed = alpha_cpu_do_transaction_failed,
     .do_unaligned_access = alpha_cpu_do_unaligned_access,
diff --git a/target/alpha/helper.c b/target/alpha/helper.c
index 4f56fe4d231..81550d9e2ff 100644
--- a/target/alpha/helper.c
+++ b/target/alpha/helper.c
@@ -293,7 +293,6 @@ bool alpha_cpu_tlb_fill(CPUState *cs, vaddr addr, int size,
                  prot, mmu_idx, TARGET_PAGE_SIZE);
     return true;
 }
-#endif /* USER_ONLY */
 
 void alpha_cpu_do_interrupt(CPUState *cs)
 {
@@ -348,7 +347,6 @@ void alpha_cpu_do_interrupt(CPUState *cs)
 
     cs->exception_index = -1;
 
-#if !defined(CONFIG_USER_ONLY)
     switch (i) {
     case EXCP_RESET:
         i = 0x0000;
@@ -404,7 +402,6 @@ void alpha_cpu_do_interrupt(CPUState *cs)
 
     /* Switch to PALmode.  */
     env->flags |= ENV_FLAG_PAL_MODE;
-#endif /* !USER_ONLY */
 }
 
 bool alpha_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
@@ -451,6 +448,8 @@ bool alpha_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
     return false;
 }
 
+#endif /* !CONFIG_USER_ONLY */
+
 void alpha_cpu_dump_state(CPUState *cs, FILE *f, int flags)
 {
     static const char linux_reg_names[31][4] = {
-- 
2.31.1



  parent reply	other threads:[~2021-09-05  0:02 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-04 23:55 [PATCH v2 00/24] accel/tcg: Restrict TCGCPUOps::cpu_exec_interrupt() to sysemu Philippe Mathieu-Daudé
2021-09-04 23:55 ` [PATCH v2 01/24] target/avr: Remove pointless use of CONFIG_USER_ONLY definition Philippe Mathieu-Daudé
2021-09-05  8:29   ` Richard Henderson
2021-09-05 14:24   ` Warner Losh
2021-09-04 23:55 ` [PATCH v2 02/24] target/i386: Restrict sysemu-only fpu_helper helpers Philippe Mathieu-Daudé
2021-09-04 23:55 ` [PATCH v2 03/24] target/i386: Simplify TARGET_X86_64 #ifdef'ry Philippe Mathieu-Daudé
2021-09-04 23:55 ` [PATCH v2 04/24] target/xtensa: Restrict do_transaction_failed() to sysemu Philippe Mathieu-Daudé
2021-09-04 23:55 ` [PATCH v2 05/24] accel/tcg: Rename user-mode do_interrupt hack as fake_user_interrupt Philippe Mathieu-Daudé
2021-09-04 23:55 ` Philippe Mathieu-Daudé [this message]
2021-09-04 23:55 ` [PATCH v2 07/24] target/arm: Restrict cpu_exec_interrupt() handler to sysemu Philippe Mathieu-Daudé
2021-09-04 23:55 ` [PATCH v2 08/24] target/cris: " Philippe Mathieu-Daudé
2021-09-04 23:55 ` [PATCH v2 09/24] target/hppa: " Philippe Mathieu-Daudé
2021-09-04 23:55 ` [PATCH v2 10/24] target/i386: " Philippe Mathieu-Daudé
2021-09-04 23:55 ` [PATCH v2 11/24] target/i386: Move x86_cpu_exec_interrupt() under sysemu/ folder Philippe Mathieu-Daudé
2021-09-05  8:35   ` Richard Henderson
2021-09-05 14:26   ` Warner Losh
2021-09-04 23:55 ` [PATCH v2 12/24] target/m68k: Restrict cpu_exec_interrupt() handler to sysemu Philippe Mathieu-Daudé
2021-09-04 23:55 ` [PATCH v2 13/24] target/microblaze: " Philippe Mathieu-Daudé
2021-09-04 23:55 ` [PATCH v2 14/24] target/mips: " Philippe Mathieu-Daudé
2021-09-04 23:55 ` [PATCH v2 15/24] target/nios2: " Philippe Mathieu-Daudé
2021-09-04 23:55 ` [PATCH v2 16/24] target/openrisc: " Philippe Mathieu-Daudé
2021-09-04 23:55 ` [PATCH v2 17/24] target/ppc: " Philippe Mathieu-Daudé
2021-09-04 23:55 ` [PATCH v2 18/24] target/riscv: " Philippe Mathieu-Daudé
2021-09-05 15:59   ` Bin Meng
2021-09-04 23:55 ` [PATCH v2 19/24] target/sh4: " Philippe Mathieu-Daudé
2021-09-04 23:55 ` [PATCH v2 20/24] target/sparc: " Philippe Mathieu-Daudé
2021-09-04 23:55 ` [PATCH v2 21/24] target/rx: " Philippe Mathieu-Daudé
2021-09-04 23:55 ` [PATCH v2 22/24] target/xtensa: " Philippe Mathieu-Daudé
2021-09-04 23:55 ` [PATCH v2 23/24] accel/tcg: Restrict TCGCPUOps::cpu_exec_interrupt() " Philippe Mathieu-Daudé
2021-09-04 23:55 ` [PATCH v2 24/24] user: Remove cpu_get_pic_interrupt() stubs 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=20210904235542.1092641-7-f4bug@amsat.org \
    --to=f4bug@amsat.org \
    --cc=imp@bsdimp.com \
    --cc=laurent@vivier.eu \
    --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 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).