All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>
To: qemu-devel@nongnu.org
Cc: "Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	qemu-ppc@nongnu.org, qemu-s390x@nongnu.org,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Pierrick Bouvier" <pierrick.bouvier@oss.qualcomm.com>,
	qemu-riscv@nongnu.org, qemu-arm@nongnu.org,
	"Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>
Subject: [PATCH v3 03/11] target/i386: Rename fake_do_interrupt to fake_user_exception
Date: Wed,  2 Sep 2026 17:20:34 +0200	[thread overview]
Message-ID: <20260902152044.31291-4-philmd@oss.qualcomm.com> (raw)
In-Reply-To: <20260902152044.31291-1-philmd@oss.qualcomm.com>

The fake_user_exception hook handles exceptions in the outer
exception loop (cpu_handle_exception), not inner loop interrupts
(cpu_handle_interrupt). Rename to clarify the scope and intent.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
 include/accel/tcg/cpu-ops.h       | 4 ++--
 target/i386/tcg/helper-tcg.h      | 4 +++-
 accel/tcg/cpu-exec.c              | 4 ++--
 target/i386/tcg/tcg-cpu.c         | 2 +-
 target/i386/tcg/user/seg_helper.c | 6 +++---
 5 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/include/accel/tcg/cpu-ops.h b/include/accel/tcg/cpu-ops.h
index 3ff6e6810e0..ded7cc700df 100644
--- a/include/accel/tcg/cpu-ops.h
+++ b/include/accel/tcg/cpu-ops.h
@@ -106,12 +106,12 @@ struct TCGCPUOps {
 
 #ifdef CONFIG_USER_ONLY
     /**
-     * @fake_user_interrupt: Callback for 'fake exception' handling.
+     * @fake_user_exception: Callback for 'fake exception' handling.
      *
      * Simulate 'fake exception' which will be handled outside the
      * cpu execution loop (hack for x86 user mode).
      */
-    void (*fake_user_interrupt)(CPUState *cpu);
+    void (*fake_user_exception)(CPUState *cpu);
 
     /**
      * record_sigsegv:
diff --git a/target/i386/tcg/helper-tcg.h b/target/i386/tcg/helper-tcg.h
index f4b2ff740d5..5349ab71be9 100644
--- a/target/i386/tcg/helper-tcg.h
+++ b/target/i386/tcg/helper-tcg.h
@@ -35,11 +35,13 @@
  * x86_cpu_do_interrupt:
  * @cpu: vCPU the interrupt is to be handled by.
  */
-void x86_cpu_do_interrupt(CPUState *cpu);
 #ifndef CONFIG_USER_ONLY
+void x86_cpu_do_interrupt(CPUState *cpu);
 bool x86_cpu_exec_halt(CPUState *cpu);
 bool x86_need_replay_interrupt(int interrupt_request);
 bool x86_cpu_exec_interrupt(CPUState *cpu, int int_req);
+#else
+void x86_cpu_fake_user_exception(CPUState *cs);
 #endif
 
 void breakpoint_handler(CPUState *cs);
diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
index 257211235db..609931a0d6e 100644
--- a/accel/tcg/cpu-exec.c
+++ b/accel/tcg/cpu-exec.c
@@ -717,8 +717,8 @@ static inline bool cpu_handle_exception(CPUState *cpu, int *ret)
      * handled outside the cpu execution loop.
      */
     const TCGCPUOps *tcg_ops = cpu->cc->tcg_ops;
-    if (tcg_ops->fake_user_interrupt) {
-        tcg_ops->fake_user_interrupt(cpu);
+    if (tcg_ops->fake_user_exception) {
+        tcg_ops->fake_user_exception(cpu);
     }
     *ret = cpu->exception_index;
     cpu->exception_index = -1;
diff --git a/target/i386/tcg/tcg-cpu.c b/target/i386/tcg/tcg-cpu.c
index 6f5dc06b3b9..7a4d73e7fee 100644
--- a/target/i386/tcg/tcg-cpu.c
+++ b/target/i386/tcg/tcg-cpu.c
@@ -173,7 +173,7 @@ const TCGCPUOps x86_tcg_ops = {
     .cpu_exec_enter = x86_cpu_exec_enter,
     .cpu_exec_exit = x86_cpu_exec_exit,
 #ifdef CONFIG_USER_ONLY
-    .fake_user_interrupt = x86_cpu_do_interrupt,
+    .fake_user_exception = x86_cpu_fake_user_exception,
     .record_sigsegv = x86_cpu_record_sigsegv,
     .record_sigbus = x86_cpu_record_sigbus,
 #else
diff --git a/target/i386/tcg/user/seg_helper.c b/target/i386/tcg/user/seg_helper.c
index 3a4a6d5a745..019a781458b 100644
--- a/target/i386/tcg/user/seg_helper.c
+++ b/target/i386/tcg/user/seg_helper.c
@@ -42,7 +42,7 @@ void helper_syscall(CPUX86State *env, int next_eip_addend)
  * instruction. It is only relevant if is_int is TRUE or if intno
  * is EXCP_SYSCALL.
  */
-static void do_interrupt_user(CPUX86State *env, int intno, int is_int,
+static void do_exception_user(CPUX86State *env, int intno, int is_int,
                               int error_code, target_ulong next_eip)
 {
     if (is_int) {
@@ -76,7 +76,7 @@ static void do_interrupt_user(CPUX86State *env, int intno, int is_int,
     }
 }
 
-void x86_cpu_do_interrupt(CPUState *cs)
+void x86_cpu_fake_user_exception(CPUState *cs)
 {
     X86CPU *cpu = X86_CPU(cs);
     CPUX86State *env = &cpu->env;
@@ -84,7 +84,7 @@ void x86_cpu_do_interrupt(CPUState *cs)
     /* if user mode only, we simulate a fake exception
        which will be handled outside the cpu execution
        loop */
-    do_interrupt_user(env, cs->exception_index,
+    do_exception_user(env, cs->exception_index,
                       env->exception_is_int,
                       env->error_code,
                       env->exception_next_eip);
-- 
2.53.0



  parent reply	other threads:[~2026-09-02 15:21 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-02 15:20 [PATCH v3 00/11] accel/tcg: Push BQL down into per-target do_interrupt handlers Philippe Mathieu-Daudé
2026-09-02 15:20 ` [PATCH v3 01/11] target/arm: Call arm*_cpu_do_interrupt directly instead of via TCGCPUOps Philippe Mathieu-Daudé
2026-09-02 19:52   ` Pierrick Bouvier
2026-09-08 16:09   ` Peter Maydell
2026-09-13  2:42   ` Richard Henderson
2026-09-02 15:20 ` Philippe Mathieu-Daudé [this message]
2026-09-13  2:44   ` [PATCH v3 03/11] target/i386: Rename fake_do_interrupt to fake_user_exception Richard Henderson
2026-09-02 15:20 ` [PATCH v3 04/11] accel/tcg: Document cpu_exec_interrupt() callback contract Philippe Mathieu-Daudé
2026-09-08 16:25   ` Peter Maydell
2026-09-02 15:20 ` [PATCH v3 05/11] accel/tcg: Document do_interrupt() " Philippe Mathieu-Daudé
2026-09-02 19:54   ` Pierrick Bouvier
2026-09-02 20:48     ` Philippe Mathieu-Daudé
2026-09-13  3:30   ` Richard Henderson
2026-09-02 15:20 ` [PATCH v3 06/11] accel/tcg: Rename do_interrupt() to do_interrupt_locked() Philippe Mathieu-Daudé
2026-09-13  3:31   ` Richard Henderson
2026-09-02 15:20 ` [PATCH v3 07/11] accel/tcg: Add do_interrupt() wrapper for targets to manage BQL Philippe Mathieu-Daudé
2026-09-13  3:50   ` Richard Henderson
2026-09-02 15:20 ` [PATCH v3 08/11] target/hexagon: Move to do_interrupt() (BQL acquired internally) Philippe Mathieu-Daudé
2026-09-03  0:15   ` Brian Cain
2026-09-13  3:55   ` Richard Henderson
2026-09-02 15:20 ` [RFC PATCH v3 09/11] targets: Move interrupt handlers to do_interrupt() Philippe Mathieu-Daudé
2026-09-13  4:00   ` Richard Henderson
2026-09-02 15:20 ` [RFC PATCH v3 10/11] targets: Move BQL locking into do_interrupt() handlers Philippe Mathieu-Daudé
2026-09-02 15:20 ` [PATCH v3 11/11] accel/tcg: Remove do_interrupt_locked() callback Philippe Mathieu-Daudé
2026-09-13  4:00   ` Richard Henderson
2026-09-02 15:33 ` [PATCH v3 00/11] accel/tcg: Push BQL down into per-target do_interrupt handlers Philippe Mathieu-Daudé
     [not found] ` <20260902152044.31291-3-philmd@oss.qualcomm.com>
2026-09-02 19:52   ` [PATCH v3 02/11] target/s390x: Restrict interrupt handlers to system mode Pierrick Bouvier
2026-09-13  2:43   ` 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=20260902152044.31291-4-philmd@oss.qualcomm.com \
    --to=philmd@oss.qualcomm.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=pierrick.bouvier@oss.qualcomm.com \
    --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=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.