From nobody Mon Feb 9 23:40:45 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=1621430174; cv=none; d=zohomail.com; s=zohoarc; b=BlppAeac+BCq4qtbBFYJVJVU36CLfiREyvhvuYlHOH72/0Lb1Nv36FnvcfuET9V9FIjvSyafsJlaQMMdBDtgbr4BVqnPHNcO0Ap2rJ6zvsjk5pEs3UUibs6hrEJrAYzCDupRMhqYDAFwU6PuDA4mzUOqpqAi6QTcTpZru3mg4K8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621430174; 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=c0p4DhRZtz+a5UdROJI3U/2g+YjfxeG+9LHjSl7lLVg=; b=Z4ElT50S6UTXqIVidCyxET/TM0s4OTmYIMnExhzjxm989/P2zcrJytZr2bs3Pjtk7xzHeZ90Mx+xiAp94cxiJiyvApMXJaPBx/ExpOcRHq/2Vc+f5nK7+OMAU2K+r2SfjSPGHQ+nuWggYJGKfGifaBLuHRqitkqVIXEIqvTT2ag= 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 162143017451227.74067447286518; Wed, 19 May 2021 06:16:14 -0700 (PDT) Received: from localhost ([::1]:39002 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljM3Z-0005oK-QH for importer@patchew.org; Wed, 19 May 2021 09:16:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33492) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljLhK-0001Sx-ER; Wed, 19 May 2021 08:53:14 -0400 Received: from ozlabs.org ([203.11.71.1]:40323) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljLhG-0001KE-9n; Wed, 19 May 2021 08:53:14 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 4FlXnj3p2qz9t1s; Wed, 19 May 2021 22:52:09 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1621428729; bh=qRid1Fy5HDgT9EYdy78EWqjRUnTiqZ12oEqK++StO+w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ifks3c3hnNxROxwDT+YfBibpS+fW8Z++/9BIDj68ZZS+WAc0eSvYNZkVlort+u2FU Tj5+ZLCMxSFopJtPRaOATDCIG5ErelyYMQ0bLiAKMUffO3alN+3jU3ygpHYxE42pnB i4q0/9fyibd73wKxHAVmD1vVeustRf2/oMuCgt+c= From: David Gibson To: peter.maydell@linaro.org, groug@kaod.org Subject: [PULL 27/48] target/ppc: Replace POWERPC_EXCP_BRANCH with DISAS_NORETURN Date: Wed, 19 May 2021 22:51:27 +1000 Message-Id: <20210519125148.27720-28-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=203.11.71.1; 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, David Gibson , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Matheus Ferst 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 The translation of branch instructions always results in exit from the TB. Remove the synthetic "exception" after no more uses. Signed-off-by: Richard Henderson Signed-off-by: Matheus Ferst Message-Id: <20210517205025.3777947-4-matheus.ferst@eldorado.org.br> Signed-off-by: David Gibson --- linux-user/ppc/cpu_loop.c | 3 --- target/ppc/cpu.h | 2 -- target/ppc/translate.c | 8 ++------ 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/linux-user/ppc/cpu_loop.c b/linux-user/ppc/cpu_loop.c index fe526693d2..fa91ea0eed 100644 --- a/linux-user/ppc/cpu_loop.c +++ b/linux-user/ppc/cpu_loop.c @@ -423,9 +423,6 @@ void cpu_loop(CPUPPCState *env) cpu_abort(cs, "Maintenance exception while in user mode. " "Aborting\n"); break; - case POWERPC_EXCP_BRANCH: /* branch instruction: = */ - /* We just stopped because of a branch. Go on */ - break; case POWERPC_EXCP_SYSCALL_USER: /* system call in user-mode emulation */ /* WARNING: diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index 9e38df685d..cab33a3680 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -131,8 +131,6 @@ enum { POWERPC_EXCP_SYSCALL_VECTORED =3D 102, /* scv exception = */ /* EOL = */ POWERPC_EXCP_NB =3D 103, - /* QEMU exceptions: used internally during code translation = */ - POWERPC_EXCP_BRANCH =3D 0x201, /* branch instruction = */ /* QEMU exceptions: special cases we want to stop translation = */ POWERPC_EXCP_SYSCALL_USER =3D 0x203, /* System call in user mode only = */ }; diff --git a/target/ppc/translate.c b/target/ppc/translate.c index f57b67be5f..d019454550 100644 --- a/target/ppc/translate.c +++ b/target/ppc/translate.c @@ -4692,7 +4692,6 @@ static void gen_b(DisasContext *ctx) { target_ulong li, target; =20 - ctx->exception =3D POWERPC_EXCP_BRANCH; /* sign extend LI */ li =3D LI(ctx->opcode); li =3D (li ^ 0x02000000) - 0x02000000; @@ -4706,6 +4705,7 @@ static void gen_b(DisasContext *ctx) } gen_update_cfar(ctx, ctx->cia); gen_goto_tb(ctx, 0, target); + ctx->base.is_jmp =3D DISAS_NORETURN; } =20 #define BCOND_IM 0 @@ -4718,7 +4718,6 @@ static void gen_bcond(DisasContext *ctx, int type) uint32_t bo =3D BO(ctx->opcode); TCGLabel *l1; TCGv target; - ctx->exception =3D POWERPC_EXCP_BRANCH; =20 if (type =3D=3D BCOND_LR || type =3D=3D BCOND_CTR || type =3D=3D BCOND= _TAR) { target =3D tcg_temp_local_new(); @@ -4825,6 +4824,7 @@ static void gen_bcond(DisasContext *ctx, int type) gen_set_label(l1); gen_goto_tb(ctx, 1, ctx->base.pc_next); } + ctx->base.is_jmp =3D DISAS_NORETURN; } =20 static void gen_bc(DisasContext *ctx) @@ -9102,7 +9102,6 @@ static void ppc_tr_translate_insn(DisasContextBase *d= cbase, CPUState *cs) /* 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_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); @@ -9118,9 +9117,6 @@ static void ppc_tr_translate_insn(DisasContextBase *d= cbase, CPUState *cs) switch (ctx->exception) { case POWERPC_EXCP_NONE: break; - case POWERPC_EXCP_BRANCH: - ctx->base.is_jmp =3D DISAS_NORETURN; - break; default: /* Every other ctx->exception should have set NORETURN. */ g_assert_not_reached(); --=20 2.31.1