qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2 05/15] target/ppc: Tidy exception vs exit_tb


From: Luis Pires
Subject: [PATCH v2 05/15] target/ppc: Tidy exception vs exit_tb
Date: Tue, 27 Apr 2021 14:16:39 -0300

From: Richard Henderson <richard.henderson@linaro.org>

We do not need to emit an exit_tb after an exception,
as the latter will exit via longjmp.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/ppc/translate.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/target/ppc/translate.c b/target/ppc/translate.c
index 46de2dab27..b18ad8ec2c 100644
--- a/target/ppc/translate.c
+++ b/target/ppc/translate.c
@@ -3744,8 +3744,9 @@ static void gen_lookup_and_goto_ptr(DisasContext *ctx)
         } else if (sse & (CPU_SINGLE_STEP | CPU_BRANCH_STEP)) {
             uint32_t excp = gen_prep_dbgex(ctx);
             gen_exception(ctx, excp);
+        } else {
+            tcg_gen_exit_tb(NULL, 0);
         }
-        tcg_gen_exit_tb(NULL, 0);
     } else {
         tcg_gen_lookup_and_goto_ptr();
     }
@@ -8101,9 +8102,10 @@ static void ppc_tr_tb_stop(DisasContextBase *dcbase, 
CPUState *cs)
     } else if (ctx->exception != POWERPC_EXCP_BRANCH) {
         if (unlikely(ctx->base.singlestep_enabled)) {
             gen_debug_exception(ctx);
+        } else {
+            /* Generate the return instruction */
+            tcg_gen_exit_tb(NULL, 0);
         }
-        /* Generate the return instruction */
-        tcg_gen_exit_tb(NULL, 0);
     }
 }
 
-- 
2.25.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]