diff mbox series

[01/10] accel/tcg: Generalize fake_user_interrupt test

Message ID 20250428201028.1699157-2-richard.henderson@linaro.org
State New
Headers show
Series accel/tcg: Compile cpu-exec.c twice | expand

Commit Message

Richard Henderson April 28, 2025, 8:10 p.m. UTC
Test for the hook being present instead of ifdef TARGET_I386.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 accel/tcg/cpu-exec.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Pierrick Bouvier April 28, 2025, 9:36 p.m. UTC | #1
On 4/28/25 1:10 PM, Richard Henderson wrote:
> Test for the hook being present instead of ifdef TARGET_I386.
> 
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   accel/tcg/cpu-exec.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Philippe Mathieu-Daudé April 29, 2025, 6:45 a.m. UTC | #2
On 28/4/25 22:10, Richard Henderson wrote:
> Test for the hook being present instead of ifdef TARGET_I386.
> 
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   accel/tcg/cpu-exec.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
diff mbox series

Patch

diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
index 279df5fae7..8ff4a34509 100644
--- a/accel/tcg/cpu-exec.c
+++ b/accel/tcg/cpu-exec.c
@@ -732,10 +732,10 @@  static inline bool cpu_handle_exception(CPUState *cpu, int *ret)
      * If user mode only, we simulate a fake exception which will be
      * handled outside the cpu execution loop.
      */
-#if defined(TARGET_I386)
     const TCGCPUOps *tcg_ops = cpu->cc->tcg_ops;
-    tcg_ops->fake_user_interrupt(cpu);
-#endif /* TARGET_I386 */
+    if (tcg_ops->fake_user_interrupt) {
+        tcg_ops->fake_user_interrupt(cpu);
+    }
     *ret = cpu->exception_index;
     cpu->exception_index = -1;
     return true;