From patchwork Fri Apr 30 01:15:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 429740 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp2111830jao; Thu, 29 Apr 2021 18:32:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtm4ghJZCCRXX7kDIw4TTJWLa7iG6mU7V6HXJX1j267oJVjonwp0vh19q9W+qz+yZOJnnx X-Received: by 2002:a05:6602:122a:: with SMTP id z10mr1941502iot.60.1619746337133; Thu, 29 Apr 2021 18:32:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619746337; cv=none; d=google.com; s=arc-20160816; b=gAQk+ULyWNM9fQwlF/JCSEvZlumoe85wI7JP++gEfxb+LLg71JAx3hYy4WO/ka3IMn 2JO8HZCM7phyETDTtpn3jvvwQ3pKCDbi7SS6RlMf2iOfTaX0bv9EnMnYfxaK+Lhgy0/h jy2CJkPNdPSwxYNcZmS0gJqbMkiSOhAbAxmuYEsDGvPG04nfLBPUkOCLLUiC+Vu6usju PlMpGCJe7RvyH8rH+U+GXEJuZP3NAEV7UsmQr0FqLz7kPP5342oS4e8zsMPKnEQVJtj3 H5irBglxqrBcZDlchNSsfqI356DnatcgQ8MmY/0LaZX91vloA3IB+KdEcYdJJbPawCN8 ZPkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=otPhcvbNJ17mxlPliTzuao80JoAxdfhn5Twl3YLl2dY=; b=IynofOiNKr1c47wgtpLm/a8RUt0CF1Fyix2cFuGHnHgQvpKZIQh/IaNX4AsII9PaDl C24uPszTqdoNi/wPKze2LomT3rYdBCPalu8SpY6FcD/18oqhs/HHiiemAtCIKGQelVQf 4c7sgMHi4teIKIZ72rm3RTAKB3RTY7SsTSXoNQEqOUIn5BB38L84h4b5PDhfV7iA0sFG bYtjVaOJOLmwYTDGhdETcun2LNzB2a0bu0dVDpvFa677dd9kPChewougYh9G4EJ5UWhh d0kFE+KGHQcsWBvIE3HfqG3/S1FvpCnsFdTbDFazLv3Jodhr2r/9mYQRUJ6nNo9IhfNU PCPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=d4p4Wqjg; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y15si464026ilv.72.2021.04.29.18.32.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 29 Apr 2021 18:32:17 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=d4p4Wqjg; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:41992 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lcI0u-00021B-GR for patch@linaro.org; Thu, 29 Apr 2021 21:32:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34108) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lcHlT-0003BL-46 for qemu-devel@nongnu.org; Thu, 29 Apr 2021 21:16:19 -0400 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]:41907) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lcHl7-0007YV-3a for qemu-devel@nongnu.org; Thu, 29 Apr 2021 21:16:18 -0400 Received: by mail-pj1-x102a.google.com with SMTP id y22-20020a17090a8b16b0290150ae1a6d2bso912702pjn.0 for ; Thu, 29 Apr 2021 18:15:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=otPhcvbNJ17mxlPliTzuao80JoAxdfhn5Twl3YLl2dY=; b=d4p4Wqjgb26lk8uPtCQSMef/IKxLF+wPfemCHxHoNEqkLwwBRMoEslZHE1YJf1iDZI NJ2ypzKS4i6Xz/eDxIIusdfSJ11LXbRGkimaVTgtIbxHZl0E+cfPjKTb0xgdteWEHFDy w2UcBcuuUmQ/rb5xgH3VR8A5eFxA2gGJOUxuo0HezMk9detdJwRAO7qao+Ckd8NKT0ZS a+stD+jTzsV5WbF+e1CmjMAxR2x83rctMfnxnN62hsRVSP2jdaz540SroNuBTIi3c8SP Y5Tsx3TcQ791JKr/87vMYKAMfqotgX4vryJ3j8vHpOzh6/F6hLmVzy9Pt+hU2+9BYCBY Yx2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=otPhcvbNJ17mxlPliTzuao80JoAxdfhn5Twl3YLl2dY=; b=iiOqxwzLwfXzp365s/C7yOWWFCVbkBVnez9Q8KsKzaLO0DOVOQDlmkNTYQa0KNZTwg pKSpR3BBJ94U2m9qhTIEykfz0v+dmMF/nppRq4eiz5CS3O+DWo3lxmwguWRvk/Vxrpt2 VkLH7ixLRka4Mx6zIuIBdrSftuy+AbsMYOfaAHQSNulTL/R75LVjQUBeR5Iygf2iO/Kl acsatP0w9t2/QKtS0VuC1WmKFTFQb7apRCjdOEA038kaF2jJEh71jo93L8TiZ4D9XOBC 5GjUA6KonafN0bsYNHlYUcV+S8BKleh04HP1pxQCageyYLTuEpp/BK5rQY/N2i2HhcoF goUA== X-Gm-Message-State: AOAM532uJZnnSIhCv/eTOuHKUgnEGBH/aTaUDHzK3TVOoZlxNrqYFF5J NANCUneWXVPyk5ZFNOkKgsYQiAQRV4R/JA== X-Received: by 2002:a17:902:4d:b029:ec:94df:c9aa with SMTP id 71-20020a170902004db02900ec94dfc9aamr2779364pla.7.1619745355265; Thu, 29 Apr 2021 18:15:55 -0700 (PDT) Received: from localhost.localdomain ([71.212.144.24]) by smtp.gmail.com with ESMTPSA id 1sm161277pjx.46.2021.04.29.18.15.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Apr 2021 18:15:55 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 16/30] target/ppc: Replace POWERPC_EXCP_BRANCH with DISAS_NORETURN Date: Thu, 29 Apr 2021 18:15:29 -0700 Message-Id: <20210430011543.1017113-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210430011543.1017113-1-richard.henderson@linaro.org> References: <20210430011543.1017113-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102a; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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: f4bug@amsat.org, luis.pires@eldorado.org.br, qemu-ppc@nongnu.org, lagarcia@br.ibm.com, bruno.larsen@eldorado.org.br, matheus.ferst@eldorado.org.br, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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 --- target/ppc/cpu.h | 2 -- linux-user/ppc/cpu_loop.c | 3 --- target/ppc/translate.c | 8 ++------ 3 files changed, 2 insertions(+), 11 deletions(-) -- 2.25.1 diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index 9bb370abba..5b22eb64dc 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -131,8 +131,6 @@ enum { POWERPC_EXCP_SYSCALL_VECTORED = 102, /* scv exception */ /* EOL */ POWERPC_EXCP_NB = 103, - /* QEMU exceptions: used internally during code translation */ - POWERPC_EXCP_BRANCH = 0x201, /* branch instruction */ /* QEMU exceptions: special cases we want to stop translation */ POWERPC_EXCP_SYSCALL_USER = 0x203, /* System call in user mode only */ }; diff --git a/linux-user/ppc/cpu_loop.c b/linux-user/ppc/cpu_loop.c index 4c308835bd..adf5a8a4e6 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/translate.c b/target/ppc/translate.c index 82fdf0bb77..276a4a2a79 100644 --- a/target/ppc/translate.c +++ b/target/ppc/translate.c @@ -3769,7 +3769,6 @@ static void gen_b(DisasContext *ctx) { target_ulong li, target; - ctx->exception = POWERPC_EXCP_BRANCH; /* sign extend LI */ li = LI(ctx->opcode); li = (li ^ 0x02000000) - 0x02000000; @@ -3783,6 +3782,7 @@ static void gen_b(DisasContext *ctx) } gen_update_cfar(ctx, ctx->cia); gen_goto_tb(ctx, 0, target); + ctx->base.is_jmp = DISAS_NORETURN; } #define BCOND_IM 0 @@ -3795,7 +3795,6 @@ static void gen_bcond(DisasContext *ctx, int type) uint32_t bo = BO(ctx->opcode); TCGLabel *l1; TCGv target; - ctx->exception = POWERPC_EXCP_BRANCH; if (type == BCOND_LR || type == BCOND_CTR || type == BCOND_TAR) { target = tcg_temp_local_new(); @@ -3902,6 +3901,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 = DISAS_NORETURN; } static void gen_bc(DisasContext *ctx) @@ -8057,7 +8057,6 @@ static void ppc_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) /* Check trace mode exceptions */ if (unlikely(ctx->singlestep_enabled & CPU_SINGLE_STEP && (ctx->base.pc_next <= 0x100 || ctx->base.pc_next > 0xF00) && - ctx->exception != POWERPC_EXCP_BRANCH && ctx->base.is_jmp != DISAS_NORETURN)) { uint32_t excp = gen_prep_dbgex(ctx); gen_exception_nip(ctx, excp, ctx->base.pc_next); @@ -8073,9 +8072,6 @@ static void ppc_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) switch (ctx->exception) { case POWERPC_EXCP_NONE: break; - case POWERPC_EXCP_BRANCH: - ctx->base.is_jmp = DISAS_NORETURN; - break; default: /* Every other ctx->exception should have set NORETURN. */ g_assert_not_reached();