From patchwork Sat Oct 16 18:15:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515887 Delivered-To: patch@linaro.org Received: by 2002:ac0:cd8c:0:0:0:0:0 with SMTP id d12csp137234imp; Sat, 16 Oct 2021 11:27:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7VdCvqx6bLFuuZJkKDK3ozMgPkIMB1dtj8WFEtWWu21HZuZlEcooyQlp6a3RobuIg7GnQ X-Received: by 2002:a25:e790:: with SMTP id e138mr2562286ybh.62.1634408865802; Sat, 16 Oct 2021 11:27:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634408865; cv=none; d=google.com; s=arc-20160816; b=Ti4biKuf9KIPwWCLI8er1CkiQXzOHFxdMm0stSPmhm3sy/txU1Zo/0iiaSOqay3M55 JbyNlZMNTUwnDE515VTIPeJfp+g9zWFkHWStPG2cZRgPWBYauyKTmbaFhGtNnP0W/yAM CpVH5WohiT0IFDUlrxI+YS9m7auWkMlIDbntrC0/fd999I4MVClnuQzR9Zg9OcVNIolf M+VmqayFc1Nz77ob0qZj1oDhRhViXpZJPKXpV9cTOWRZSYR4e3v/l9cov8yTRYjcJiN4 5WS5tNX0B6YJgHulBxC7PdkJEEkEJofVcTOXUG7zIGBbKWQ/yvkF21C3F+lf1KBVtnNS KdvA== 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=RZhqGge9vu+6Bc5Ne+L+64OR4mcrgGsrXPqV5KkLFEY=; b=DYQFv6ZYg9PubNbuvGwISh/h+CkqdE8ccRCj9NBGnJ5NebzsyJpq0hGte1rNZ44ZZ+ HYa1YbDSRMWNdLuIzgtXnxcwCsmwb/Wn8Vy6R+I++skDw8xRrZVxE8l8evaBLWMPye7w 6U2hV9V094W/kaXFbx4xs+Fflr1FDnKmsgSw3d9ByBSij7j4d0tsfBwBhKIQr08O1S0B hfeH4hXTDboaCzNRMHTq8kQb6M7JVaAbBjvPJ5cKqHIQ5tVYneKhyMoNvWJVnox6+E1O /dJhTm/+2jYImQ6S1jUeLhQLuP6An5YC3MwIf31gdyXqo7e8Xhh8WtzCVjr3D85f1LAH E34A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vky+mf1F; 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=pass (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 c81si2681318ybb.185.2021.10.16.11.27.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 16 Oct 2021 11:27:45 -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=pass header.i=@linaro.org header.s=google header.b=vky+mf1F; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:48148 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboPJ-0000bR-9g for patch@linaro.org; Sat, 16 Oct 2021 14:27:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41030) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mboDY-0008Mj-84 for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:36 -0400 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]:51173) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mboDT-00021P-2M for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:35 -0400 Received: by mail-pj1-x102b.google.com with SMTP id gn3so3948090pjb.0 for ; Sat, 16 Oct 2021 11:15:30 -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=RZhqGge9vu+6Bc5Ne+L+64OR4mcrgGsrXPqV5KkLFEY=; b=vky+mf1FtvxY4hcoYLpbmdxa1aTtkkFm3S3HhlXb8AuJp0TwkFnkNuwYVn2vRbRIgV BssUWDPywYAjRhssP/yTpF8HUdWMxq+6xcsa5FDOmqPA08nUTfHSvyVuGNH0IfUjVZHD 5cdXZchOHLWhKh6GFN7UpbFTaaHOsNEUv70wIMhcurCoqGZGvqL5MjQN0T+YWm9RSGAU 5aTlpTOs34v0zAx8DRppZpb47O/qtR+X71reYh80XwFGs6+T5f8jgHABNhJB+oBPuSzg S9u377ikiKed1aP61zC7DHQZKzBXebW8yA2pzfAahydS4/BYALC0hxd97YAgVyKTn2w4 JaRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RZhqGge9vu+6Bc5Ne+L+64OR4mcrgGsrXPqV5KkLFEY=; b=vveMuqtTgtQ12UU/oQA2gd1vaF6gPFXCcOUNOHF/uj5CN/HQXg/u5/wHQiiI2TUac1 Ar9MZ/VZDxzZZrUzVTyy9pPf1K6sbLpSHM0UAAYQz4ZZNouLdkMjRoC50TTn4MNRStpk i/CIBHoipedKaco9aJY2L4QyzgjA37r8/ci/AhZbdjIytFMdn3awLJWMvoi2QrN1M/tf Ag9y0H/LWIGiSsL440K3r05nJU6/qlqYNPnHbuO/TXzZY9ohyD1pHcMT1koLrMbajjTC biDFejjDpasmiF55hznt0KT4tkoViQJTCdx5yF9pZa/v6JrJhKzOHi8uyX3eDmZpHD8O 9TIA== X-Gm-Message-State: AOAM532BRsUzaAt9ltw94EP+ePCHK4nmrodlx6hXnFOT7UX880ZVEh+K FyTS3UVfwYOhHZ4T+KYCS+F3NGXgL3s= X-Received: by 2002:a17:90b:1910:: with SMTP id mp16mr21729927pjb.30.1634408129213; Sat, 16 Oct 2021 11:15:29 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id ob5sm5075097pjb.2.2021.10.16.11.15.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Oct 2021 11:15:28 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 14/24] target/mips: Drop exit checks for singlestep_enabled Date: Sat, 16 Oct 2021 11:15:04 -0700 Message-Id: <20211016181514.3165661-15-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211016181514.3165661-1-richard.henderson@linaro.org> References: <20211016181514.3165661-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102b; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102b.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=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: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" GDB single-stepping is now handled generically. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/mips/tcg/translate.c | 50 +++++++++++++------------------------ 1 file changed, 18 insertions(+), 32 deletions(-) -- 2.25.1 diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c index f239f9ffc0..0e59b97190 100644 --- a/target/mips/tcg/translate.c +++ b/target/mips/tcg/translate.c @@ -4823,12 +4823,7 @@ static void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest) tcg_gen_exit_tb(ctx->base.tb, n); } else { gen_save_pc(dest); - if (ctx->base.singlestep_enabled) { - save_cpu_state(ctx, 0); - gen_helper_raise_exception_debug(cpu_env); - } else { - tcg_gen_lookup_and_goto_ptr(); - } + tcg_gen_lookup_and_goto_ptr(); } } @@ -11788,10 +11783,6 @@ static void gen_branch(DisasContext *ctx, int insn_bytes) } else { tcg_gen_mov_tl(cpu_PC, btarget); } - if (ctx->base.singlestep_enabled) { - save_cpu_state(ctx, 0); - gen_helper_raise_exception_debug(cpu_env); - } tcg_gen_lookup_and_goto_ptr(); break; default: @@ -16111,28 +16102,23 @@ static void mips_tr_tb_stop(DisasContextBase *dcbase, CPUState *cs) { DisasContext *ctx = container_of(dcbase, DisasContext, base); - if (ctx->base.singlestep_enabled && ctx->base.is_jmp != DISAS_NORETURN) { - save_cpu_state(ctx, ctx->base.is_jmp != DISAS_EXIT); - gen_helper_raise_exception_debug(cpu_env); - } else { - switch (ctx->base.is_jmp) { - case DISAS_STOP: - gen_save_pc(ctx->base.pc_next); - tcg_gen_lookup_and_goto_ptr(); - break; - case DISAS_NEXT: - case DISAS_TOO_MANY: - save_cpu_state(ctx, 0); - gen_goto_tb(ctx, 0, ctx->base.pc_next); - break; - case DISAS_EXIT: - tcg_gen_exit_tb(NULL, 0); - break; - case DISAS_NORETURN: - break; - default: - g_assert_not_reached(); - } + switch (ctx->base.is_jmp) { + case DISAS_STOP: + gen_save_pc(ctx->base.pc_next); + tcg_gen_lookup_and_goto_ptr(); + break; + case DISAS_NEXT: + case DISAS_TOO_MANY: + save_cpu_state(ctx, 0); + gen_goto_tb(ctx, 0, ctx->base.pc_next); + break; + case DISAS_EXIT: + tcg_gen_exit_tb(NULL, 0); + break; + case DISAS_NORETURN: + break; + default: + g_assert_not_reached(); } }