From patchwork Mon Sep 7 17:50:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 249248 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp3883711ilg; Mon, 7 Sep 2020 10:55:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmzGmYcK64uYRiGYkEmhGPDl471/yNzzYqWXrTKw4IvexDbUAG8egpyhh1l0hB2ezf8hpj X-Received: by 2002:a25:8512:: with SMTP id w18mr4267432ybk.432.1599501349657; Mon, 07 Sep 2020 10:55:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599501349; cv=none; d=google.com; s=arc-20160816; b=oO+kX3jMyqDcJdIb0CRkXwLfB6u256FNRPlAIAurtLitZhjHXvFwsOh5d3sHL4F694 pydMTXE8i6uLYWzWrNKnhE1Nb9v6vXG8ogXzhIhSGEALd+DPFGrKsiizWbhzyjY3DMqM vsG2E+h1s8M8985iQtbfQzdMkjeZ677x+6AUcxcjzxWxcYnYv0ZauarKl2M2p1kuXrjz KpQpo5B1QvGQVoRggkL6gYMkM4IrqZm4GYx33HLgyJjU6fIkFcidUzkNs4P0o/aqmy5d SYxIJkv1DHK+yfZcdyyAVAWSAsb9fWSpyFAb+PFw5QmiHXS5OjMLa8nyN0lObL8NPlE0 JWUw== 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=qxvKwmePa50MKIg8eLv8VBXTLXGDs/q8gqEzTKISHeQ=; b=x/KF7Kkzm9ljwm/9tMBiAJwEp2jRPtUtssxWDZJMHQ4IB3S/TewnjSWBX381dzUVog UCdeGy51u89hPjVUGRJqLDCmBD9xdz9oosSHkkFxYwawdY6L451zH1B4EyJm20AUwMxP 8FkfsiTniImf4air+Rrx7zm8Wz6bxMZ+j++oahjbTZIcCugoljMJmgi4DjFD5tfAIJPE fh82+kc2lj+7A0FGOp8nC53h+Y0yG2p8NIG8MeSt+GtXt/8TKmSVZBx5D6QuVSkwFB5Y q2iyGe5FT/0ivEYUsDoeo5dYwzliZNke0VdvLlh1mTgbL5TM4GLlD/03tAMdOASdFqoH nF7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=BH0RYrek; 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 x128si2439061ybx.407.2020.09.07.10.55.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 07 Sep 2020 10:55:49 -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=BH0RYrek; 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]:33474 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kFLMr-0006Ow-3n for patch@linaro.org; Mon, 07 Sep 2020 13:55:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35698) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kFLIS-0004tt-HT for qemu-devel@nongnu.org; Mon, 07 Sep 2020 13:51:16 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]:40042) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kFLIQ-0000lK-MM for qemu-devel@nongnu.org; Mon, 07 Sep 2020 13:51:16 -0400 Received: by mail-pf1-x42e.google.com with SMTP id c142so8933537pfb.7 for ; Mon, 07 Sep 2020 10:51:14 -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=qxvKwmePa50MKIg8eLv8VBXTLXGDs/q8gqEzTKISHeQ=; b=BH0RYrek4GEPFXrTFgIyrJ4XsZQdSHl2fA7vTiIbZqNoCwTotKOOhFzLbhtMM8F1KT K43+3mzn/0FcXzKF7aoqm4HBg8X0nkVsrPhIORY0ynjhWbuc2+t3XQrsocnkVSoNphb+ 1fVuug2xEyFEo265sb/0PWcZ2ZUiUqbWYGPdX4F6m3ocOEocdZE0xr7JgKIRdCAoILBx WmoJoxcuzuKIsbLqrTiaIJvwrTIXt2Eqb0mwrm0RCEkwsTHRUT7E8GOKlKMmNEtp+48L V5agDAp1vAZqpGLZGrEonCeLzoU7zOyU/sKY0CFBX0rbixVb/NVXxTc3M4698jCzUHPo 18xA== 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=qxvKwmePa50MKIg8eLv8VBXTLXGDs/q8gqEzTKISHeQ=; b=CCji7tNj/Th43pJ038oT7NgJBNnuzRq04GjZy5Tek9eYbDwGMnXRwi4FVRGf9PMrKz j/xRT4sTRTtd1HloWOxd4T6PbMGBVSGpxvXUv4KmU3e3YvVJQbanXRK+0aCUWgujsjOY /ARnUIAhdJ/nKr8ZC+UOe9L1uKRQHgFrbryCpoWbxlRoinKlOQ395xSRBFpVHWfg1409 66/OIU7DREZnLAJsoSNGDaOqJ4sG3/r3plwQnnmJN83ncGXptnlKYTqdPKyfmZW5Og7k oD2CKGqQ8TLidJQvYzu2UIPNePnTusJEisLrfTkrEzV1Dg2EKYf0ARli6XFdCTHZMBCN /5vg== X-Gm-Message-State: AOAM531/PDUNSjcri8m4MNoOzGkGAxhIO9YlrdIh7vq10ODOnu1Fnyls 92z8HUjoK4wflQYfxEDKqQgNPJ+djd2RJw== X-Received: by 2002:aa7:864c:0:b029:13c:1611:6591 with SMTP id a12-20020aa7864c0000b029013c16116591mr19152951pfo.14.1599501072903; Mon, 07 Sep 2020 10:51:12 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id ga3sm1651496pjb.18.2020.09.07.10.51.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Sep 2020 10:51:12 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 06/19] target/microblaze: Introduce DISAS_EXIT_NEXT, DISAS_EXIT_JUMP Date: Mon, 7 Sep 2020 10:50:49 -0700 Message-Id: <20200907175102.28027-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200907175102.28027-1-richard.henderson@linaro.org> References: <20200907175102.28027-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42e.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=ham 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: "Edgar E . Iglesias" , peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Like DISAS_EXIT, except we need to update cpu_pc, either to pc_next or to btarget respectively. Reviewed-by: Edgar E. Iglesias Tested-by: Edgar E. Iglesias Signed-off-by: Richard Henderson --- target/microblaze/translate.c | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) -- 2.25.1 diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index 8ceb04f4f0..2abef328a3 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -39,6 +39,11 @@ #define DISAS_JUMP DISAS_TARGET_0 /* only pc was modified dynamically */ #define DISAS_EXIT DISAS_TARGET_1 /* all cpu state modified dynamically */ +/* cpu state besides pc was modified dynamically; update pc to next */ +#define DISAS_EXIT_NEXT DISAS_TARGET_2 +/* cpu state besides pc was modified dynamically; update pc to btarget */ +#define DISAS_EXIT_JUMP DISAS_TARGET_3 + static TCGv_i32 cpu_R[32]; static TCGv_i32 cpu_pc; static TCGv_i32 cpu_msr; @@ -1712,8 +1717,7 @@ static void mb_tr_translate_insn(DisasContextBase *dcb, CPUState *cs) /* Force an exit if the per-tb cpu state has changed. */ if (dc->base.is_jmp == DISAS_NEXT && dc->cpustate_changed) { - dc->base.is_jmp = DISAS_EXIT; - tcg_gen_movi_i32(cpu_pc, dc->base.pc_next); + dc->base.is_jmp = DISAS_EXIT_NEXT; } } @@ -1734,12 +1738,14 @@ static void mb_tr_tb_stop(DisasContextBase *dcb, CPUState *cs) return; case DISAS_EXIT: - if (unlikely(cs->singlestep_enabled)) { - gen_raise_exception(dc, EXCP_DEBUG); - } else { - tcg_gen_exit_tb(NULL, 0); - } - return; + break; + case DISAS_EXIT_NEXT: + tcg_gen_movi_i32(cpu_pc, dc->base.pc_next); + break; + case DISAS_EXIT_JUMP: + tcg_gen_mov_i32(cpu_pc, cpu_btarget); + tcg_gen_discard_i32(cpu_btarget); + break; case DISAS_JUMP: if (dc->jmp_dest != -1 && !cs->singlestep_enabled) { @@ -1781,6 +1787,13 @@ static void mb_tr_tb_stop(DisasContextBase *dcb, CPUState *cs) default: g_assert_not_reached(); } + + /* Finish DISAS_EXIT_* */ + if (unlikely(cs->singlestep_enabled)) { + gen_raise_exception(dc, EXCP_DEBUG); + } else { + tcg_gen_exit_tb(NULL, 0); + } } static void mb_tr_disas_log(const DisasContextBase *dcb, CPUState *cs)