From nobody Mon Feb 9 23:18:16 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1621429974; cv=none; d=zohomail.com; s=zohoarc; b=BJeovKu7GD7k2Yu7IvFKBPzTCAvUXJL1zZKghQKiiEdCz5d+tRSF55xmBdtJ/7zRTBqTRuZMmy/ssUBGY50eCc1LXaaSz4tl9W2KIdMG4mWivnZDqZLHGXm3C0pHzS//9pVamJJPa14jj+4G3wzjsfRe8jzdXwLaHG9bB98sbVc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621429974; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=wzclvABPdWRClsn9nAXiEBmCC4Vcz1c4vBNkNXuD5w0=; b=HJQlnKHsUasB/4/6LyH51GvURCLSEnLSrp6Qwa+Ula5RqxWXxAVWz2sxVqysY9PHb2k99C8Tliu7yIL9X7ECg+4d2zOBMLlQiTORZ1+NMhMHpyq9FzlCBrj2ZneYSwzgNimf54AK74z5UtjTBp+bzLHidRQeuLldt6QPO1P1lsY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621429974556121.17565996271753; Wed, 19 May 2021 06:12:54 -0700 (PDT) Received: from localhost ([::1]:57586 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljM0L-0007nK-Gf for importer@patchew.org; Wed, 19 May 2021 09:12:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33276) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljLgt-0000tQ-EK; Wed, 19 May 2021 08:52:47 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:33637) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljLgl-0001Fh-S6; Wed, 19 May 2021 08:52:42 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 4FlXnd65Rnz9t0T; Wed, 19 May 2021 22:52:05 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1621428725; bh=YepioIO6fM+22aWQNVJNN/CrWq02C6DWs1hzecs1a84=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gqpRfAV2JQ1LBZCCvgl9BFAj8BM/+Zbc6k1/IAWVzOvvSduQQna1hlEBjxanlHuxO Qm/PO4C/6yYrVT8p/tUvZdGq1MwgP5DrOgtHSFUlE5/VS9zMAl48HlUuTUa+BVIAWd GW4MinpqwFf/cnaGot7yXVlTzLb4e5a+2PeV04HA= From: David Gibson To: peter.maydell@linaro.org, groug@kaod.org Subject: [PULL 18/48] target/ppc: Move DISAS_NORETURN setting into gen_exception* Date: Wed, 19 May 2021 22:51:18 +1000 Message-Id: <20210519125148.27720-19-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210519125148.27720-1-david@gibson.dropbear.id.au> References: <20210519125148.27720-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2401:3900:2:1::2; envelope-from=dgibson@ozlabs.org; helo=ozlabs.org X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: richard.henderson@linaro.org, qemu-devel@nongnu.org, Luis Pires , qemu-ppc@nongnu.org, Matheus Ferst , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Richard Henderson There are other valid settings for is_jmp besides DISAS_NEXT and DISAS_NORETURN, so eliminating that dichotomy from ppc_tr_translate_insn is helpful. Signed-off-by: Richard Henderson Reviewed-by: Luis Pires Signed-off-by: Matheus Ferst Message-Id: <20210512185441.3619828-4-matheus.ferst@eldorado.org.br> Signed-off-by: David Gibson --- target/ppc/translate.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/target/ppc/translate.c b/target/ppc/translate.c index d6a8a04380..ac0c0e5b2c 100644 --- a/target/ppc/translate.c +++ b/target/ppc/translate.c @@ -264,7 +264,8 @@ static void gen_exception_err(DisasContext *ctx, uint32= _t excp, uint32_t error) gen_helper_raise_exception_err(cpu_env, t0, t1); tcg_temp_free_i32(t0); tcg_temp_free_i32(t1); - ctx->exception =3D (excp); + ctx->exception =3D excp; + ctx->base.is_jmp =3D DISAS_NORETURN; } =20 static void gen_exception(DisasContext *ctx, uint32_t excp) @@ -281,7 +282,8 @@ static void gen_exception(DisasContext *ctx, uint32_t e= xcp) t0 =3D tcg_const_i32(excp); gen_helper_raise_exception(cpu_env, t0); tcg_temp_free_i32(t0); - ctx->exception =3D (excp); + ctx->exception =3D excp; + ctx->base.is_jmp =3D DISAS_NORETURN; } =20 static void gen_exception_nip(DisasContext *ctx, uint32_t excp, @@ -293,7 +295,8 @@ static void gen_exception_nip(DisasContext *ctx, uint32= _t excp, t0 =3D tcg_const_i32(excp); gen_helper_raise_exception(cpu_env, t0); tcg_temp_free_i32(t0); - ctx->exception =3D (excp); + ctx->exception =3D excp; + ctx->base.is_jmp =3D DISAS_NORETURN; } =20 /* @@ -339,6 +342,7 @@ static void gen_debug_exception(DisasContext *ctx) t0 =3D tcg_const_i32(EXCP_DEBUG); gen_helper_raise_exception(cpu_env, t0); tcg_temp_free_i32(t0); + ctx->base.is_jmp =3D DISAS_NORETURN; } =20 static inline void gen_inval_exception(DisasContext *ctx, uint32_t error) @@ -9183,7 +9187,6 @@ static bool ppc_tr_breakpoint_check(DisasContextBase = *dcbase, CPUState *cs, DisasContext *ctx =3D container_of(dcbase, DisasContext, base); =20 gen_debug_exception(ctx); - dcbase->is_jmp =3D DISAS_NORETURN; /* * The address covered by the breakpoint must be included in * [tb->pc, tb->pc + tb->size) in order to for it to be properly @@ -9213,18 +9216,19 @@ static void ppc_tr_translate_insn(DisasContextBase = *dcbase, CPUState *cs) ok =3D decode_legacy(cpu, ctx, insn); if (!ok) { gen_invalid(ctx); - ctx->base.is_jmp =3D DISAS_NORETURN; } =20 #if defined(DO_PPC_STATISTICS) handler->count++; #endif + /* Check trace mode exceptions */ if (unlikely(ctx->singlestep_enabled & CPU_SINGLE_STEP && (ctx->base.pc_next <=3D 0x100 || ctx->base.pc_next > 0xF0= 0) && ctx->exception !=3D POWERPC_SYSCALL && ctx->exception !=3D POWERPC_EXCP_TRAP && - ctx->exception !=3D POWERPC_EXCP_BRANCH)) { + ctx->exception !=3D POWERPC_EXCP_BRANCH && + ctx->base.is_jmp !=3D DISAS_NORETURN)) { uint32_t excp =3D gen_prep_dbgex(ctx); gen_exception_nip(ctx, excp, ctx->base.pc_next); } @@ -9235,14 +9239,20 @@ static void ppc_tr_translate_insn(DisasContextBase = *dcbase, CPUState *cs) opc3(ctx->opcode), opc4(ctx->opcode), ctx->opcode); } =20 - ctx->base.is_jmp =3D ctx->exception =3D=3D POWERPC_EXCP_NONE ? - DISAS_NEXT : DISAS_NORETURN; + if (ctx->base.is_jmp =3D=3D DISAS_NEXT + && ctx->exception !=3D POWERPC_EXCP_NONE) { + ctx->base.is_jmp =3D DISAS_TOO_MANY; + } } =20 static void ppc_tr_tb_stop(DisasContextBase *dcbase, CPUState *cs) { DisasContext *ctx =3D container_of(dcbase, DisasContext, base); =20 + if (ctx->base.is_jmp =3D=3D DISAS_NORETURN) { + return; + } + if (ctx->exception =3D=3D POWERPC_EXCP_NONE) { gen_goto_tb(ctx, 0, ctx->base.pc_next); } else if (ctx->exception !=3D POWERPC_EXCP_BRANCH) { --=20 2.31.1