From patchwork Sat Oct 16 18:14:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515874 Delivered-To: patch@linaro.org Received: by 2002:ac0:cd8c:0:0:0:0:0 with SMTP id d12csp130431imp; Sat, 16 Oct 2021 11:17:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLJl9Iwi7gZnp+/ObJB9eaS94RJ1KuJnuNXzDG09OOPaXK5cBa6oO7cIod/qzjVfSHlVJ3 X-Received: by 2002:a25:2a89:: with SMTP id q131mr20819573ybq.404.1634408234563; Sat, 16 Oct 2021 11:17:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634408234; cv=none; d=google.com; s=arc-20160816; b=rnjWnSrxQdDbtEqWGrWhp+8vUnvtIfcAQwW/UjFUEvDJcPF8UEOPJ+Vxa5L2dYWOdL 9IyfAYne1OViuYDHka/awFga50IeMImaSiATX5kXXcrW7Ju24hmzEPevO0rjNFIBCksO C47j0i2ZjgWxcMnE9YDKHDtI3VI53tawwNeghlUV+bLdw1MRVUdjh4MPDar/EXHor01v zXlbsNGP6g05xz0fKKDktC2O7kcv+j6qZfFX96w9kOrby/eLLx+m3kQ8DiqdvCGO5Crf EMH9FHZyqRP906SsGaGX9V+cX18UI14NhlGwr+J51aDHXf9BSsaJmMunK4HxDwtvsIYG ispQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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=q7mA/5NMDye+T6oTs6PprYj8IGolC1UqhFN/enpkEuI=; b=ANdnazK8Jm3dKOWMRooKumViSf4JUG1Lm1pUeCUSpgvJn2ZtIRgRUodd8lMbzjJPlE JHsWXttgCJnru7QAQEYjeCOzlWvr1vSl1ZMkbSHcxoKuRTOn9LEB5rcjRsuP8j+PCobi GGos4qskmFl2zw106vtHi5/mIlkgzNMHuOYDgc7OoBTIZkKzgyVD06l8P8T9I521nKoP xsjSLFpST+F3TH99/jm1cpD65CMBvzIadocQGV2iig8J2b2xym3w3/1vg6rJV+6t4HrC LkwOztSK4KdgfyG8mzupapnlN4cp9DwyESrolUDixfQIQiyYnjVEs9t8Nt/eK7mGvI5Y udyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CYRRM+1Z; 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 x1si9511055ybp.327.2021.10.16.11.17.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 16 Oct 2021 11:17:14 -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=CYRRM+1Z; 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]:50704 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboF8-0008KT-0e for patch@linaro.org; Sat, 16 Oct 2021 14:17:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40826) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mboDK-0008IX-AF for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:22 -0400 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]:55212) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mboDH-0001oB-D7 for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:21 -0400 Received: by mail-pj1-x1032.google.com with SMTP id np13so9464927pjb.4 for ; Sat, 16 Oct 2021 11:15:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=q7mA/5NMDye+T6oTs6PprYj8IGolC1UqhFN/enpkEuI=; b=CYRRM+1Zt4xdytFXUYebvXDMeo5Z2gTrx9RnIqxvQSzkc9shssiaNuX0zQBpXgnd4d LoeDoZRpf3NcRJuEK4PhhrIqnWTZ/5Gw50xP3L6W5N600bfiOiJLY5WxfSEZ2HgiFXcN X7elmjdkE83KTWXgw1bwg8RmL2UVHnUIn8qTtwDvUiGxkodBgNHRgsXdQzgy6AYJQdt6 +fKTSK+yfDb3ZC8P3izgPDAQmuxW4INe5gmCLAs4d1rQM1VmD5tUTOa3K2ojXkLHDMRR N6ZwwPHEDX2Rus7NYLu32LbiwRw8RqVnpye99uZ5k9ZBwsd60xpnj09/bmuwzYu79QdD /UMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=q7mA/5NMDye+T6oTs6PprYj8IGolC1UqhFN/enpkEuI=; b=36wOyTXOKjolR/t2jMKFQoebkuWhSGpi2W3kTsCPz46IxWtdwdmuKgLCPxJ8etEnrP 9Fy0zXGJ12X6sjCthDNPEJMveaP8wnAonDDtJg7beU5RNI9Q4zU9gLF25SA50lZBSv0U Mq6x6OL1qqnOUxDc4EA18e241U2Ho33t/RuIMT4WRtYeUw5DZYAYAeVtuyImDYU6f9G+ m5wPtsIBDLCeuIFyEDJ8I3F9qbizKl3HiMZzFMaEzycgVyEbdnKyYh+AaLpBY8Vq3YqP RfLrRzCNHjLxiPQ+DBADOpRVOaS22IGkaRZzsfRg5vqGypUrelSzfPpFsqyvCPM9gBKN 8Luw== X-Gm-Message-State: AOAM533bBfvu11PNOv4agnaUvsulTt0HyUTQtdwTFFfTz9qKNby+ENAg cP9rmh1AsZ/GrvHdDzAavgOEcAGsnpRmnA== X-Received: by 2002:a17:903:120e:b0:138:d732:3b01 with SMTP id l14-20020a170903120e00b00138d7323b01mr17695009plh.21.1634408117109; Sat, 16 Oct 2021 11:15:17 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id ob5sm5075097pjb.2.2021.10.16.11.15.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Oct 2021 11:15:16 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 01/24] accel/tcg: Handle gdb singlestep in cpu_tb_exec Date: Sat, 16 Oct 2021 11:14:51 -0700 Message-Id: <20211016181514.3165661-2-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::1032; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1032.google.com X-Spam_score_int: -1 X-Spam_score: -0.2 X-Spam_bar: / X-Spam_report: (-0.2 / 5.0 requ) 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Currently the change in cpu_tb_exec is masked by the debug exception being raised by the translators. But this allows us to remove that code. Signed-off-by: Richard Henderson --- accel/tcg/cpu-exec.c | 11 +++++++++++ 1 file changed, 11 insertions(+) -- 2.25.1 diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 5fd1ed3422..c9764c1325 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -383,6 +383,17 @@ cpu_tb_exec(CPUState *cpu, TranslationBlock *itb, int *tb_exit) cc->set_pc(cpu, last_tb->pc); } } + + /* + * If gdb single-step, and we haven't raised another exception, + * raise a debug exception. Single-step with another exception + * is handled in cpu_handle_exception. + */ + if (unlikely(cpu->singlestep_enabled) && cpu->exception_index == -1) { + cpu->exception_index = EXCP_DEBUG; + cpu_loop_exit(cpu); + } + return last_tb; } From patchwork Sat Oct 16 18:14:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515879 Delivered-To: patch@linaro.org Received: by 2002:ac0:cd8c:0:0:0:0:0 with SMTP id d12csp131973imp; Sat, 16 Oct 2021 11:19:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBZRZ8ajTrHNFP0Vdmkak2xCosG2u5uEXXw5NqqMoAi/zr2oc5D2DFEmMI02AcauhBL59f X-Received: by 2002:a05:6e02:190c:: with SMTP id w12mr8507227ilu.226.1634408394547; Sat, 16 Oct 2021 11:19:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634408394; cv=none; d=google.com; s=arc-20160816; b=SqDkDvIvObXTlDvd5szHCUUiQWbN8NY9z7AO5KNG20LiFwrKXsFP+l6b4IkIPTOCBV KJAQm5XIGw8uy+Y5rXahIcwYdSuLokIXFBCpuy2KBCaPiuMIYan2g+SO1Ukw/jQBo634 6XIR0NT/nfuev8zpEEpnixIMSvaxkIRXgdfsuJhXozCUEKO0ZRL1hPUPMZ181I+xE3PA DQvXS2lJVb3rDFsH6TJ0ik9MAN5Gm4jM29p1kybLmpy7JGFsXW4nm+Lxb3UgjB7ecJlX VRtLdBiaCOx5BbxgaHOy9BFZ+OaJuwla96Qi8Z2fU5GY5Riy0dCA4lmmUAXcRGtC7Ps9 VyQw== 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=0YyDqXYsqrF8hGCU2JD1wGh8x6wmhmGPcgYsbKER5I8=; b=r6KL+kzXF22mZmxUtEQ4XK19vAXccy5thcWii0meV5UknO/pjQIYjh8AwywMuS60Mm SYy/GVtYg+aXzUre64GypkUKXCZtJ1sDZPls+xqxm7AXAchYIUlPiCL1b4D4nkP5eh15 OUACIP1k6gZIsdiDg3Vur8ES9J8qUUyhYTkPw9acY5o8AJwvQh3f73Si0i55/4uCFJJ7 dpfJNbOy1tQRsgF2kUzBlwfrSG/ROsfDZzUUEDNp9VXDBM9/B9gWURAR4H8h+1xtytZ+ IIQvf5vB7Bif/MgRkOdsqTO/DoOIZvcCVlPzcTBUrHgbRn0aV24yFqphi3Iu4ZfzMCVq AzzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oLQlyW9T; 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 z10si14265118ilu.34.2021.10.16.11.19.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 16 Oct 2021 11:19:54 -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=oLQlyW9T; 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]:59204 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboHi-0005sA-0w for patch@linaro.org; Sat, 16 Oct 2021 14:19:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40854) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mboDM-0008JU-NA for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:30 -0400 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]:51800) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mboDI-0001qe-Eq for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:22 -0400 Received: by mail-pj1-x1032.google.com with SMTP id kk10so9497885pjb.1 for ; Sat, 16 Oct 2021 11:15:19 -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=0YyDqXYsqrF8hGCU2JD1wGh8x6wmhmGPcgYsbKER5I8=; b=oLQlyW9TLh+jJmejYhbMj+8Ik0yYPDaqFBfKk/xm6aIq+tloZFcGU2FKzMbTR90vLk VsGQG5yc07N7NAv4YuLZM9LlJB42Zxs1LkmbAM6bg/08qZiToEbo5vFxvH+iP/kwAt9E vYeJzApVqyMCB/nxnYsyH0cAADYwOjXFUAYzbG5SXiE+YQro5bgDevIn1He10N6Qdpxg ZSdvrPmwQvSQIzqdsOwo9wspLxsxSA53jZd31KtgXQkhMMYscFKA2Ceixkk81/OCXWK1 hVEDsJHmFCg+mzhSxf2TEGD2baGIziIXS3SKiWRjKO9sTnTnED17llqC6YtgZ14us710 vWfg== 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=0YyDqXYsqrF8hGCU2JD1wGh8x6wmhmGPcgYsbKER5I8=; b=5XBfAt5Sp1wbDyfmGBcuYhsABkzcYsC8mD3sQNtmLorubLt4OJpse3z8mlyYTUO4KR 26HB59vg+9swC+6SGMNHu7i9noC0ekI9wt9cptuc9yoNRNEl7lWv7h5V+MqBSwVyJRbD A/+DI3GgxjSzk9k4AAu95Zv6gIaFNSmW88hcRwkkVu5eeKU9xUqdCum7NN8JhxYvaM4h HlW+znIudXhkWG/hFX5U/HIH9X+0VNbgl/vRabH4m6HdyaAg5sIX0TP2dodbm15HQKNQ nl2uT8+6rsr3XbCWns54OQRcmVsGvH+cAECd+O4XssWwrHhW/ruTDDpO2ktPtqF53wV4 YLKQ== X-Gm-Message-State: AOAM532Y3E0x9BJm91YXNIydKvvEwQk7hYL+yQtMgyJQqDxE6fzaCnrC cikCVOKe/kE33dAA25khJ6nnepOe9RI= X-Received: by 2002:a17:90a:f2c2:: with SMTP id gt2mr8270020pjb.2.1634408118622; Sat, 16 Oct 2021 11:15:18 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id ob5sm5075097pjb.2.2021.10.16.11.15.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Oct 2021 11:15:17 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 02/24] target/alpha: Drop checks for singlestep_enabled Date: Sat, 16 Oct 2021 11:14:52 -0700 Message-Id: <20211016181514.3165661-3-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::1032; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1032.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/alpha/translate.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) -- 2.25.1 diff --git a/target/alpha/translate.c b/target/alpha/translate.c index 0eee3a1bcc..a4c3f43e72 100644 --- a/target/alpha/translate.c +++ b/target/alpha/translate.c @@ -3005,17 +3005,10 @@ static void alpha_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu) tcg_gen_movi_i64(cpu_pc, ctx->base.pc_next); /* FALLTHRU */ case DISAS_PC_UPDATED: - if (!ctx->base.singlestep_enabled) { - tcg_gen_lookup_and_goto_ptr(); - break; - } - /* FALLTHRU */ + tcg_gen_lookup_and_goto_ptr(); + break; case DISAS_PC_UPDATED_NOCHAIN: - if (ctx->base.singlestep_enabled) { - gen_excp_1(EXCP_DEBUG, 0); - } else { - tcg_gen_exit_tb(NULL, 0); - } + tcg_gen_exit_tb(NULL, 0); break; default: g_assert_not_reached(); From patchwork Sat Oct 16 18:14:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515878 Delivered-To: patch@linaro.org Received: by 2002:ac0:cd8c:0:0:0:0:0 with SMTP id d12csp131958imp; Sat, 16 Oct 2021 11:19:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxu2TRx3fGvn8Lp/FYn9mG/3v2eALIMffFYSDAi6A4TWgzwgUdV/TQoHckVffrKtJw1TyV7 X-Received: by 2002:a25:e4c7:: with SMTP id b190mr20691760ybh.302.1634408393454; Sat, 16 Oct 2021 11:19:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634408393; cv=none; d=google.com; s=arc-20160816; b=nJH0G9OaROCrvbF1Qjs/Ay6E/KY2HbVoYQksL9v6bS0taEp0T4HOovy3iVdcrlrc35 ulEevavrcl46KWr+pTcqtrHUHDVsRtL7dbT+ln9ycDpS64y1D/OwFwk5uf3bimvT3S6O S6AQGs9W6ry56mMI9tnv5s84CqVRiVl/8YgPUQjQOwX2lO6Di/bQSLy7NZcsbj+R+M7c N48jhMF+vfNxcz0JJlwXji5LNJHYwpx59ls0O1K4oKI1fHhJLTLJ5mffrM1btp5gpxYZ Nz+G6BSDxurhcQ8OHpuZLjzFhKqFNhptE/dNxFmvLZtO/UHBTOpByR5OlBm/ur7htHcg 4xbA== 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=krNZ+k36Q7kVN35RCh7k4261FBntNustDkikqfFBngI=; b=qVU9yhB8uFBUb2OzYNGljCYCtQSJCj6CLgKS6dhll0Tr6oPOvr0YtZXQ/7QJAYtrFU 0/0S3P/A4fhE/oMJvFAswyilKMKTckjqjt8rlP5dOeJlra2KHS0ZPJMB7YIyRvAaJxIX Q31yxD2hnnvcoiQ0xOJTmGQVVJT4sL8CRzCu6efWzsPXHkDLENc8no3eFmfv4183DxfN GzSn/G2hRk+MLWkMSH9ZdEZ7Zk4yxDvecsn6YgsUA8F00WLvQaXA4KmajnZUQGN3FX+O Xn3z+4mkF1/42kp6xg/FDy9iVvWU5NsDmp6/8rBjFG0Sju2Tvk/deOIv0hif2LaOqFj8 lO3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=w5lDP6pf; 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 n17si11224394ybp.427.2021.10.16.11.19.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 16 Oct 2021 11:19:53 -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=w5lDP6pf; 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]:59008 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboHg-0005k7-Su for patch@linaro.org; Sat, 16 Oct 2021 14:19:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40856) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mboDM-0008JV-PS for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:30 -0400 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]:38844) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mboDI-0001s2-Tb for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:22 -0400 Received: by mail-pl1-x636.google.com with SMTP id i5so2249952pla.5 for ; Sat, 16 Oct 2021 11:15:20 -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=krNZ+k36Q7kVN35RCh7k4261FBntNustDkikqfFBngI=; b=w5lDP6pfJjtE0s4oqR5NR/pIy3vBepwIcxvbaJeacS+FmGXpxOBbcUdWXQgaFZRNPb k+nB1Z/PXnX/ed2SuGmbRgo0OJxMbTtQ3O8nRu3R80G5iJjoJw5b8JEX/fL22wrtpLQk 3l0o4oxu3H4+dmCRvEvJCrKCnwHyZ69TEq+nF8m/haIW8szCzeeJymEm4hViG8FCDSya JOCeDiFqSMMad/STkd9GPdcSrCdNje/Ay55t2Si9afjRcbRjft6Fa68sVeJG0HlqrpeD pNv2UPVXCUUhFujqrs/iiJoMVumXoLnM4aLRCsvFi70Jd9cRXaOFc95HXo7RdcFH4ND+ NkaQ== 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=krNZ+k36Q7kVN35RCh7k4261FBntNustDkikqfFBngI=; b=0ZRZ7XCw35ntKie94kdKQx8veqJgmndZdEIZBfkzXf4BfnmObBHSBGzdTYuQTH7TOu F4crqYmtKlS/ScQ1iz9uIRTxLCFBuCJ0WmoXsLPAvZ+AScNaq3ycEyU35f31bejavmFe AbepdnhomQPjpEWv+3OBjXBz2s/c33czT2KX06UStAI+U8eWmOOU3eFrqCj7ShHOpj2d +njT3sm8IRJZazTZKbGbpkx9Vrzs3q8pRuAMvpDCHZxTOpjdW3bxATZiqDZG/GZFkoF3 GsN64OnTtKPZq1gz39K6nY7WADIxrB3SGDbs0+42soUTR6R5Y2yxIYQqb1cQPTeh2nZv HcnA== X-Gm-Message-State: AOAM532V5kqorr01+HrCy3qEQr3VDtRLj1BC66rCKKhyBfzUcoa/e4nb h04ox1jOUyMJBt398ERkGIXEH7N4hZpVdA== X-Received: by 2002:a17:902:8bc3:b0:13e:9d00:a8f5 with SMTP id r3-20020a1709028bc300b0013e9d00a8f5mr17673992plo.79.1634408119557; Sat, 16 Oct 2021 11:15:19 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id ob5sm5075097pjb.2.2021.10.16.11.15.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Oct 2021 11:15:19 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 03/24] target/avr: Drop checks for singlestep_enabled Date: Sat, 16 Oct 2021 11:14:53 -0700 Message-Id: <20211016181514.3165661-4-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::636; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x636.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: Michael Rolnik , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" GDB single-stepping is now handled generically. Tested-by: Michael Rolnik Reviewed-by: Michael Rolnik Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/avr/translate.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) -- 2.25.1 diff --git a/target/avr/translate.c b/target/avr/translate.c index 438e7b13c1..af8a3e0f9c 100644 --- a/target/avr/translate.c +++ b/target/avr/translate.c @@ -1087,11 +1087,7 @@ static void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest) tcg_gen_exit_tb(tb, n); } else { tcg_gen_movi_i32(cpu_pc, dest); - if (ctx->base.singlestep_enabled) { - gen_helper_debug(cpu_env); - } else { - tcg_gen_lookup_and_goto_ptr(); - } + tcg_gen_lookup_and_goto_ptr(); } ctx->base.is_jmp = DISAS_NORETURN; } @@ -3009,17 +3005,10 @@ static void avr_tr_tb_stop(DisasContextBase *dcbase, CPUState *cs) tcg_gen_movi_tl(cpu_pc, ctx->npc); /* fall through */ case DISAS_LOOKUP: - if (!ctx->base.singlestep_enabled) { - tcg_gen_lookup_and_goto_ptr(); - break; - } - /* fall through */ + tcg_gen_lookup_and_goto_ptr(); + break; case DISAS_EXIT: - if (ctx->base.singlestep_enabled) { - gen_helper_debug(cpu_env); - } else { - tcg_gen_exit_tb(NULL, 0); - } + tcg_gen_exit_tb(NULL, 0); break; default: g_assert_not_reached(); From patchwork Sat Oct 16 18:14:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515876 Delivered-To: patch@linaro.org Received: by 2002:ac0:cd8c:0:0:0:0:0 with SMTP id d12csp130441imp; Sat, 16 Oct 2021 11:17:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGz7//Mv1hWCtbWAh25AbGbq1vqbYn1TKzAWvwpnJu4wYISLrjrLoUFDqEawNfDoG2EeG/ X-Received: by 2002:a05:6902:120e:: with SMTP id s14mr23440410ybu.161.1634408235232; Sat, 16 Oct 2021 11:17:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634408235; cv=none; d=google.com; s=arc-20160816; b=waBJm9tFonHUTI9L9BbknDQo6DBtwxFiZHWJKnKE/nL8MrI5r6lKGl8ZamqyLKkPIw WcNFEzhXhXrLW5hCTfbSncWbACTMd8goW0dfkHRhWneCxnc0vjc8grkgTZOCaL+F5Zy9 rcKR3eONrTomwtZecSlLzLBe1DW6NhnA2G11u3q3jM3XiPdUS2PQRID/bJjoXDiPam+A heqyUWxfkhKocePi6LgSde46QAm3UgyVmU7G7ROCRZ+JHMVerz6K/rRQAw3YH3GO+EHQ XFn2GnwNAIeoq5XTazPvJYymWZipQH7Rq7hYzpQnfsaaYEfvypj/b2ri5dJIKSkkdsgC Uyjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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=I0CzIZRWI2JoSPxoR4xs5SpApEcqlDWMcO9xYzu4ImA=; b=yq3fIv1oEMb8AfuYkidFRX6oJEEgOyN9MDs63pl7/G0f11APgpJbFklKhaQCdummA6 oocpRIroXS94OIhApigTyRymKufqyNbj/LYqUrHjfdMEUgAjqd91Ax6h8FNZUFIyw19I ES7neefPt+xYI4BEqaA0HUb0SjDvXoMYrvkFDMdFG/QlrJizX57gIzumaTBn3m9SDwZm F+/1NVYwrxjbx0YHiI3dM1ySW+ssp7EjZb4/Il51gAGGAlJ8Jof3xhRAVCT6VEiaHZkg 7GpQHL9xfzDutlnea1FCssWVjN4OHJg+vo7rBMIXaERO8LLG7W1kC2ccC1qc0ez/5yl6 l+RA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ajq6npFn; 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 a4si12392773ybp.81.2021.10.16.11.17.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 16 Oct 2021 11:17:15 -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=Ajq6npFn; 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]:50846 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboF8-0008OM-Lw for patch@linaro.org; Sat, 16 Oct 2021 14:17:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40900) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mboDR-0008Ja-AQ for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:30 -0400 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]:36751) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mboDJ-0001t5-Tz for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:24 -0400 Received: by mail-pj1-x102f.google.com with SMTP id qe4-20020a17090b4f8400b0019f663cfcd1so11670947pjb.1 for ; Sat, 16 Oct 2021 11:15:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=I0CzIZRWI2JoSPxoR4xs5SpApEcqlDWMcO9xYzu4ImA=; b=Ajq6npFn7th3y5VW+RD+oLlHq8ckBp4R5jxntrQP8CGczWOcmMhkloFlLTgAYh5Im0 U7mRwjQ2ecvoCfBURcilTlZPUnviSTpaIZvqijgfzPSw9HGQOoM65apF2/Z8KAl2qaTE QqtqA0mkWhVs414Xpzltt1LK4DgHc6WAQvz5zoXDX2wp3v0o6ibDOBMyVEy85SMU1o5L U0Ni18DQjfWSxJKnvkpMKxfz+TCKLURP9H0GC9+0NMHRLJq4LIqGavbIb26PRfT3WQsY XQ4EP+1QAev66KZYlNTGFc14WTGywaexjleujlCpFVCtRJVbqYyINdoltE8vt7XNoMWG WKVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=I0CzIZRWI2JoSPxoR4xs5SpApEcqlDWMcO9xYzu4ImA=; b=wVhhEd3HNFsbv4RJTBxwVIaXcmxVx8cQDafKci1fwm60RxV1J3PLySdDNLMxacYbhV 1tz+Cs/FUWTAcfNzFYY4K5xTh41ygkQf/rvCv+qbMXapdLKkK4Q4UhY+X7Ds6WGHcTrm 3OmNNa/iNW4LY0kUB4kBIca6+MkHRn9lvrLsq4zbgxDxWu7SshYo7tBEcYkozcMhJ3db EQmoZXbiyFq/lqPn8fkCdgxE92MlO1iHnqLg1ymvtqzBdS+K+RKJavXNb6DdSDbbG58U muEzp2iQrj/RV/U1VVabg2ZniCO52VoAVLWv2JotDr7WWv1if2Zn4SPcl1RCmWC7lgWP H8uQ== X-Gm-Message-State: AOAM5331IEtoWHzdAQ0GVUdyu40pq/9nET6sXnIaqBgFFFanZpfAS7hr T+bzrMwOEmAxVwn/alldH4gc8le/JfSgJg== X-Received: by 2002:a17:90b:17cc:: with SMTP id me12mr21808389pjb.147.1634408120305; Sat, 16 Oct 2021 11:15:20 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id ob5sm5075097pjb.2.2021.10.16.11.15.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Oct 2021 11:15:19 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 04/24] target/cris: Drop checks for singlestep_enabled Date: Sat, 16 Oct 2021 11:14:54 -0700 Message-Id: <20211016181514.3165661-5-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::102f; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102f.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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" GDB single-stepping is now handled generically. Signed-off-by: Richard Henderson --- target/cris/translate.c | 16 ---------------- 1 file changed, 16 deletions(-) -- 2.25.1 diff --git a/target/cris/translate.c b/target/cris/translate.c index a84b753349..59325b388a 100644 --- a/target/cris/translate.c +++ b/target/cris/translate.c @@ -3249,22 +3249,6 @@ static void cris_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu) } } - if (unlikely(dc->base.singlestep_enabled)) { - switch (is_jmp) { - case DISAS_TOO_MANY: - case DISAS_UPDATE_NEXT: - tcg_gen_movi_tl(env_pc, npc); - /* fall through */ - case DISAS_JUMP: - case DISAS_UPDATE: - t_gen_raise_exception(EXCP_DEBUG); - return; - default: - break; - } - g_assert_not_reached(); - } - switch (is_jmp) { case DISAS_TOO_MANY: gen_goto_tb(dc, 0, npc); From patchwork Sat Oct 16 18:14:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515875 Delivered-To: patch@linaro.org Received: by 2002:ac0:cd8c:0:0:0:0:0 with SMTP id d12csp130437imp; Sat, 16 Oct 2021 11:17:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyG8SNL8oOmG+S5xK73GJ0dPBmFT5P5Od9otVgVq1U3ckg/ApxWqqi/n9Pfr6LZPTdW8Ni4 X-Received: by 2002:a25:2d48:: with SMTP id s8mr20385863ybe.380.1634408234846; Sat, 16 Oct 2021 11:17:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634408234; cv=none; d=google.com; s=arc-20160816; b=Gzed7C315rm8wN3cMr23m5b3wvbt+w8cae3ZAz34Das5GAOyPY12iv84dxmVkrICUr sk/YAaOlV3BK5EGvdtN+d7gqoeJePScvZuICnUy88qLpEE77yKsEABTSKpkK46oBwyNg bp7GvzdljgdTbnwNCqYgo0KVyJqetGp6DyuWVKUkz0mtWocumEvhbC3s17Bsasgry90B w1MkBo7ZibdxW3iwEChqk9MVwKjaNcjhulsf2ezOIuhocmK3WAqSWWx8kSS2unnq18Pa fu2PYak3Ty4LXw9XCU8KoWuFUP11998frtnJJ9YXxblILTeXb9y5H8I5avu2/EoVGo+c nRtA== 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=FZzipROVCGm3vugHKiKwRWSZnnTR1LGc1zdt9OBaajQ=; b=Lm4TIQf9VcvQ1ALb5vo7Zhoe6tYIhMxyE5zY5scZKcDom4Ty3cufd75Iw2wElUkoqM gkKejOmfwnIfVvFJoFAcy5WZvk4BgCF/0r7njhsxvoCvYsUDKm4yLzkql1bKmAP6UmIH t1LKJXDtdsxa94NtSrRcFtK64Q3/vuj1a835HXC9p6ZFdA9N8gcVZr4rXcNVj9qPEEKI SLsZ6yZhRe7xoK0DknRFuRAb1s4N8tDRv3zwwbI4D/30NPAQsRv5yjMcjdnZ5hYxe6hn rEK3Pe3jj5Kq94/qG52RPwRxUxP68DfXmgeVo9fFbW5zjsrxihpoDWPSTDOvc5tGXokV w+XQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=shg5tAYk; 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 w11si12078544ybw.394.2021.10.16.11.17.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 16 Oct 2021 11:17:14 -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=shg5tAYk; 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]:50756 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboF8-0008MI-8b for patch@linaro.org; Sat, 16 Oct 2021 14:17:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40898) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mboDR-0008JZ-9j for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:30 -0400 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]:52769) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mboDL-0001ty-61 for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:26 -0400 Received: by mail-pj1-x102f.google.com with SMTP id oa4so9488080pjb.2 for ; Sat, 16 Oct 2021 11:15:22 -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=FZzipROVCGm3vugHKiKwRWSZnnTR1LGc1zdt9OBaajQ=; b=shg5tAYkhfXbQ9XO/wcQP7/aGt0LbULZKCN6/CpoR4qIrWQ5IUmH2jWgXGubKHDAlk Bsm83CKjTgiZvXifsHJiyn1p7GA3ncvowkyUTgyGMd0GN9aDvkokEpTAdXfEXgbONUdQ wH0Kv8s/2CrYj4zWPq1RzJLxa/ikdZpJ7nxhf0HhnYXLyOBdnfOXubUQGVNw0mxmys3j Z1p6q4vGvmd6+GpmxnH1D9qq2/Nh9pqJ65DmHNkAP9qLmVtvaHc2BmhcQPYYXOX2+1Di fMWK5P3xI5izLmR3NllXOor4NphxbDWdS0r3cNYxlQFV+vHa3zSuPujZrmVI5jjUeqml DgdA== 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=FZzipROVCGm3vugHKiKwRWSZnnTR1LGc1zdt9OBaajQ=; b=PCdk1B+BNeB0D/I4+iS5moZXAYUYHSQ1gFptJDwL27ozCZululLN/G8JzLIydKGs1F bbavau7amUtm4+OaNUlKSweK4qf9zIofb11bDB+eMcZESIa/k9JlXGRRzXsos+d1st7V D5dyr9NpH1OEiJ85qJ9NrSTEX/WrlfRNRjJR6TWoBUOt7ajX+1wbKkg744DM9b4JMOQx OJ/5Yk5kxyt/vtg3a3ciTvyqB18SfXdmGJg1OK6cllIbF0Bqh3+lZv4MOe5YkuYkx/TG 4akvwt300SakyZsA2RLb4WmrwcHzjU6vXN8Su1Us+EXmz3N05uR1Cxj96GogkymSuJK6 ilqQ== X-Gm-Message-State: AOAM530MZOtwk7Ed34NM35Lc2zisqxRMeoN+MkqzJvVKsnsY5YeBBPw5 Q6eqHItpenHBc1KscLnSZvmOlP6PwJOWtA== X-Received: by 2002:a17:90a:4e43:: with SMTP id t3mr36370149pjl.163.1634408121343; Sat, 16 Oct 2021 11:15:21 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id ob5sm5075097pjb.2.2021.10.16.11.15.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Oct 2021 11:15:20 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 05/24] target/hexagon: Drop checks for singlestep_enabled Date: Sat, 16 Oct 2021 11:14:55 -0700 Message-Id: <20211016181514.3165661-6-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::102f; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102f.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/hexagon/translate.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) -- 2.25.1 diff --git a/target/hexagon/translate.c b/target/hexagon/translate.c index 4f05ce3388..159931e8ee 100644 --- a/target/hexagon/translate.c +++ b/target/hexagon/translate.c @@ -69,11 +69,7 @@ static void gen_end_tb(DisasContext *ctx) { gen_exec_counters(ctx); tcg_gen_mov_tl(hex_gpr[HEX_REG_PC], hex_next_PC); - if (ctx->base.singlestep_enabled) { - gen_exception_raw(EXCP_DEBUG); - } else { - tcg_gen_exit_tb(NULL, 0); - } + tcg_gen_exit_tb(NULL, 0); ctx->base.is_jmp = DISAS_NORETURN; } @@ -614,11 +610,7 @@ static void hexagon_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu) case DISAS_TOO_MANY: gen_exec_counters(ctx); tcg_gen_movi_tl(hex_gpr[HEX_REG_PC], ctx->base.pc_next); - if (ctx->base.singlestep_enabled) { - gen_exception_raw(EXCP_DEBUG); - } else { - tcg_gen_exit_tb(NULL, 0); - } + tcg_gen_exit_tb(NULL, 0); break; case DISAS_NORETURN: break; From patchwork Sat Oct 16 18:14:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515880 Delivered-To: patch@linaro.org Received: by 2002:ac0:cd8c:0:0:0:0:0 with SMTP id d12csp131983imp; Sat, 16 Oct 2021 11:19:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCjtlZIh8n6bvcoQ29i+7Kc2IUbhCQ1YU1IBKiWLS82k20T6fGMKZseQ4UPJpNCvGeY5SH X-Received: by 2002:a25:42c9:: with SMTP id p192mr19617280yba.399.1634408395728; Sat, 16 Oct 2021 11:19:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634408395; cv=none; d=google.com; s=arc-20160816; b=sdciPA5CIxU92lPwpCEUZJsH7GfnAVl3vRTUcZgGeFOxdIHgO6hh7TIi83s7vkrt3c 6s4X99avBnebVuK9rziutHjsMsYLbxdqTxTYTZ3OhvHUjS764dM80gBsWKqAAns9ODaG esiulsgVfMz2cyMQN5KPOkozvPzIMTGv2vK4k8Heb3TbmDXLLfL9O83P0gw1VnS1JfHW 0J2zDigDvX/FsIgToRyHa2ho6N9jF0rtiTlf//cmtTUNbY+o20rdfqBvvhzc3s2w2A4a 1Q1Cgxc0RkAPzzOe0tNFORFUMAu1lMKI0/56pAx8JtSian93LSYVNtiVAULBDLCKiWgn PQ+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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=Iit+FHbqq4AHjQFze/NmYkeoKdz7m6lRYWz6z/sE/n0=; b=TOxmNuoeP+HcukuoTb8FUW1oTOG/CqtboVIOrAQJ2QSUQoR9wonRcIpKaATdJ+6hl0 XAWmyP63kZZxom7UtKrc/o5V1pJ36hZmmUn8GbFbleQzAZOsWk26Xll4+kDTv+oA/lbm BQi6SKDGl8gRWQJ9hbXY6XXUueVYj74FKmoV2dUJOp9ikOAhbDvG6iyOla9ZxCa50qNw qY/x+U54Mn+67thzL5Iy0fTPGqW3HEqwwj8WNJox4xBrpsquwwP94EzIyLMm/GvTXi0x QWEavUcd1qxSAUvukfyvNx3lIutr4MPA/bfxfYomIeql05WmDNpdm0lHFH+2fpc6Ok3T W+FQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wvVznH5f; 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 f13si14234103ybj.493.2021.10.16.11.19.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 16 Oct 2021 11:19:55 -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=wvVznH5f; 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]:59152 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboHj-0005qG-5D for patch@linaro.org; Sat, 16 Oct 2021 14:19:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41022) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mboDX-0008Lx-Qd for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:35 -0400 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]:41499) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mboDM-0001v3-D0 for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:33 -0400 Received: by mail-pj1-x102c.google.com with SMTP id na16-20020a17090b4c1000b0019f5bb661f9so9740663pjb.0 for ; Sat, 16 Oct 2021 11:15:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=Iit+FHbqq4AHjQFze/NmYkeoKdz7m6lRYWz6z/sE/n0=; b=wvVznH5faSgLLHktV8vpX7LtlkvAsf4+H3Oy08BmmPYk4APG9SvOWwRqwoRAhQY0Zy lKNVDY1i5Fws9Nz2dNPuft5aiWgbSggXMFPCRhtXZ6BOTE1PpyVgtpdJ4Nn2CYfutwD2 yyBwwsxBjEAJNWZAt2tgqo6My05xz83vv5w3vgwk761iHUJdLiZKE5fDAN8COR5fFf3z IgnZCeWDFnSJ/eNAKqoUXqn8zCy3VGp671AyOLPWh5KxLn088FZyxTincOfdH3BIz7d/ 9DD9FU5E+RckBv3K9RM7ph5sHs2M5LFDA1EOVJt/uJ351Bi5rnzTFZE5fIXBaurR8sr/ 23Ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Iit+FHbqq4AHjQFze/NmYkeoKdz7m6lRYWz6z/sE/n0=; b=lE2LmUgAhTEB5tlDGrABc/c2d9RRIZy5o0WAl3kyLnRpYJeGhw33HhYCjnXys6Rmx5 FDgD/ioRGX2bsdI2hp5NZ08v7FNtviuEAF2SZ0azDzlf80YEXHteBbGMwwGL+jZsOMrS nOgII+VS1+MQ/dRvjOd/rdgykH/uHIKnRCkl5YPn+1JqWafBfctbPuatRzp2kMBCHiuy c2IOhh4BRzXCjztz4KIax7HnqqWPaOcSdnOEgpwK2aBMONjkxqzEuw/leNjgXJ1s+m9n xE5GjBFo4QUCxOrcjNO+SCxmIthAn8zV9x1fecWsGjiuXl4LBVkRSo0aejLWvYPFf3fT joAQ== X-Gm-Message-State: AOAM532uaJF7lMUSCayvbnYtzOjmJZQLcILrkvWMhhd9AWfGMDT+QZ1Q D6Q0HKxoC5IsuJoCcNz2qyVyvrjPz5wHsQ== X-Received: by 2002:a17:903:234f:b0:13e:e6e1:c132 with SMTP id c15-20020a170903234f00b0013ee6e1c132mr17731103plh.57.1634408122458; Sat, 16 Oct 2021 11:15:22 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id ob5sm5075097pjb.2.2021.10.16.11.15.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Oct 2021 11:15:22 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 06/24] target/arm: Drop checks for singlestep_enabled Date: Sat, 16 Oct 2021 11:14:56 -0700 Message-Id: <20211016181514.3165661-7-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::102c; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102c.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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" GDB single-stepping is now handled generically. Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 10 ++-------- target/arm/translate.c | 36 ++++++------------------------------ 2 files changed, 8 insertions(+), 38 deletions(-) -- 2.25.1 diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 717afd481c..cec672f229 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -404,8 +404,6 @@ static inline void gen_goto_tb(DisasContext *s, int n, uint64_t dest) gen_a64_set_pc_im(dest); if (s->ss_active) { gen_step_complete_exception(s); - } else if (s->base.singlestep_enabled) { - gen_exception_internal(EXCP_DEBUG); } else { tcg_gen_lookup_and_goto_ptr(); s->base.is_jmp = DISAS_NORETURN; @@ -14879,7 +14877,7 @@ static void aarch64_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu) { DisasContext *dc = container_of(dcbase, DisasContext, base); - if (unlikely(dc->base.singlestep_enabled || dc->ss_active)) { + if (unlikely(dc->ss_active)) { /* Note that this means single stepping WFI doesn't halt the CPU. * For conditional branch insns this is harmless unreachable code as * gen_goto_tb() has already handled emitting the debug exception @@ -14891,11 +14889,7 @@ static void aarch64_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu) /* fall through */ case DISAS_EXIT: case DISAS_JUMP: - if (dc->base.singlestep_enabled) { - gen_exception_internal(EXCP_DEBUG); - } else { - gen_step_complete_exception(dc); - } + gen_step_complete_exception(dc); break; case DISAS_NORETURN: break; diff --git a/target/arm/translate.c b/target/arm/translate.c index f7086c66a5..d6af5b1b03 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -341,7 +341,7 @@ static void gen_exception_internal(int excp) tcg_temp_free_i32(tcg_excp); } -static void gen_step_complete_exception(DisasContext *s) +static void gen_singlestep_exception(DisasContext *s) { /* We just completed step of an insn. Move from Active-not-pending * to Active-pending, and then also take the swstep exception. @@ -357,30 +357,6 @@ static void gen_step_complete_exception(DisasContext *s) s->base.is_jmp = DISAS_NORETURN; } -static void gen_singlestep_exception(DisasContext *s) -{ - /* Generate the right kind of exception for singlestep, which is - * either the architectural singlestep or EXCP_DEBUG for QEMU's - * gdb singlestepping. - */ - if (s->ss_active) { - gen_step_complete_exception(s); - } else { - gen_exception_internal(EXCP_DEBUG); - } -} - -static inline bool is_singlestepping(DisasContext *s) -{ - /* Return true if we are singlestepping either because of - * architectural singlestep or QEMU gdbstub singlestep. This does - * not include the command line '-singlestep' mode which is rather - * misnamed as it only means "one instruction per TB" and doesn't - * affect the code we generate. - */ - return s->base.singlestep_enabled || s->ss_active; -} - void clear_eci_state(DisasContext *s) { /* @@ -837,7 +813,7 @@ static inline void gen_bx_excret_final_code(DisasContext *s) /* Is the new PC value in the magic range indicating exception return? */ tcg_gen_brcondi_i32(TCG_COND_GEU, cpu_R[15], min_magic, excret_label); /* No: end the TB as we would for a DISAS_JMP */ - if (is_singlestepping(s)) { + if (s->ss_active) { gen_singlestep_exception(s); } else { tcg_gen_exit_tb(NULL, 0); @@ -2606,7 +2582,7 @@ static void gen_goto_tb(DisasContext *s, int n, target_ulong dest) /* Jump, specifying which TB number to use if we gen_goto_tb() */ static inline void gen_jmp_tb(DisasContext *s, uint32_t dest, int tbno) { - if (unlikely(is_singlestepping(s))) { + if (unlikely(s->ss_active)) { /* An indirect jump so that we still trigger the debug exception. */ gen_set_pc_im(s, dest); s->base.is_jmp = DISAS_JUMP; @@ -9459,7 +9435,7 @@ static void arm_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs) dc->page_start = dc->base.pc_first & TARGET_PAGE_MASK; /* If architectural single step active, limit to 1. */ - if (is_singlestepping(dc)) { + if (dc->ss_active) { dc->base.max_insns = 1; } @@ -9794,7 +9770,7 @@ static void arm_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu) * insn codepath itself. */ gen_bx_excret_final_code(dc); - } else if (unlikely(is_singlestepping(dc))) { + } else if (unlikely(dc->ss_active)) { /* Unconditional and "condition passed" instruction codepath. */ switch (dc->base.is_jmp) { case DISAS_SWI: @@ -9889,7 +9865,7 @@ static void arm_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu) /* "Condition failed" instruction codepath for the branch/trap insn */ gen_set_label(dc->condlabel); gen_set_condexec(dc); - if (unlikely(is_singlestepping(dc))) { + if (unlikely(dc->ss_active)) { gen_set_pc_im(dc, dc->base.pc_next); gen_singlestep_exception(dc); } else { From patchwork Sat Oct 16 18:14:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515883 Delivered-To: patch@linaro.org Received: by 2002:ac0:cd8c:0:0:0:0:0 with SMTP id d12csp134622imp; Sat, 16 Oct 2021 11:23:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxriEjUsxil07MjDUqverACdFiZFSMNm8Xt4Wpaw2NwDdK8VbMLzviDTOozqVVQMct6U4f4 X-Received: by 2002:a25:5f46:: with SMTP id h6mr20512402ybm.209.1634408620281; Sat, 16 Oct 2021 11:23:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634408620; cv=none; d=google.com; s=arc-20160816; b=xUT/LqXHq5OSVh8JXuwSyrjPI9/NGYrKPt6e+783GU/vBbrqW9b6McoegPxv0QWZyx hREFJUQFA0sWUmhrWiqznnU242qSyGKL67igLsiHx7awTEFmXEiWQLQWtbxB/Vs7joWa PzRhR7Drg2+9mlFYnenCqNOuLBmZ/HJqPLR7qsAcGz+KUWD56S3p8UghkpcV9O1UpUkj Oz5PcfOsL8eR7v8b/rSh5DLevDgoSsVnb+0+RH9c0w0+sgqwldydLHEGn3Qe2+OjfClB hfyXDCQ8OnQTTximTwuqwb7T+A8OROrXo7/CJhAGuQlApUFTSvNW5HhGP4/1Uxgq6JHi gvnw== 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=l8F0yKfEV2474L4Ct30BbTSDAfxIN/YXChfrODh7eN4=; b=x65O9SMd3DTYfXDdkfktMsD1n9U2/o7Equcn16d14+GayIw27GLIb7a5VFlkS/WxLM 8tk7OHiqMeCoXJdujJROS2HLUsY5HWQJkp5EZAPxLFRHYdtKFefxQMLia75MZ9my9iGB t5oXDx6wI/H2E8WPeiaMjSpFU3nlGJc3Xai9dU91ookQPYfPgNNouH2FiO1OQE79tHjk EsJOZG6jk+q90kx303HAz06gcs/SwEpyw1UpO5rqvZGrFdfMdFzun034DG/pwrsKjcoQ 7JCF5W5dTptFD2VrkrZyYsSp7eHbCCxrBcagSyDH0F1OPxsBWlkA7JyJdW+IWQy1s9+W 8Mhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZHTAsCbf; 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 l22si13186752ybj.387.2021.10.16.11.23.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 16 Oct 2021 11:23:40 -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=ZHTAsCbf; 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]:39352 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboLL-0003G7-No for patch@linaro.org; Sat, 16 Oct 2021 14:23:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40952) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mboDT-0008Kc-CD for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:31 -0400 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]:47041) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mboDO-0001vN-Cb for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:30 -0400 Received: by mail-pf1-x42f.google.com with SMTP id i76so9121253pfe.13 for ; Sat, 16 Oct 2021 11:15:24 -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=l8F0yKfEV2474L4Ct30BbTSDAfxIN/YXChfrODh7eN4=; b=ZHTAsCbf9K9kTYJJNR9Cbexq581ns+5OMuaykQZFeHCGPoYMOs30yADt7SmD6e6ZaF gNo42PY7IgT93YXh0yJc6VivTS4dotGo0vpxyHSsYvGcTpRVGPVUwlbEWhnCfAl3N6ql u8adFPDOCXDesslnjul4VT4IjE9yFuNdjgZEkFGNXhUSDDM6tPPgJoqCBoX6Rswxgwmn IQS1QlUj4xTjZibBENZsmXHmCp+CHlqCxDAJnW+fVjAsjAHkx9pelsNPGNaNybc4r4Y1 fJOmfswCtkhovsAzPv28HX/x7GHFoDdChXj34WxRF5k2aBsHuLfkRkci7J7bHfgpKWnf LfYw== 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=l8F0yKfEV2474L4Ct30BbTSDAfxIN/YXChfrODh7eN4=; b=JBZYdZrLzxqCk9h4ifH6qVV7iN/4pPNgpxy3suMdA9aBsYx2qcei5h/phmWsmmIMtg tn8P7drU46Vfb2Dolt5GF2F6JWiOPyMQiVlPYp3t6fHNgqVL3j/pR50s5ApkkZCUCNCD lbeMFyVYemDayXrtzTd0cwQt2HghvTKNsQS/evia2O9ufXKYowanmSyamZfrWbGtSHy+ WXnmX1ghfK09LawsmAZUN9XSJvmAyfprwD2ZyBDmmJ90DPaBuFveQZlekHi+kLjWStBS yQdcZAumSOnwy5VjhJlVgSIainCkTPmxp1i82V2nYRc2cIH9TaRzYcjxmSD7l6Dfqf3a v7RA== X-Gm-Message-State: AOAM532Tq0+A40NtTvlIvAPajMsmBPpkDlkGHvze/gduCvW2+HvNqH/r NQwao4DVZenaMSQ1h7T76O7hFUu4emPgkQ== X-Received: by 2002:a63:5914:: with SMTP id n20mr14725639pgb.164.1634408123230; Sat, 16 Oct 2021 11:15:23 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id ob5sm5075097pjb.2.2021.10.16.11.15.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Oct 2021 11:15:22 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 07/24] target/hppa: Drop checks for singlestep_enabled Date: Sat, 16 Oct 2021 11:14:57 -0700 Message-Id: <20211016181514.3165661-8-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::42f; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42f.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/hppa/translate.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) -- 2.25.1 diff --git a/target/hppa/translate.c b/target/hppa/translate.c index c3698cf067..3b9744deb4 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -814,11 +814,7 @@ static void gen_goto_tb(DisasContext *ctx, int which, } else { copy_iaoq_entry(cpu_iaoq_f, f, cpu_iaoq_b); copy_iaoq_entry(cpu_iaoq_b, b, ctx->iaoq_n_var); - if (ctx->base.singlestep_enabled) { - gen_excp_1(EXCP_DEBUG); - } else { - tcg_gen_lookup_and_goto_ptr(); - } + tcg_gen_lookup_and_goto_ptr(); } } @@ -2346,11 +2342,7 @@ static bool do_rfi(DisasContext *ctx, bool rfi_r) gen_helper_rfi(cpu_env); } /* Exit the TB to recognize new interrupts. */ - if (ctx->base.singlestep_enabled) { - gen_excp_1(EXCP_DEBUG); - } else { - tcg_gen_exit_tb(NULL, 0); - } + tcg_gen_exit_tb(NULL, 0); ctx->base.is_jmp = DISAS_NORETURN; return nullify_end(ctx); @@ -4274,10 +4266,9 @@ static void hppa_tr_tb_stop(DisasContextBase *dcbase, CPUState *cs) nullify_save(ctx); /* FALLTHRU */ case DISAS_IAQ_N_UPDATED: - if (ctx->base.singlestep_enabled) { - gen_excp_1(EXCP_DEBUG); - } else if (is_jmp != DISAS_IAQ_N_STALE_EXIT) { + if (is_jmp != DISAS_IAQ_N_STALE_EXIT) { tcg_gen_lookup_and_goto_ptr(); + break; } /* FALLTHRU */ case DISAS_EXIT: From patchwork Sat Oct 16 18:14:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515889 Delivered-To: patch@linaro.org Received: by 2002:ac0:cd8c:0:0:0:0:0 with SMTP id d12csp137464imp; Sat, 16 Oct 2021 11:28:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwiMsZaEEOHWBGB2ytCrXj38HmreydmDeEeoE/RyeaXYDGi0k86WJpxORiaAggUafL9/SHi X-Received: by 2002:a25:5e86:: with SMTP id s128mr19384679ybb.79.1634408890316; Sat, 16 Oct 2021 11:28:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634408890; cv=none; d=google.com; s=arc-20160816; b=rYgtbpoS2OGxjQZY0hApo32uycjBHve8xzJC7JY3iSSgIpWk7UN5ApuT6FU7aXm6RI 7ZAuZIs5Klld0T65E1oRy7aBBDJBP5hn6jz9zeTPZIT0OibbE7P0mtztcP55XVAxbBh5 Js4o+jnq6Llv/5KozP9t7yci1sBaJSjR7ae10BLW/2HeKuybzKU+TEQdASdKto/5EBnK jE/fymldIE6tJ7E1SKFRme1JSzdd5hrJz9edhX0zrRGruZU5hO0qUsox+zM/x97cxKjA mnMRSYSudq1t172FW4ZCt2tVcAXYerkhP+7j8yI5XEOn908mN0/Ma1tGU9yQpf/xF6nt N8vA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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=jQKQj7yC7oasjm6gEezfZCoepcbFAh4lW7SLWUNzRbc=; b=OexfuteDn7gtqmYsp5+FDYiuxrmSsyYEIzr6ibh7WailGooX4xlJNxI8AZVetDa5Z3 tjMIvByDnXf1q5j5ZPvnQOs6b7bR6xcAHqvbt3HZxJo9ro7rLgxHLZy9P7zy7ThP4tUG dpwf8J0nLv6Dq2yOpy0Epmgzwcj7FwXkzMdIPTnnQILOSXdqglt2ppkAuZFF25GdNgHK q60JAcK7YN2vKkNAmCIp5T1kLd/q68DL+yyrJP+WZtC/u5A4s5k7Lfo2QbNSybgVAMDP yRgd0VsCt+9jdr4bx3AFSQON5vB0dPL+QzANB2lFTCh5H0C8ywi/sBn/NRsOeoLfbDB8 Xuaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Vw6QthaW; 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 e194si10527002ybb.401.2021.10.16.11.28.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 16 Oct 2021 11:28:10 -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=Vw6QthaW; 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]:50610 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboPh-0002LL-Mk for patch@linaro.org; Sat, 16 Oct 2021 14:28:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41024) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mboDX-0008M4-TO for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:35 -0400 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]:36664) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mboDQ-0001w9-7h for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:34 -0400 Received: by mail-pl1-x629.google.com with SMTP id f21so8500186plb.3 for ; Sat, 16 Oct 2021 11:15:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=jQKQj7yC7oasjm6gEezfZCoepcbFAh4lW7SLWUNzRbc=; b=Vw6QthaW/7gFnrlZHvJy3leedJSKJF4c8amcOpQAjUXv/j7ojMPTfsy1si9IkWWXen lS3vqyMlX4l8Rn9b0UhM0hWGAH2+0Bhv4yh51ZzCRd9L4rB8NldnkQZbImJh00bRB4LY k3MWNhnH5MCmmsLh7OydQHOpSVVFZiumeZ/ROxZzngcb3Pspff/g3MnDgobn1O1ipHtU SsUvmcL9yenEQC63Qw/Ezwia9tH4JlChsiI3LoIYFwgjfme/dqDia60IhDSX95u5ywF/ nxQFzkIsipAPLA9HNR9IHe1Exy/SepYjLTiaRpxC2XJ71qHrAksKOUuaqn9IWgsMPCW9 d51Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jQKQj7yC7oasjm6gEezfZCoepcbFAh4lW7SLWUNzRbc=; b=bzhbQuC62Ef/Z6bngYkG42rspOSm+TVhof/zD4YfSJV8/N2QjJdlaBgppdyxQg4qS7 nYhrd0hmV0OKh7jhvw5jT68UZDrbG5mxjU7yiZ+5uTHL3kDiyme7xHEyJYWJpGl9Ogqm Qwy+ObFrbwUEaJSZbT7UWcMsghMcTg9fcvjdznu4hhQvVZGedJk3r15deAgJmhHn//n9 d5GiCOWztwuB4cneEwLfHds6vcB+8a2DZT2ySkuJQo6OTeA3s3es4251TZbT3jJjjtjW xHTr4wwr5DxmOWRoRPmbe43LblB1h7vXTuOonVi1+SITe5wsu92p7PL2CFm4b1vPyMaC JU8A== X-Gm-Message-State: AOAM530SJa7tPEHWeGTLW0Wvhk2vUQFEe03rSVJsuiu/6GtdLAD+zGVJ 9rQHqXN3Dla7AA3b4lRR+ti1HBUl9pw20A== X-Received: by 2002:a17:903:2c2:b029:101:9c88:d928 with SMTP id s2-20020a17090302c2b02901019c88d928mr17554990plk.62.1634408124067; Sat, 16 Oct 2021 11:15:24 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id ob5sm5075097pjb.2.2021.10.16.11.15.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Oct 2021 11:15:23 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 08/24] target/i386: Check CF_NO_GOTO_TB for dc->jmp_opt Date: Sat, 16 Oct 2021 11:14:58 -0700 Message-Id: <20211016181514.3165661-9-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::629; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x629.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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We were using singlestep_enabled as a proxy for whether translator_use_goto_tb would always return false. Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.25.1 diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index a46be75b00..c8d919bc3f 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -8556,6 +8556,7 @@ static void i386_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cpu) DisasContext *dc = container_of(dcbase, DisasContext, base); CPUX86State *env = cpu->env_ptr; uint32_t flags = dc->base.tb->flags; + uint32_t cflags = tb_cflags(dc->base.tb); int cpl = (flags >> HF_CPL_SHIFT) & 3; int iopl = (flags >> IOPL_SHIFT) & 3; @@ -8593,14 +8594,14 @@ static void i386_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cpu) dc->cpuid_ext3_features = env->features[FEAT_8000_0001_ECX]; dc->cpuid_7_0_ebx_features = env->features[FEAT_7_0_EBX]; dc->cpuid_xsave_features = env->features[FEAT_XSAVE]; - dc->jmp_opt = !(dc->base.singlestep_enabled || + dc->jmp_opt = !((cflags & CF_NO_GOTO_TB) || (flags & (HF_TF_MASK | HF_INHIBIT_IRQ_MASK))); /* * If jmp_opt, we want to handle each string instruction individually. * For icount also disable repz optimization so that each iteration * is accounted separately. */ - dc->repz_opt = !dc->jmp_opt && !(tb_cflags(dc->base.tb) & CF_USE_ICOUNT); + dc->repz_opt = !dc->jmp_opt && !(cflags & CF_USE_ICOUNT); dc->T0 = tcg_temp_new(); dc->T1 = tcg_temp_new(); From patchwork Sat Oct 16 18:14:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515885 Delivered-To: patch@linaro.org Received: by 2002:ac0:cd8c:0:0:0:0:0 with SMTP id d12csp135102imp; Sat, 16 Oct 2021 11:24:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8wDC6zplI0JjNs8F+OlzWvpYWP4La01kuQf5BmClHZVQFt1WsesuaBFQGBcKyUqCNA+wo X-Received: by 2002:a25:7309:: with SMTP id o9mr20187890ybc.42.1634408660455; Sat, 16 Oct 2021 11:24:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634408660; cv=none; d=google.com; s=arc-20160816; b=rUc5No5uXdR4/Vx+LZDFssGaHVr8UfbzdwY+WBs6Qx8vbDCzWDLea9TFedqxxsDiKF lJd/RnCdupmbs37PDacmUeEKO5FyxWPW45CmtQp1OIvttNIyXM36mAlAdP9yBBPBPjDO UUAXhGK1n3s12iBpA4/2h9/ISYiF6abLjcHQc9rHdOR7jpGbLfrhSGnkmk/fnEiydNYU tWC+oRg0U2+APzear0CkyRMrtREGXECTrU1oCQat/A6/AkBbNU7vixbXpXKPSA1EZlEm /yzQBzUXvtx64EZ8OqKYf8JNypevxX1O/YORB0gEp1263j5rpJZzRp8fFfHawwdWDcW4 ncnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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=Quiv5vbH7lzjgQxwPWoCohOnwSfDfP+7M3aharRivYE=; b=r29MVb27lRG8KOGu8Nu6o0D7Q40sbS11RKzRBgh+5AU7QmPhE5+ZIP+uZO8RYk4ZPr 3TLx62c90FGhpc8LETRLJKeojtqipT/GK+4e0TUelICo0+U9pZxTzZPnJuupfP9cuSd2 k8hiqeQ2uvH8H/rp4I18KswdEX7u4TS4r+ldx5It2iTcEoD5EyRinr17aw9mAb8gZvjz nL2izB7jPFc90W1NWxjWYisrLZyCu5lfByZG40TIDNuQzH08O0dZ9neGhy6ZTbUmKpJy MYQ/QwuMqlxoOpSU/hG3Q1CLVPmGCXjzPubLiFm2N13wnyRjRYp4tJk5Dt24um8pPp8B HO8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mmegxJlW; 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 c130si10658536ybc.252.2021.10.16.11.24.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 16 Oct 2021 11:24:20 -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=mmegxJlW; 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]:41776 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboLz-0004qQ-U3 for patch@linaro.org; Sat, 16 Oct 2021 14:24:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40974) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mboDW-0008LY-4e for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:35 -0400 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]:53842) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mboDQ-0001xh-W3 for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:31 -0400 Received: by mail-pj1-x1035.google.com with SMTP id ls18so9474442pjb.3 for ; Sat, 16 Oct 2021 11:15:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=Quiv5vbH7lzjgQxwPWoCohOnwSfDfP+7M3aharRivYE=; b=mmegxJlWCTJ7CDrKT3RrkkLStiUacxvMwslT2RHp6XkkJsWAqNoFo7TY5LQUlaOWHi tvW9sOrHH9oiscDHz1qMBwaHa5S02wMWNqx97PVC0rfQXHt3qnd4WO6M7tUWp1SzLgOj 6U87WM4Xs21INNRcb0nZH4ZXaM0aH/VAsItBQzfICbfGlkqytwU9/E2HLKf19jz9C0g0 dSlsbHEVuUyqd3HXp0UdttgBlumi0U4Rzzs2JZ1pxxfeHbDA89BOzaFuxjLtVmz7g6cz Rp22TQEdSF/zoQA+wd7Fr1vcv7kcCWSEX+6ilbeKd/GxW5AzcTyedHYAqsPc4Z9Ailc8 LnVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Quiv5vbH7lzjgQxwPWoCohOnwSfDfP+7M3aharRivYE=; b=S5JJpWbLcnTpOH4x+xWk9MdOahM/cWeRqjZ4j+CmSHD+xn6+YQ9W1RfdzCwpmh3k/6 uAEVSTc+uKQlRTMBoEzKSmUY005iOl1gUwHRC+h00o/bezS7IqagA5/0yIssKTlLwsXS 6XJ7Xz/ShjWyyd3qsG1SOHgnicOo+ragCmMVwkfEhTs9LsN0f9FA9zCFiM0QnohX+OUd +JvDtv+yVc/Mi3221Al9zaKpDzPkpsenO8DgXevGxzuE/0+BfeDkba/ga64n+dDlJ9Wg dM3qw3mxLmBDeJW8RGscrKjXYehP2UYD+9qMXVgJST3200U96UsSgK6AveCRBQ587mBI MkHg== X-Gm-Message-State: AOAM530h9r/5QitWBuTE9wzwqkCZdmaKR0AcgEaZdkWZfybUXHh0Oy0k MXLGKymkbJ6jk3BlgXVZQr719VPI4kXINA== X-Received: by 2002:a17:902:64d6:b0:13e:a5a9:c6d6 with SMTP id y22-20020a17090264d600b0013ea5a9c6d6mr17980241pli.52.1634408124865; Sat, 16 Oct 2021 11:15:24 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id ob5sm5075097pjb.2.2021.10.16.11.15.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Oct 2021 11:15:24 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 09/24] target/i386: Drop check for singlestep_enabled Date: Sat, 16 Oct 2021 11:14:59 -0700 Message-Id: <20211016181514.3165661-10-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::1035; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1035.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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" GDB single-stepping is now handled generically. Signed-off-by: Richard Henderson --- target/i386/helper.h | 1 - target/i386/tcg/misc_helper.c | 8 -------- target/i386/tcg/translate.c | 4 +--- 3 files changed, 1 insertion(+), 12 deletions(-) -- 2.25.1 diff --git a/target/i386/helper.h b/target/i386/helper.h index 574ff75615..ac3b4d1ee3 100644 --- a/target/i386/helper.h +++ b/target/i386/helper.h @@ -56,7 +56,6 @@ DEF_HELPER_2(syscall, void, env, int) DEF_HELPER_2(sysret, void, env, int) #endif DEF_HELPER_FLAGS_2(pause, TCG_CALL_NO_WG, noreturn, env, int) -DEF_HELPER_FLAGS_1(debug, TCG_CALL_NO_WG, noreturn, env) DEF_HELPER_1(reset_rf, void, env) DEF_HELPER_FLAGS_3(raise_interrupt, TCG_CALL_NO_WG, noreturn, env, int, int) DEF_HELPER_FLAGS_2(raise_exception, TCG_CALL_NO_WG, noreturn, env, int) diff --git a/target/i386/tcg/misc_helper.c b/target/i386/tcg/misc_helper.c index baffa5d7ba..5769db5ace 100644 --- a/target/i386/tcg/misc_helper.c +++ b/target/i386/tcg/misc_helper.c @@ -110,14 +110,6 @@ void QEMU_NORETURN helper_pause(CPUX86State *env, int next_eip_addend) do_pause(env); } -void QEMU_NORETURN helper_debug(CPUX86State *env) -{ - CPUState *cs = env_cpu(env); - - cs->exception_index = EXCP_DEBUG; - cpu_loop_exit(cs); -} - uint64_t helper_rdpkru(CPUX86State *env, uint32_t ecx) { if ((env->cr[4] & CR4_PKE_MASK) == 0) { diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index c8d919bc3f..e9e1451540 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -2660,9 +2660,7 @@ do_gen_eob_worker(DisasContext *s, bool inhibit, bool recheck_tf, bool jr) if (s->base.tb->flags & HF_RF_MASK) { gen_helper_reset_rf(cpu_env); } - if (s->base.singlestep_enabled) { - gen_helper_debug(cpu_env); - } else if (recheck_tf) { + if (recheck_tf) { gen_helper_rechecking_single_step(cpu_env); tcg_gen_exit_tb(NULL, 0); } else if (s->flags & HF_TF_MASK) { From patchwork Sat Oct 16 18:15:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515882 Delivered-To: patch@linaro.org Received: by 2002:ac0:cd8c:0:0:0:0:0 with SMTP id d12csp134605imp; Sat, 16 Oct 2021 11:23:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGW1FkF5/qvP+kaGD8ComL+m9taF5SbYXr+BbfGbJgevFJ5gHCF+QJYsBGKtOfBIqwt/Fl X-Received: by 2002:a25:5084:: with SMTP id e126mr19150813ybb.475.1634408618558; Sat, 16 Oct 2021 11:23:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634408618; cv=none; d=google.com; s=arc-20160816; b=P/Sh3Q9f1OsaeB92HzdGLUdp1AETe0p7z8Z8XMIodjayxg5CFytnNNuU0827pbf4HY YOhNn4fXCIC04r6PsW/RNyo8JZBEzWZKEo78vzpN++3XpoFP8eWRVHZiVQnJmoKduLnX YNtlgJAlfxHRfBmn8C3Jck0eal+9eD1x+4XnkGjeUDn33jTvOCmsssfob5Yb9cXSgh0l kJUWUBioLI/VKJtkiQ41MHOoUlLx++5KbaNWkmia16gPoEz1TQ3gCLe2xwZaDRUy9dL8 u4wcf1z04N3LGf9627FAjcV01An4QOhIbSt9JKYzH+PgIVU+BSSvQkKiPXmj4FxZw2FM Tpdg== 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=5vzsS779Ji0aZH1T0g3pZgPZBGZ0QiFgHfm7fgPItP0=; b=IBkC7J4Mu9XYL2hEDVaYLnTJCPsF0JIrXEK1C+AZZX2uwBkwgIEobwQOmWZewKfBcr WbXAcMSrZdESalyPYcLe4adT1usDWZ0IwlVwlt1Cx7rF1hOhBDaL1XOU1lYBcQ8thn5M i7BbLb5S0yZ5bbYrjjy28UDGQzE30qDnU6z1tPbcPw9wq0rHSj1XRxxS2hRXlVfO/y94 k1eoWlWEREl+9Fxe7mB1Eqy5OMXz8/0VozZHYi5wAjzUvr70Is08kJ2pedwB9BeP9FHx fQxZY8PcmVwXibTlnSFL84d8GuSpqCiGwzenyU/qAAgXiuGVsVXgYIFXUIDUWG3jcfkT gT8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HSE2KK68; 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 c16si9819839ybn.85.2021.10.16.11.23.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 16 Oct 2021 11:23:38 -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=HSE2KK68; 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]:39020 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboLJ-00032w-VD for patch@linaro.org; Sat, 16 Oct 2021 14:23:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41026) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mboDY-0008MN-0O for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:36 -0400 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]:40839) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mboDR-0001xl-2Q for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:35 -0400 Received: by mail-pj1-x1035.google.com with SMTP id pf6-20020a17090b1d8600b0019fa884ab85so11646367pjb.5 for ; Sat, 16 Oct 2021 11:15:26 -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=5vzsS779Ji0aZH1T0g3pZgPZBGZ0QiFgHfm7fgPItP0=; b=HSE2KK68BwycnfejuVVg7v1VC74eSRR4ebYB2Psrl4pW/bvwCDa2jaCUTGSmCEX8Do SMp5vb/EvKPvjzGoXgGSoc4WBVyQHR/ZvS02LK/FXpoBUZrhI5SporeHcLNC9VClN0A1 N42lYaDxabgOdPbQwM9nwFWgF9lGSPnfzBmYGtoAHuk7U3H9wL6pOody808XFeAFG2UT vDSIa+0G+AXbiD5cdQJhIIFk7PDe/u5J+BjnYiK1XNanwZ1Pf2XApl42ApOPrV/9gtXQ RgGEA9awuOUSCjv+vo5nbXuuY0vGzMVIIt55frMGpbNKibCAoDYqZ0Ro+RfTCzpvA30B DUSQ== 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=5vzsS779Ji0aZH1T0g3pZgPZBGZ0QiFgHfm7fgPItP0=; b=PKaW5/dGmZteDkD7ya+2dqQo8llm+vxlNRcHELFQhoJm7+Ybmr/RrLBLlxCa1k6Ujf MD9pRUlc7ZHHNvoTaeDyuTnAarixO1Fh6Ssjk97yZnKK/H7MOz8UGxv+VgyZKKmBRU9Z MkXmeH6Elj8U0eA6zoNDOkyNe9+4U8H0W2blsAi7HOfuwBIk/BzxaWHOZ+EyTmqKuWOL lCekh6xXcGGI3QxQ/U4FiAaT9Tkz9VTr6tDLcuV2pRF7JASBA+LwZ1IhOMOSCAjSpEH0 5BWNxqbGdaKyOUYcrOGAXD9rGO8rUVm7diiL53H7wWSFDZEsrxbOfwljJ8H6HCbfS0qo yl6w== X-Gm-Message-State: AOAM530JgCtPk33mLTkbYHqcprWD4IYWHBuEDl5kfPMCF329DolW019U s5znFhXvUIDMdyRv5Qs0qr+GOVAMpXA6QQ== X-Received: by 2002:a17:90b:1e4b:: with SMTP id pi11mr22267667pjb.179.1634408125724; Sat, 16 Oct 2021 11:15:25 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id ob5sm5075097pjb.2.2021.10.16.11.15.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Oct 2021 11:15:25 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 10/24] target/m68k: Drop checks for singlestep_enabled Date: Sat, 16 Oct 2021 11:15:00 -0700 Message-Id: <20211016181514.3165661-11-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::1035; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1035.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: Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" GDB single-stepping is now handled generically. Acked-by: Laurent Vivier Signed-off-by: Richard Henderson --- target/m68k/translate.c | 44 +++++++++-------------------------------- 1 file changed, 9 insertions(+), 35 deletions(-) -- 2.25.1 diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 50a55f949c..af43c8eab8 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -194,18 +194,6 @@ static void do_writebacks(DisasContext *s) } } -static bool is_singlestepping(DisasContext *s) -{ - /* - * Return true if we are singlestepping either because of - * architectural singlestep or QEMU gdbstub singlestep. This does - * not include the command line '-singlestep' mode which is rather - * misnamed as it only means "one instruction per TB" and doesn't - * affect the code we generate. - */ - return s->base.singlestep_enabled || s->ss_active; -} - /* is_jmp field values */ #define DISAS_JUMP DISAS_TARGET_0 /* only pc was modified dynamically */ #define DISAS_EXIT DISAS_TARGET_1 /* cpu state was modified dynamically */ @@ -320,20 +308,6 @@ static void gen_exception(DisasContext *s, uint32_t dest, int nr) s->base.is_jmp = DISAS_NORETURN; } -static void gen_singlestep_exception(DisasContext *s) -{ - /* - * Generate the right kind of exception for singlestep, which is - * either the architectural singlestep or EXCP_DEBUG for QEMU's - * gdb singlestepping. - */ - if (s->ss_active) { - gen_raise_exception(EXCP_TRACE); - } else { - gen_raise_exception(EXCP_DEBUG); - } -} - static inline void gen_addr_fault(DisasContext *s) { gen_exception(s, s->base.pc_next, EXCP_ADDRESS); @@ -1522,10 +1496,10 @@ static void gen_exit_tb(DisasContext *s) /* Generate a jump to an immediate address. */ static void gen_jmp_tb(DisasContext *s, int n, uint32_t dest) { - if (unlikely(is_singlestepping(s))) { + if (unlikely(s->ss_active)) { update_cc_op(s); tcg_gen_movi_i32(QREG_PC, dest); - gen_singlestep_exception(s); + gen_raise_exception(EXCP_TRACE); } else if (translator_use_goto_tb(&s->base, dest)) { tcg_gen_goto_tb(n); tcg_gen_movi_i32(QREG_PC, dest); @@ -6193,7 +6167,7 @@ static void m68k_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cpu) dc->ss_active = (M68K_SR_TRACE(env->sr) == M68K_SR_TRACE_ANY_INS); /* If architectural single step active, limit to 1 */ - if (is_singlestepping(dc)) { + if (dc->ss_active) { dc->base.max_insns = 1; } } @@ -6252,17 +6226,17 @@ static void m68k_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu) break; case DISAS_TOO_MANY: update_cc_op(dc); - if (is_singlestepping(dc)) { + if (dc->ss_active) { tcg_gen_movi_i32(QREG_PC, dc->pc); - gen_singlestep_exception(dc); + gen_raise_exception(EXCP_TRACE); } else { gen_jmp_tb(dc, 0, dc->pc); } break; case DISAS_JUMP: /* We updated CC_OP and PC in gen_jmp/gen_jmp_im. */ - if (is_singlestepping(dc)) { - gen_singlestep_exception(dc); + if (dc->ss_active) { + gen_raise_exception(EXCP_TRACE); } else { tcg_gen_lookup_and_goto_ptr(); } @@ -6272,8 +6246,8 @@ static void m68k_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu) * We updated CC_OP and PC in gen_exit_tb, but also modified * other state that may require returning to the main loop. */ - if (is_singlestepping(dc)) { - gen_singlestep_exception(dc); + if (dc->ss_active) { + gen_raise_exception(EXCP_TRACE); } else { tcg_gen_exit_tb(NULL, 0); } From patchwork Sat Oct 16 18:15:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515888 Delivered-To: patch@linaro.org Received: by 2002:ac0:cd8c:0:0:0:0:0 with SMTP id d12csp137235imp; Sat, 16 Oct 2021 11:27:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3lz3R8Vk1/SFeVv/lZlxfdYB4yT429V3CGioGECYT7R2jc/84AqruFjbCL6FHGj9JeP9e X-Received: by 2002:a25:ab08:: with SMTP id u8mr21873130ybi.275.1634408865884; 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=zPX58SpfUlwTJxCKHO0oceSi1U4Zwh4/VgieKAcqZ2rs1deAZbXBdIrsYEI3YT2cJ0 RnHTbsYbPsrYvJkv2JSoJ/vJQuxuxGxrTBc2WZvW1bysH4+nYK58/2pkydkUukfyMfsI NVZGlZdwNlBvLkAPf963CPqwxwaw22kk5T+stc5wPno/eBiRg/N5Ecade7Bii8nLXt0/ fYDWV/zyMIJVkjuSYN0WnQGL9Xhh/mTh4ul3mu15q/W4BVZcQwT61DWtWN0JbCcPCgrv KOo3p8SIJQTUqOSkjXgQMRZCEFnQo59gFSs9HCI1zKmV4fi9i8bazkSJ5uSBCspjO/fO 2HHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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=R6dlxti+/N1vnkKixu8IUh/Zl8M8i7vv7yb2sO8QtGA=; b=VUfg2DWWfpeLgQxhAZCDs51OuImnaHetdJpgkFtrNg0pmqYAh1J72jHQpep4LoEZXx raYcelUzhbE7znF7oEFXpXQKiHnUjABhPYanxgTyMpEuqngWRQdbT6eqIi0x5dWYjinr SJr62FQZst30m0AG2ifTyKIaJ6crgTWPV/XoJIoT/iVZ0XuXs5cqxhVD4hAIaqb+wBnG an6U95Q8X8fE2RUkmtq9dzzGCn/XBcEAEi9lsoJPqcYR+aIa111Ic65IhrqJ+5ksZg8f qadUuMFQ9kNhq+wfKEGlFUigkJTY0R1hN324s9wL59rDzHUZsx4cpMGRKUTlLMukMo19 Zymg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Nw4nnpUr; 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 w3si17669635ybu.245.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=Nw4nnpUr; 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]:48024 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboPJ-0000X8-9B for patch@linaro.org; Sat, 16 Oct 2021 14:27:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41048) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mboDY-0008NT-Jh for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:38 -0400 Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]:35754) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mboDR-0001xr-39 for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:36 -0400 Received: by mail-pg1-x52d.google.com with SMTP id e7so11819822pgk.2 for ; Sat, 16 Oct 2021 11:15:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=R6dlxti+/N1vnkKixu8IUh/Zl8M8i7vv7yb2sO8QtGA=; b=Nw4nnpUrrNErr/bQDZR8AUtn7/83glNpbtWLC+s2SgRYl4cwSc/36p9lIcgj5oOf7V /4s/zVe/65tDMJuKXouPB8yEzTaYTYRAnW1TWfnZAAEqiENmSC7yE7rHs9kecbckzwIC oocqwNmxpNXqSdedOqXkZF3TF6MgeWiOnTUguo4Rj0UVy+/voIV1PG7zvNNR2ntXZtlW JyqlVFWomCHVn9P7VGQc3uvqm/qfpOkFTRGFVhOXKvQg7iO8oBwJK840h5LZZguezPcf LOIpKohVl/TzvuFFmRfvfyls/EBdyZg9o6vJfna9RDFtWI3KrVUzYmHY2LgHlZPQxNch zTMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=R6dlxti+/N1vnkKixu8IUh/Zl8M8i7vv7yb2sO8QtGA=; b=XVsLQIgl89OipTIDu3p0go73NjUtcoEyFMGZfRqWlPhNR9A/f2HZ/d3oaepCb7cu9j MwUIybSHX8JZO5z5EP7LwlONQeP8+coeoPqXnua6Mm2fC4c0qDmC2Riga7xFcz7nLbpl nFED8JrSL7TQAJoSC+QBC722iuYfWOHdr3hGRtYHWVo4oz4wj+4D/X5sO/yKCuOB4fDb TSRzr/Hlz/GutAIT+PRUuZcWNEh13VJU6DHj+1Npls281epeCv8TzvKc0CHZB46hsrDk oebCjoi+x7b3Tt1qJqJnL/2ZmazrbZFE2/o2jQdiBTDl4IYOeScdTpPHpXVsbczUTWXr ZLYg== X-Gm-Message-State: AOAM531LmxD5DHO7P3lF1/KV1o9To56IPt7ieHgi2bSpt/Otf8ChJd2C owdFTIM09DVeL2ddJ2/7MbyMaNkl4vj5Sw== X-Received: by 2002:a63:e116:: with SMTP id z22mr14629750pgh.223.1634408126740; Sat, 16 Oct 2021 11:15:26 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id ob5sm5075097pjb.2.2021.10.16.11.15.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Oct 2021 11:15:26 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 11/24] target/microblaze: Check CF_NO_GOTO_TB for DISAS_JUMP Date: Sat, 16 Oct 2021 11:15:01 -0700 Message-Id: <20211016181514.3165661-12-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::52d; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52d.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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We were using singlestep_enabled as a proxy for whether translator_use_goto_tb would always return false. Signed-off-by: Richard Henderson --- target/microblaze/translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.25.1 diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index a14ffed784..7e465b629a 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -1779,7 +1779,7 @@ static void mb_tr_tb_stop(DisasContextBase *dcb, CPUState *cs) break; case DISAS_JUMP: - if (dc->jmp_dest != -1 && !cs->singlestep_enabled) { + if (dc->jmp_dest != -1 && !(tb_cflags(dc->base.tb) & CF_NO_GOTO_TB)) { /* Direct jump. */ tcg_gen_discard_i32(cpu_btarget); @@ -1804,7 +1804,7 @@ static void mb_tr_tb_stop(DisasContextBase *dcb, CPUState *cs) return; } - /* Indirect jump (or direct jump w/ singlestep) */ + /* Indirect jump (or direct jump w/ goto_tb disabled) */ tcg_gen_mov_i32(cpu_pc, cpu_btarget); tcg_gen_discard_i32(cpu_btarget); From patchwork Sat Oct 16 18:15:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515881 Delivered-To: patch@linaro.org Received: by 2002:ac0:cd8c:0:0:0:0:0 with SMTP id d12csp132919imp; Sat, 16 Oct 2021 11:21:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJNMgoMAcN36Qa1AYvlO8wkPOHOpJRJYOZy/Wm5oafHz5InnqyTaclO++pLZ11d2S3En+E X-Received: by 2002:a37:a5c1:: with SMTP id o184mr15472926qke.9.1634408488418; Sat, 16 Oct 2021 11:21:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634408488; cv=none; d=google.com; s=arc-20160816; b=hDeRGES0Ob4AFxhSI06Ajak/nyaVlQqTQ4Ijr+FffblY9TCotk4/QlDhNSSN4nyAgJ LfTqWJHVklOYITFxudVPYMwd/stcUlkluSjCUoEYpAd7w0DsbTViytwwsbNCMF9z0rG6 FIiNI2vwUNBMwSxrp9KHdEhbsu9rgccjrbIux9xEMQ5vPrsL4wBZ0PFZmAHoV8r6brw7 mDLi2477bzSAYOMIVeXrktAHSEtfI6VnMidCBjkXQUNqBiM0XYfLj7W4hAe+IxLc0IOW z5mGzHNbfghGwZL+M379hTy01fHeRlED0FK4hG4OwQHR28PHANCAU9aSrcTF7+lJ6rlr z+dQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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=RDO2b1TAF4ztgLUbPUMoAMU1yhwWU0vJ3YMD4i8Z5ck=; b=nJgze7mbtA0bETBzPNJXZ3717LU140kNH8m7woNor3UOcaH5KFJC3sQHpamWCm8Wza BI7c2XQPUTEsVLSDXSC80c8cWPrBzf47RHiML1Lv7ZvMzBqKjAoNN0qXPqiYB0HiFVqF mXg941ex2HX22TNZc77LCwvRI5YXDt1d1kfivwq+WJui1j5hMqs3MDGhVHMpzYqUrffl LdPLRXcnj5jtpaShSQZcHZiQxHzKxplhqf78PijWGWERD/M2Qq52WvqyPqyKx+fELxjv GC0h0TJEdh5ZKRO3q+GvrVOeNU+lHgJLj/jYiK9ltJgASOIgC+KHojn+wNwW2Op3bouk b7qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=doB1pcZ0; 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 y3si6313218qky.130.2021.10.16.11.21.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 16 Oct 2021 11:21:28 -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=doB1pcZ0; 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]:33178 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboJD-0007PK-OU for patch@linaro.org; Sat, 16 Oct 2021 14:21:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40972) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mboDW-0008LX-3s for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:35 -0400 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]:51798) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mboDR-0001yb-0N for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:31 -0400 Received: by mail-pj1-x102f.google.com with SMTP id kk10so9497995pjb.1 for ; Sat, 16 Oct 2021 11:15:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=RDO2b1TAF4ztgLUbPUMoAMU1yhwWU0vJ3YMD4i8Z5ck=; b=doB1pcZ0Q73Zg6NG0M8ks0CKrVw3bXNX10FWNGjPB+aEQaan10OrjHcvSrqlu8musq zzOUUv0P/zXTzOdtHO9L9VVmaaGMSxMtFnd1Eae8g9gv15DBMN8vXCHg/BNrCGUBVRQ1 Omk3WLBoiskGu1OsVDeX37geuLmiqk733T1b7/pvIZii+wkuAj9+KsiZiIqJk/tDfopB y5r5iMTGCFkmtUkZmrZXr57J0UhP9tYLdUwVZWM67VjywonLNa1q1mH4w8nRWYP8aHyc /N4C0AkVPenaZi0gRabTq6PLbjPGCU8VJdntCUfTKvZAPmkDzpwq7n1TEJvhj4G7A4j1 hY0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RDO2b1TAF4ztgLUbPUMoAMU1yhwWU0vJ3YMD4i8Z5ck=; b=IIJOjNdpsKMI3G6nhUiUnFtOoPfMmRwwQ+qH1sKt+rUlIVSd15XnTtrRNozYIomtnl 0VQuhkf7JK2ENiOtFMDXAiFBkBqxYIaHPO1t/EphXuwtCNtoMlfRpDyEOlZWFV6g/ej6 XpUbLsYJejRI6QgkoJpBwcw1eqdzh49UTwMuBPKbeir7ZD39kH7pMePfcFnsQ6Fu6ftS jxg25CPMw7PhDseHQwRfQTJV+VOdZjml4EyjiqYeeoP7wstDuM7NCXdeD7Imm3ykXq72 krn9ZyIr5zDXX6vGprDoENuXDEbAGUAoBgyvyo+olv34fLkRlTMLW4aojG+so0UQ0xRU AEKg== X-Gm-Message-State: AOAM533HqJi9aZbKY2/JsT7XaDkcea7DBqn1I3ymWl5kK69i3aMGsym2 eZUODTWugaqsLMY/yx98vTmlxPvoCMhDxQ== X-Received: by 2002:a17:90b:1d8e:: with SMTP id pf14mr21696301pjb.125.1634408127429; Sat, 16 Oct 2021 11:15:27 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id ob5sm5075097pjb.2.2021.10.16.11.15.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Oct 2021 11:15:27 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 12/24] target/microblaze: Drop checks for singlestep_enabled Date: Sat, 16 Oct 2021 11:15:02 -0700 Message-Id: <20211016181514.3165661-13-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::102f; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102f.google.com X-Spam_score_int: -1 X-Spam_score: -0.2 X-Spam_bar: / X-Spam_report: (-0.2 / 5.0 requ) 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" GDB single-stepping is now handled generically. Signed-off-by: Richard Henderson --- target/microblaze/translate.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) -- 2.25.1 diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index 7e465b629a..437bbed6d6 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -126,12 +126,7 @@ static void gen_raise_hw_excp(DisasContext *dc, uint32_t esr_ec) static void gen_goto_tb(DisasContext *dc, int n, target_ulong dest) { - if (dc->base.singlestep_enabled) { - TCGv_i32 tmp = tcg_const_i32(EXCP_DEBUG); - tcg_gen_movi_i32(cpu_pc, dest); - gen_helper_raise_exception(cpu_env, tmp); - tcg_temp_free_i32(tmp); - } else if (translator_use_goto_tb(&dc->base, dest)) { + if (translator_use_goto_tb(&dc->base, dest)) { tcg_gen_goto_tb(n); tcg_gen_movi_i32(cpu_pc, dest); tcg_gen_exit_tb(dc->base.tb, n); @@ -1807,12 +1802,7 @@ static void mb_tr_tb_stop(DisasContextBase *dcb, CPUState *cs) /* Indirect jump (or direct jump w/ goto_tb disabled) */ tcg_gen_mov_i32(cpu_pc, cpu_btarget); tcg_gen_discard_i32(cpu_btarget); - - if (unlikely(cs->singlestep_enabled)) { - gen_raise_exception(dc, EXCP_DEBUG); - } else { - tcg_gen_lookup_and_goto_ptr(); - } + tcg_gen_lookup_and_goto_ptr(); return; default: From patchwork Sat Oct 16 18:15:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515884 Delivered-To: patch@linaro.org Received: by 2002:ac0:cd8c:0:0:0:0:0 with SMTP id d12csp134627imp; Sat, 16 Oct 2021 11:23:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKfdX9qtv1vAU3de3RKDWPmgLV0tr3LNXZLlRRyODz13a10VfDpQsgRizjkad8g+vA6T6W X-Received: by 2002:a25:a527:: with SMTP id h36mr19546363ybi.106.1634408620551; Sat, 16 Oct 2021 11:23:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634408620; cv=none; d=google.com; s=arc-20160816; b=XAlMWzKoGr3Uevc/s1G0WdBj4X5s983WYZ4RaTLTz8HqMDyQau6Nu3l0aG4ZoFkpDE QU5oDjIQJze/Y4wcELDMZYcwQYrUmsaPhXfG63cvDLJqZx0sdzfooNZJC2oykj5jyfCj WH48yZ0xddIIKQ6IkGoHHFZIX907bZAxJ/wzm+zemXVG0EHqtiUKFLKw7bG9qjHzHhVW yaNq0G5jseFH+XXh+VNX/j9TXl4Z98igd37Bmt56qVed7mEy8tGPlT3c1rAb6oM4mq8t kx9hxFezVDAMYWyTPOEQy3VZ39lWXMY6llSn7P+kEZ0z+0SXRqJ9rDmIEME0JCUj4Lfg G5bQ== 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=aH4wmbhXo3MUB100CaL5SL6bOpUQ8oceNuJttk5Btqw=; b=tRsq3yYJdQ/BSd7EctDAXNQtvYoo5M7jmQaKkOtHaeNrtgcqhj3PFuT88tOkqvh8j8 3TMazgnee4Df/TYNqshjyBeX15vjKyQVJ8XwkUkSkgu/KGL97iw1VkI+ZQmUcJ4Z9iD9 ejkjCNBPsHHg2ABNwi+mut3pOSwBO/TTOo/bt9jqkSZX2qK1qMF9op+Do/ctaLMtctqq 59ZNz2OdE3qnUHb9DVZ6QBhGF4UlwoIo65ke/Y1WL4Is/EcwYnW5GZCX7S8WMh1PYegO J95sjY/o6QDU4WIXUjO31vDkm+GTGrKn38U0BffFNeR7zJRn8B9VqTuD35XtbjVgSm1Y 6XJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nZNEraTS; 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 n1si9742048ybo.500.2021.10.16.11.23.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 16 Oct 2021 11:23:40 -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=nZNEraTS; 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]:39374 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboLM-0003Gj-16 for patch@linaro.org; Sat, 16 Oct 2021 14:23:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41070) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mboDZ-0008NX-A7 for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:38 -0400 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]:52772) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mboDT-0001zt-1X for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:36 -0400 Received: by mail-pj1-x1032.google.com with SMTP id oa4so9488187pjb.2 for ; Sat, 16 Oct 2021 11:15:29 -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=aH4wmbhXo3MUB100CaL5SL6bOpUQ8oceNuJttk5Btqw=; b=nZNEraTSXkf6q40LDQT20Gpu1BJpVpEbzz7GikLaVyhipkDml90Sbpc0K9RXhDzWfq AWmKztujillLOFe64+YIsJ1c4FtExANRocXfan17HUN+lhu8c3P8HeLlNQytXW3o8va+ mPgESPW1Z6TUxRM526NBoaBSTIZy6g6i3qziD9E2hh4ThuXXeTlEgKgkMNvj0tXNkhpr SmEa3MnaI0IIkVsmAeZvgey6EfXpyZqgsVaG25xOwXgT4JqzpkuQoYZ6frbDojDLdz8z ovlhUNDhIsPepY/SdrCcwwOcpX/ngEfHM12UevGAvrPmhAsS/LO3MbPTmdZRxhYvjxQo udWQ== 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=aH4wmbhXo3MUB100CaL5SL6bOpUQ8oceNuJttk5Btqw=; b=HD9LsEpY/YGjcZwp4WKLI0ri10ojaCWOx0NWHPznWfcZcQyEhvhyuP7fNqo/JLyRIu qxciJX3Pn+ys1LAicJmctEsUvaQAF0BkNX72bZLYzb3RDJkAXR1e/cEAK48w0hmLUz1b +RZrFhBpAikz9jY83ewWOJxnqfJRplslOTRNEdQxQWS80k3hogQzPMZaljepsa5dGyw9 ESCxfb+3t33OmK+lcpkAdcOqPMonEuKlZX03OhXyxOrNsS77YiCyEcqWczX+BEE0UxZO qq0UbAU0JV+bsBSDuP8G8SpQSHjNC6DdLlWlKkhFRxtUvpQqm7Y15JZf/MNLrEB5SmXY aIdQ== X-Gm-Message-State: AOAM5333oi5xMiieqFkgifqGcT+hei+a4mbgOQEQvhPcDThoVnO+IqpT WJxFr7XTzOWVzpk6yQGDc9zROa31BeFLkQ== X-Received: by 2002:a17:90b:3e84:: with SMTP id rj4mr20101726pjb.177.1634408128149; Sat, 16 Oct 2021 11:15:28 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id ob5sm5075097pjb.2.2021.10.16.11.15.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Oct 2021 11:15:27 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 13/24] target/mips: Fix single stepping Date: Sat, 16 Oct 2021 11:15:03 -0700 Message-Id: <20211016181514.3165661-14-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::1032; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1032.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" As per an ancient comment in mips_tr_translate_insn about the expectations of gdb, when restarting the insn in a delay slot we also re-execute the branch. Which means that we are expected to execute two insns in this case. This has been broken since 8b86d6d2580, where we forced max_insns to 1 while single-stepping. This resulted in an exit from the translator loop after the branch but before the delay slot is translated. Increase the max_insns to 2 for this case. In addition, bypass the end-of-page check, for when the branch itself ends the page. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/mips/tcg/translate.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) -- 2.25.1 diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c index 148afec9dc..f239f9ffc0 100644 --- a/target/mips/tcg/translate.c +++ b/target/mips/tcg/translate.c @@ -16016,6 +16016,16 @@ static void mips_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs) ctx->default_tcg_memop_mask = (ctx->insn_flags & (ISA_MIPS_R6 | INSN_LOONGSON3A)) ? MO_UNALN : MO_ALIGN; + /* + * Execute a branch and its delay slot as a single instruction. + * This is what GDB expects and is consistent with what the + * hardware does (e.g. if a delay slot instruction faults, the + * reported PC is the PC of the branch). + */ + if (ctx->base.singlestep_enabled && (ctx->hflags & MIPS_HFLAG_BMASK)) { + ctx->base.max_insns = 2; + } + LOG_DISAS("\ntb %p idx %d hflags %04x\n", ctx->base.tb, ctx->mem_idx, ctx->hflags); } @@ -16085,17 +16095,14 @@ static void mips_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) if (ctx->base.is_jmp != DISAS_NEXT) { return; } + /* - * Execute a branch and its delay slot as a single instruction. - * This is what GDB expects and is consistent with what the - * hardware does (e.g. if a delay slot instruction faults, the - * reported PC is the PC of the branch). + * End the TB on (most) page crossings. + * See mips_tr_init_disas_context about single-stepping a branch + * together with its delay slot. */ - if (ctx->base.singlestep_enabled && - (ctx->hflags & MIPS_HFLAG_BMASK) == 0) { - ctx->base.is_jmp = DISAS_TOO_MANY; - } - if (ctx->base.pc_next - ctx->page_start >= TARGET_PAGE_SIZE) { + if (ctx->base.pc_next - ctx->page_start >= TARGET_PAGE_SIZE + && !ctx->base.singlestep_enabled) { ctx->base.is_jmp = DISAS_TOO_MANY; } } 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(); } } From patchwork Sat Oct 16 18:15:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515893 Delivered-To: patch@linaro.org Received: by 2002:ac0:cd8c:0:0:0:0:0 with SMTP id d12csp140560imp; Sat, 16 Oct 2021 11:32:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwObDcXo9XUSBSqZCsohXctI3Aks9Ebv03xlU5j21q77FbEt9SUpj1dypSKIrNmQaUAR6ds X-Received: by 2002:a05:6602:2c4c:: with SMTP id x12mr9096060iov.109.1634409164001; Sat, 16 Oct 2021 11:32:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634409163; cv=none; d=google.com; s=arc-20160816; b=Ht+OlmHqn2cRVLfTVL/8koPcLyh7GFrkEhE1vkF/Zx7d3BUJNXnAd2qetElfNIY2UO VYm1DMvMwnFwEX4Pz5tI1f0+oVrJt5zm8wd0zmZC6kHeuXhISVh3eOc0uP1oZEtAJGgY J5vvDeaECvTOw/+qUm6G0eHBLoGK7v23qHA6Vgdh2+0avVRLefjQRI5eZ5oFKE0XK9fz 3G+ylP7AjQHu7H3euVJE9+ATHWziVczsKvbNC8dkB+hTLNR8tcwQe73vzudE+suPVoPC 8D+3XKB0/pRbj7YzNdrDlBKoMGVa2auYlVkRWjDfkPIL2AzpiuU5yTNcyrWDYDzL0ou0 u7qw== 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=LSu5I85LJ7NrP6NesMckEJI2d8OPaq48KotVTNPiZYU=; b=NXrK7+vi/42bTki8HNhKqipALeC7WrtP01RLM5FUhByDRxx4TyN1H02GJ1OCxJGv/3 rRDIdyLkvMSx9Gk0zqASjRQty47ZwXptqUO/JwVJD66JFULeDZ1dx4W5s/IfI+BEnAay qHD/uPzqcUz9JYFhssK6YYvcZeG9qziW1eXLda72McjxIB8q87rCP5xmyFbgeeRQtIjy qGWT5fgXJTYrxFEYi6cBlpF+PVBmi5aGkemUFeSUQh8H+YuZLm0bE3Ub2l9ergF30gD3 VJMY2NEu8inMuLjL2QB3PUffohL18E3kw2g0xK2/IlqkKT5aUhyc+SxVJGgBk/Pf7Rin NsPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mqUjoUcg; 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 v3si292357ilm.175.2021.10.16.11.32.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 16 Oct 2021 11:32:43 -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=mqUjoUcg; 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]:59164 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboU7-0007zE-En for patch@linaro.org; Sat, 16 Oct 2021 14:32:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41118) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mboDb-0008Nk-2m for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:41 -0400 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]:41503) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mboDT-00021v-93 for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:38 -0400 Received: by mail-pj1-x1030.google.com with SMTP id na16-20020a17090b4c1000b0019f5bb661f9so9740806pjb.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=LSu5I85LJ7NrP6NesMckEJI2d8OPaq48KotVTNPiZYU=; b=mqUjoUcgUt4eABcbSe5Rgnn7FSF6WAuOswfGmcIh9t+yaP1z1AmCEeBMtCeKb3yyTq rs0kCIR2gWMlZ6SVQwJd26PwLGWboyL71eUqGn7QbQ0ObCp6Hf/fhz3DzeutvlZF26PJ KzeAxtuBQsMORlcja/kZrf9qrNtKdqW+Fvm6G/9NxSPW/VXtcMf/npzS68iF44UA/HYg F/DIph4HW/k4qNvJ4dZn23+FeI289gFEhzZciN5Tww9j0q1M81/up5M0pyJGT3X9MlZt H4MiOBNiVWL1KVt9o5/YJQm+AggOuN4b3cg8aaxFrnu4yheGb3V0ELoQwSI+DgJMzdyA NeFQ== 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=LSu5I85LJ7NrP6NesMckEJI2d8OPaq48KotVTNPiZYU=; b=PC/7E4B6PfvYZVUKMybki7E3obwMobgfur6tYiZ8zBR3Hx8QSl3k61/CPHTGRpHvcn hGWzXGByMqlVJVu0OQOkhJt9wuf9aD+a/n6FkODeaLho6qUjPrmj0uEtGYZuV+see/H6 j9RHTGHPHDdpM120FYMitApAvVUB1yKxc2LJwSUzDM9SV8Kv7EtPEJs04eepyrU2BckG 7x8aNEOehuw2UAx4czt68qF52Z3ariANgqIFWKGyMgsWo1ClrIUFfpyc+PvnNAr4BUDd erJOBEGVKjzZBYOwH7PWYdQ9bewI8s0v2KkTXNojFZ1Juj+GNYSbo2RzuHj0mFtKS9ed Vl6A== X-Gm-Message-State: AOAM533/PNtV6QbqQ+SfOww21QszMBWOh7z8OvBBKiqXRKphpFHLL7fD icfG/Aw3pQ73xIhZMvuObwr6BHQlJFPYbw== X-Received: by 2002:a17:90b:3504:: with SMTP id ls4mr21542901pjb.111.1634408129898; 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.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Oct 2021 11:15:29 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 15/24] target/openrisc: Drop checks for singlestep_enabled Date: Sat, 16 Oct 2021 11:15:05 -0700 Message-Id: <20211016181514.3165661-16-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::1030; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1030.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/openrisc/translate.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) -- 2.25.1 diff --git a/target/openrisc/translate.c b/target/openrisc/translate.c index 5f3d430245..ca79e609da 100644 --- a/target/openrisc/translate.c +++ b/target/openrisc/translate.c @@ -1659,11 +1659,7 @@ static void openrisc_tr_tb_stop(DisasContextBase *dcbase, CPUState *cs) /* The jump destination is indirect/computed; use jmp_pc. */ tcg_gen_mov_tl(cpu_pc, jmp_pc); tcg_gen_discard_tl(jmp_pc); - if (unlikely(dc->base.singlestep_enabled)) { - gen_exception(dc, EXCP_DEBUG); - } else { - tcg_gen_lookup_and_goto_ptr(); - } + tcg_gen_lookup_and_goto_ptr(); break; } /* The jump destination is direct; use jmp_pc_imm. @@ -1680,19 +1676,11 @@ static void openrisc_tr_tb_stop(DisasContextBase *dcbase, CPUState *cs) break; } tcg_gen_movi_tl(cpu_pc, jmp_dest); - if (unlikely(dc->base.singlestep_enabled)) { - gen_exception(dc, EXCP_DEBUG); - } else { - tcg_gen_lookup_and_goto_ptr(); - } + tcg_gen_lookup_and_goto_ptr(); break; case DISAS_EXIT: - if (unlikely(dc->base.singlestep_enabled)) { - gen_exception(dc, EXCP_DEBUG); - } else { - tcg_gen_exit_tb(NULL, 0); - } + tcg_gen_exit_tb(NULL, 0); break; default: g_assert_not_reached(); From patchwork Sat Oct 16 18:15:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515891 Delivered-To: patch@linaro.org Received: by 2002:ac0:cd8c:0:0:0:0:0 with SMTP id d12csp139782imp; Sat, 16 Oct 2021 11:31:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRp4a+pSAYiRMhQSlJA43Y7Pi+HtVy9u8DjFWmdaVHhx+66VV+PJ6tW56sEB+qsW4DerLP X-Received: by 2002:a92:cda5:: with SMTP id g5mr8403745ild.149.1634409093153; Sat, 16 Oct 2021 11:31:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634409093; cv=none; d=google.com; s=arc-20160816; b=0OY1ZjWr1cOX62/TG77pUBAO38fLo44PTmWc6WUUSKhrblJxR5Gkjp3ZhWsKc654VF hUNeAvjPLD7+Dn76VRY3B3SRQRy9//VlBqT9XztBQKQ6+vfmoAnSQp90OqyonFO1CDSH uYO9t4t+QDiAqMkIdgNZ19jWE2fDIW7hQCtB+r8dkLitdyq/KWXfX+eGNQlbvffrx4hT Jg28VzqgOLzIjDcEOFonojVGUTbASF51VZskzeLyJM6uXEqG2y+u4DaTV41SB9oi8x6b 3+B2KkQbRtleMq3LyVsbb3foB5uRSD/rm7Nnij2VeBP4EC0BwX/SeMmmAMQOVN2J/09c +lQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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=NHkVXGk0j5znwFvR9UOGNMQ7aEfwMBh0zYc+I8bw0PM=; b=beK4rqWE5Ez0Syz7e7n9OP3qyxjZZVMK7qwUzHfig/n5O7zqb4j8KX2LREBvWIh+Le KfMzTlUr2wSXErLt2kLkaCoqj++rpl7R9tn+TsO8yvcWsopOeus3aIj86xK64ivo/Hg1 E/9Itq9rwfg7j1SX4WOo7dqfsYzWQJbnIrUD+zBG/2kqqTJU9+lGWxqnaxRztw+8/PsC +roRJKrPjezkpmRDoQsagvafoXjfz00z4o5WNPxH9PHORu329A+v55U9vX6j+7tMSkMG QThPiLzA7NkANIDNL1YbWSA8uNermnLNnyHGRcCXK5nNh8GGaFiQkHQQUN7Edb44bfN3 BVyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BXNBzxm4; 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 d15si947220ioo.57.2021.10.16.11.31.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 16 Oct 2021 11:31:33 -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=BXNBzxm4; 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]:57008 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboSy-0006Zz-IO for patch@linaro.org; Sat, 16 Oct 2021 14:31:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41094) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mboDa-0008Ni-Kg for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:40 -0400 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]:52775) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mboDV-000244-Rt for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:38 -0400 Received: by mail-pj1-x1035.google.com with SMTP id oa4so9488210pjb.2 for ; Sat, 16 Oct 2021 11:15:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=NHkVXGk0j5znwFvR9UOGNMQ7aEfwMBh0zYc+I8bw0PM=; b=BXNBzxm4QV+69mPa4dOHiN6kufwdMMhuTfj8KleWCXQoIpc01HUpkKMZAKQ+VZSeac /Q87eMAlb9bm/a28vbSXTDGzZrubAB5mDPaMZHPflpeh9UoU6fAf6oA7IHaDwh5vRVlj v5Uw/gmOQW1tC6VdqrnHxRGmwEpHvTk8Mi87IA3JIzj7bOPuWyYQPHm22Kztwb4vN/yE GvrwvlJfKJOJUZCyBluTawuszG1ul55fE8fwrfolQOakllFQoEVIfVlf951PQRAvBs3v A+ekI2hIU20UYcRmRUcOOscEWe0j2Ni+s1lzO5scXlPIiRVaK3kFw3oLXGsdbjaZBTPE yCFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NHkVXGk0j5znwFvR9UOGNMQ7aEfwMBh0zYc+I8bw0PM=; b=wyJY/83Ew0Fc9/FT+1wsz17fASzfb9Y5A4QVwMcVWPTPGyCCAvXJTVTikp7nfgZBZQ uIk9aBWaCw77hlfFdt+lNRCjQkS2eTMjWQrsaLCkeQ8nWU6BEwPaFfueZ+/lmB21HAJs YlNfyA6R2jxNhqFjqQ4kcHYIyU+khQzYifKFWGMj56+nb6N4FsDOuywBA7Fh4q/esyNW bn1rBcJQZ9rWozFvbXqd7LEeqhPb3fIlEt3hE2IcoGlXNIwymjIc5YJ2AZgVudIgJuzx JF9H4ULF5awebvVLcGfqOmfsMGd7tTSKmBbMF5D+xnzmtVvnsdHzR2KTZNA5PCuljCPE aAKA== X-Gm-Message-State: AOAM530GDV4czmmDpL61QWM6/gqDtwKBGpbAm7eXHvqNaT/ghJsNBASw jSyfAOXT1SUje7feNFDnStRvnfEYq/Gz2Q== X-Received: by 2002:a17:90a:5d89:: with SMTP id t9mr13329615pji.21.1634408130624; Sat, 16 Oct 2021 11:15:30 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id ob5sm5075097pjb.2.2021.10.16.11.15.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Oct 2021 11:15:30 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 16/24] target/ppc: Drop exit checks for singlestep_enabled Date: Sat, 16 Oct 2021 11:15:06 -0700 Message-Id: <20211016181514.3165661-17-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::1035; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1035.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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" GDB single-stepping is now handled generically. Reuse gen_debug_exception to handle architectural debug exceptions. Signed-off-by: Richard Henderson --- target/ppc/translate.c | 38 ++++++++------------------------------ 1 file changed, 8 insertions(+), 30 deletions(-) -- 2.25.1 diff --git a/target/ppc/translate.c b/target/ppc/translate.c index 9ca78ee156..c3c6cb9589 100644 --- a/target/ppc/translate.c +++ b/target/ppc/translate.c @@ -42,7 +42,6 @@ #define CPU_SINGLE_STEP 0x1 #define CPU_BRANCH_STEP 0x2 -#define GDBSTUB_SINGLE_STEP 0x4 /* Include definitions for instructions classes and implementations flags */ /* #define PPC_DEBUG_DISAS */ @@ -333,7 +332,7 @@ static uint32_t gen_prep_dbgex(DisasContext *ctx) static void gen_debug_exception(DisasContext *ctx) { - gen_helper_raise_exception(cpu_env, tcg_constant_i32(EXCP_DEBUG)); + gen_helper_raise_exception(cpu_env, tcg_constant_i32(gen_prep_dbgex(ctx))); ctx->base.is_jmp = DISAS_NORETURN; } @@ -4309,15 +4308,8 @@ static inline bool use_goto_tb(DisasContext *ctx, target_ulong dest) static void gen_lookup_and_goto_ptr(DisasContext *ctx) { - int sse = ctx->singlestep_enabled; - if (unlikely(sse)) { - if (sse & GDBSTUB_SINGLE_STEP) { - gen_debug_exception(ctx); - } else if (sse & (CPU_SINGLE_STEP | CPU_BRANCH_STEP)) { - gen_helper_raise_exception(cpu_env, tcg_constant_i32(gen_prep_dbgex(ctx))); - } else { - tcg_gen_exit_tb(NULL, 0); - } + if (unlikely(ctx->singlestep_enabled)) { + gen_debug_exception(ctx); } else { tcg_gen_lookup_and_goto_ptr(); } @@ -8563,17 +8555,11 @@ static void ppc_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs) ctx->singlestep_enabled = 0; if ((hflags >> HFLAGS_SE) & 1) { ctx->singlestep_enabled |= CPU_SINGLE_STEP; + ctx->base.max_insns = 1; } if ((hflags >> HFLAGS_BE) & 1) { ctx->singlestep_enabled |= CPU_BRANCH_STEP; } - if (unlikely(ctx->base.singlestep_enabled)) { - ctx->singlestep_enabled |= GDBSTUB_SINGLE_STEP; - } - - if (ctx->singlestep_enabled & (CPU_SINGLE_STEP | GDBSTUB_SINGLE_STEP)) { - ctx->base.max_insns = 1; - } } static void ppc_tr_tb_start(DisasContextBase *db, CPUState *cs) @@ -8642,7 +8628,6 @@ static void ppc_tr_tb_stop(DisasContextBase *dcbase, CPUState *cs) DisasContext *ctx = container_of(dcbase, DisasContext, base); DisasJumpType is_jmp = ctx->base.is_jmp; target_ulong nip = ctx->base.pc_next; - int sse; if (is_jmp == DISAS_NORETURN) { /* We have already exited the TB. */ @@ -8650,8 +8635,8 @@ static void ppc_tr_tb_stop(DisasContextBase *dcbase, CPUState *cs) } /* Honor single stepping. */ - sse = ctx->singlestep_enabled & (CPU_SINGLE_STEP | GDBSTUB_SINGLE_STEP); - if (unlikely(sse)) { + if (unlikely(ctx->singlestep_enabled & CPU_SINGLE_STEP) + && (nip <= 0x100 || nip > 0xf00)) { switch (is_jmp) { case DISAS_TOO_MANY: case DISAS_EXIT_UPDATE: @@ -8665,15 +8650,8 @@ static void ppc_tr_tb_stop(DisasContextBase *dcbase, CPUState *cs) g_assert_not_reached(); } - if (sse & GDBSTUB_SINGLE_STEP) { - gen_debug_exception(ctx); - return; - } - /* else CPU_SINGLE_STEP... */ - if (nip <= 0x100 || nip > 0xf00) { - gen_helper_raise_exception(cpu_env, tcg_constant_i32(gen_prep_dbgex(ctx))); - return; - } + gen_debug_exception(ctx); + return; } switch (is_jmp) { From patchwork Sat Oct 16 18:15:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515894 Delivered-To: patch@linaro.org Received: by 2002:ac0:cd8c:0:0:0:0:0 with SMTP id d12csp142119imp; Sat, 16 Oct 2021 11:35:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzv8tlByycYBavtWU35wh9ed4PvLq60BaBDeNB4MQYRkIrtKFJ4cW1NwnwjU4GO6VHptbal X-Received: by 2002:a05:6e02:168c:: with SMTP id f12mr9129119ila.213.1634409320409; Sat, 16 Oct 2021 11:35:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634409320; cv=none; d=google.com; s=arc-20160816; b=k4eFB0a4TXAwI4oPvzbspsJNRNIuSNZ87ZIcj+e/iVJjtQKM7RgzTd/xA8g5dQ4sDr yjkSN4/3Rvc+xYhye65ZOb/aQzKN3lO/0EuJf8VogbdYKJMxUTtZA1dAlTdpUHM2tFr4 aaWj/yE2FiKQiDAm1GV7XU82ZVUlUAPRII9frH91iZs8TnOFQoH3uNHKbPZl+ITSfdbg Zqz8xRBGHdHPOsWCyOnlmPor0LL1jT0yWpHOCYkGaskIa4IZnadlsAbiSRa/F2iATXrb yfW9KaaHRCPY1FA6aJksAlJOXKcqYjnfdL8jYtUdRnqehMfDeRHCuMK4AKhMkeyoJTw2 QkRg== 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=KY0rIMTsgGM7jXkVqVg+Ek/vwWO39kztj/ovOnDV29c=; b=V6KCMrkG7Oxj8rErAjCd9Y30jSAVAZM2/W2i0UXql07piMfuTKKmlZ9i+e3HJex7nJ QoyYmfkrHDwVu9MFjEpC5l5quNYEvQaYL6L+fyMKgQ8T66/M2EFSVkHhR2vwXFsnIq8Z 15pIf+3SurOkku0d0F5Jk5fXThRlL1Pm6D2seIDDJcH2AvYmLyOFEBORZE6bVdGqGxTl faLGmhw3Nid9u214fpKjQH7DmjYwPj6JIqYTvOxT7xpHEb5FQmT6Yq0RSSRT1wCnqAw2 ZxkdEUV3b1UreN63Nd0OL4VeHZyITIUSFJ8qx9cW4Z9V3yDbi5xneDCS4DvkLM1+D8L7 YAsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xGgfLehb; 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 x11si13446308ilv.79.2021.10.16.11.35.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 16 Oct 2021 11:35:20 -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=xGgfLehb; 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]:37520 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboWd-00045G-S2 for patch@linaro.org; Sat, 16 Oct 2021 14:35:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41132) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mboDc-0008OF-A8 for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:41 -0400 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]:39716) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mboDX-00025D-00 for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:40 -0400 Received: by mail-pg1-x536.google.com with SMTP id g184so11779992pgc.6 for ; Sat, 16 Oct 2021 11:15:32 -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=KY0rIMTsgGM7jXkVqVg+Ek/vwWO39kztj/ovOnDV29c=; b=xGgfLehbgA3QyljRRgsEFJC0b+/lY4eqMCh0nrIogj0j26DxcDficZswbP6OEMnblN O33h4kftHAQy0vG6lADTbdkdKPUz3oVW10RqVT3nP1xy5hNMYW9rjMt2v8sc6z+SJXjr WbCYiOzyVsdHLjm77jqbifpbjlwcNemYffJwbOwSQFdf/wB8sQjKBSoC7Bdy5Ef+wANu rfSxXcc4c1mwABqrZ7QpZLaYSdaaHn2nbyPatakjceTD9KXPklMziOsgMQSk30ChBri+ +ju3QUhcmPnsUUeAGwo10QBOYBR8OyCc4MNuaH9ul8c5Alt2pzQ7qrb4hrq0aAayDobq r9zQ== 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=KY0rIMTsgGM7jXkVqVg+Ek/vwWO39kztj/ovOnDV29c=; b=xiayje2p6n0gZeWdYu31PuAD6Zz9d2CApnHCakWju4xrLG8H7X3JxhW7ppdPrgtQMO cDpigc4YTlifFlq8fl5d9o9ttjhkEKphPL5V842dgHSU5MEuIvPRdC0b49AeEao41VV0 o5i+a7eVO1En8xGgpc2JaypB/RlQ3uycU6nSDepu8D81p054KQoxcqVfNPbKn6iYP4lU QNgZtAgMetYJKzvSuxyNGh6yOt4CftzLFmM/pahZGYaN9W7GpqpZUYB62xilARO98Pqu ooz+Lk1KGzfjCrUlcRgRcTvd4HgM6vbN7z6x3JDy/07btIAMnk22fdVf5Z+tPIKKgIps 7QdQ== X-Gm-Message-State: AOAM531b51q8LhCYAfUGJhDmehwmHCJIVmTzKQNczmO6oYBtVkbQ4/Vp S0y3S3PF+Di9e1/tcj7NqSaF797kQu3IcA== X-Received: by 2002:a63:7d0f:: with SMTP id y15mr14963752pgc.446.1634408131486; Sat, 16 Oct 2021 11:15:31 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id ob5sm5075097pjb.2.2021.10.16.11.15.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Oct 2021 11:15:31 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 17/24] target/riscv: Remove dead code after exception Date: Sat, 16 Oct 2021 11:15:07 -0700 Message-Id: <20211016181514.3165661-18-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::536; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x536.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: Alistair Francis Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We have already set DISAS_NORETURN in generate_exception, which makes the exit_tb unreachable. Reviewed-by: Alistair Francis Signed-off-by: Richard Henderson --- target/riscv/insn_trans/trans_privileged.c.inc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) -- 2.25.1 diff --git a/target/riscv/insn_trans/trans_privileged.c.inc b/target/riscv/insn_trans/trans_privileged.c.inc index 32312be202..a7afcb15ce 100644 --- a/target/riscv/insn_trans/trans_privileged.c.inc +++ b/target/riscv/insn_trans/trans_privileged.c.inc @@ -22,8 +22,6 @@ static bool trans_ecall(DisasContext *ctx, arg_ecall *a) { /* always generates U-level ECALL, fixed in do_interrupt handler */ generate_exception(ctx, RISCV_EXCP_U_ECALL); - exit_tb(ctx); /* no chaining */ - ctx->base.is_jmp = DISAS_NORETURN; return true; } @@ -60,13 +58,11 @@ static bool trans_ebreak(DisasContext *ctx, arg_ebreak *a) post = opcode_at(&ctx->base, post_addr); } - if (pre == 0x01f01013 && ebreak == 0x00100073 && post == 0x40705013) { + if (pre == 0x01f01013 && ebreak == 0x00100073 && post == 0x40705013) { generate_exception(ctx, RISCV_EXCP_SEMIHOST); } else { generate_exception(ctx, RISCV_EXCP_BREAKPOINT); } - exit_tb(ctx); /* no chaining */ - ctx->base.is_jmp = DISAS_NORETURN; return true; } From patchwork Sat Oct 16 18:15:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515886 Delivered-To: patch@linaro.org Received: by 2002:ac0:cd8c:0:0:0:0:0 with SMTP id d12csp137204imp; Sat, 16 Oct 2021 11:27:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKz4NiZ3nQZIZcHYYU9cqnEdYL/UDbcDd3fVXmyEAGwvaj+Gzk3XDu6TwbPQ5jzqT2kaEl X-Received: by 2002:a25:b447:: with SMTP id c7mr20148280ybg.214.1634408863738; Sat, 16 Oct 2021 11:27:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634408863; cv=none; d=google.com; s=arc-20160816; b=W4kkd/YPoUMilq7wdPZ024ZbQ2aK1gaUUN0UrS0Y7E+1vYWE7vq0hcZCH86I8kIpEH Q3Ziw6juIyikgalRpBSok7tlfD73NcNI3c7fHteDSIMUdw/1TIYZPLeoPHdX2TRTpQc9 b0HRt4GXsSGNwyWgA8zQro0A18XQb7VlGi3MED0GdcZtTAzOgX8MtEKCtQLTr/cLu1AT tFgQ47ElOmTjLd5APMXe9KrXYPOg5iDSBzZTIB6P+lC3hYGgVlbUoHBVUJ5lN5DjcIKC g63sCJJcc4JiBEUozbIsPo1jfwCvH98h6M82femap2YY+R8ZvaPefFYLPUEcnYz0a8TX 1LIw== 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=c5EhHQQDifSPFgUkD65aCkDjg20V3dEMIS1pmXt2CpQ=; b=pIYK9iQAnLCu9tTxi2uY1Pg3fniEmKYMUErSc9vF2wA9ixaE9bcrHrhrTgw1aNXKKU bYHsQs1siCIEGhj+woIvu5glPfBrN3pC9SDImYlGPgUYycMgg3VfeBscKKisBCLTLCJx vUU/kTRSFlVmxXbh9J9Fk0ceE7GGZ4D0rP+qPPCRG0gdSaZIsORofIZBoWjSuARfwaLz tvXiZTBejM29387bzzGpksxlOG8gRyKN0m8ckyg5gdEhNNAnugl5SS4sq6U4sVs1/RYg iklT2qyau0Fi2hWCpY2fnYGkKKP+OPBTlEuUyOYt7EmtuMuIZP+GZCKgJgj/jKn25KeW PLEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lDSC4dey; 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 z9si12105491ybn.126.2021.10.16.11.27.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 16 Oct 2021 11:27:43 -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=lDSC4dey; 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]:47756 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboPH-0000Lg-3h for patch@linaro.org; Sat, 16 Oct 2021 14:27:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41142) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mboDc-0008OL-Mz for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:41 -0400 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]:39884) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mboDX-00025J-E9 for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:40 -0400 Received: by mail-pj1-x1029.google.com with SMTP id ls18-20020a17090b351200b001a00250584aso11653913pjb.4 for ; Sat, 16 Oct 2021 11:15:33 -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=c5EhHQQDifSPFgUkD65aCkDjg20V3dEMIS1pmXt2CpQ=; b=lDSC4deyx0uyu1gpqEqS0tOuiUWZ/iSmL1Z55oBD6wvyKNWgSiDSD3EIgiL9SCTa1Q lIcPb60BXg3/C6ALNK08pf6SFBdWQDYRX0lFoFv2zV5yzNkRRyQdSjgr3AYnGqrl2aDx Mwd4EpurkIG0erMJOHmsh6RyJM6M1Hp1gSqUmJpU1WTmlrzz1MUk3+KftBgzIZqAuKg8 yez9QT/S+8F4XhNjxQdgHv6EEjkyEmSPjR1agOOeKIiZ9B//LUf/ZaBmsu2wYfAkiwpG kvu9FA5A2muBidASfv/e4LAB0dUZlJeUNuh6sPnVSFVV/1OwSK5KG0ry3/XbXb8lcLIm dCmg== 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=c5EhHQQDifSPFgUkD65aCkDjg20V3dEMIS1pmXt2CpQ=; b=BnRZTOT5dGD4DiJNRVORPUeEg7jkUuSzZqPChEEXd+cjQ+JDqGtApqpHqcFnQWp2gD cqq2i6gNAGgdYiER1KVK/kvuXNepFuU4Hjf32tKORO9pWoMaOOsNtL5pXsRnKxmR5S4l dKPkBsM15rq+2yiHbpz7cRxfiKlRmDG+FAc5/cgS2hrxfipqZ/5cvCvbUhYYg/WdaezA juelF0GkkRNtt7zItNQCgAUfKlsxOqSTx12F/wN2RZ6SzAD7EqrM/jT6rWULizdiC/9f JIkA83zQeplintAr12PpOa6nvtXtDikmr/1A2c4pFl/8zC2KH92MOEfrgaiizQNmSCAP l80g== X-Gm-Message-State: AOAM533M6uYgrpc12LPIfdMhMvZAHLXwXvBlp32VC0FQkJe9yt6RsRSV tiPtx8eXaccEnJW6wMJ3uD4c0sTGwyHC9g== X-Received: by 2002:a17:90a:51:: with SMTP id 17mr21926206pjb.185.1634408132218; Sat, 16 Oct 2021 11:15:32 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id ob5sm5075097pjb.2.2021.10.16.11.15.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Oct 2021 11:15:31 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 18/24] target/riscv: Remove exit_tb and lookup_and_goto_ptr Date: Sat, 16 Oct 2021 11:15:08 -0700 Message-Id: <20211016181514.3165661-19-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::1029; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1029.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: Alistair Francis Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" GDB single-stepping is now handled generically, which means we don't need to do anything in the wrappers. Reviewed-by: Alistair Francis Signed-off-by: Richard Henderson --- target/riscv/translate.c | 27 +------------------ .../riscv/insn_trans/trans_privileged.c.inc | 4 +-- target/riscv/insn_trans/trans_rvi.c.inc | 8 +++--- target/riscv/insn_trans/trans_rvv.c.inc | 2 +- 4 files changed, 7 insertions(+), 34 deletions(-) -- 2.25.1 diff --git a/target/riscv/translate.c b/target/riscv/translate.c index d2442f0cf5..6d7fbca1fa 100644 --- a/target/riscv/translate.c +++ b/target/riscv/translate.c @@ -149,31 +149,6 @@ static void generate_exception_mtval(DisasContext *ctx, int excp) ctx->base.is_jmp = DISAS_NORETURN; } -static void gen_exception_debug(void) -{ - gen_helper_raise_exception(cpu_env, tcg_constant_i32(EXCP_DEBUG)); -} - -/* Wrapper around tcg_gen_exit_tb that handles single stepping */ -static void exit_tb(DisasContext *ctx) -{ - if (ctx->base.singlestep_enabled) { - gen_exception_debug(); - } else { - tcg_gen_exit_tb(NULL, 0); - } -} - -/* Wrapper around tcg_gen_lookup_and_goto_ptr that handles single stepping */ -static void lookup_and_goto_ptr(DisasContext *ctx) -{ - if (ctx->base.singlestep_enabled) { - gen_exception_debug(); - } else { - tcg_gen_lookup_and_goto_ptr(); - } -} - static void gen_exception_illegal(DisasContext *ctx) { generate_exception(ctx, RISCV_EXCP_ILLEGAL_INST); @@ -192,7 +167,7 @@ static void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest) tcg_gen_exit_tb(ctx->base.tb, n); } else { tcg_gen_movi_tl(cpu_pc, dest); - lookup_and_goto_ptr(ctx); + tcg_gen_lookup_and_goto_ptr(); } } diff --git a/target/riscv/insn_trans/trans_privileged.c.inc b/target/riscv/insn_trans/trans_privileged.c.inc index a7afcb15ce..75c6ef80a6 100644 --- a/target/riscv/insn_trans/trans_privileged.c.inc +++ b/target/riscv/insn_trans/trans_privileged.c.inc @@ -78,7 +78,7 @@ static bool trans_sret(DisasContext *ctx, arg_sret *a) if (has_ext(ctx, RVS)) { gen_helper_sret(cpu_pc, cpu_env, cpu_pc); - exit_tb(ctx); /* no chaining */ + tcg_gen_exit_tb(NULL, 0); /* no chaining */ ctx->base.is_jmp = DISAS_NORETURN; } else { return false; @@ -94,7 +94,7 @@ static bool trans_mret(DisasContext *ctx, arg_mret *a) #ifndef CONFIG_USER_ONLY tcg_gen_movi_tl(cpu_pc, ctx->base.pc_next); gen_helper_mret(cpu_pc, cpu_env, cpu_pc); - exit_tb(ctx); /* no chaining */ + tcg_gen_exit_tb(NULL, 0); /* no chaining */ ctx->base.is_jmp = DISAS_NORETURN; return true; #else diff --git a/target/riscv/insn_trans/trans_rvi.c.inc b/target/riscv/insn_trans/trans_rvi.c.inc index 920ae0edb3..a6a57c94bb 100644 --- a/target/riscv/insn_trans/trans_rvi.c.inc +++ b/target/riscv/insn_trans/trans_rvi.c.inc @@ -71,9 +71,7 @@ static bool trans_jalr(DisasContext *ctx, arg_jalr *a) if (a->rd != 0) { tcg_gen_movi_tl(cpu_gpr[a->rd], ctx->pc_succ_insn); } - - /* No chaining with JALR. */ - lookup_and_goto_ptr(ctx); + tcg_gen_lookup_and_goto_ptr(); if (misaligned) { gen_set_label(misaligned); @@ -421,7 +419,7 @@ static bool trans_fence_i(DisasContext *ctx, arg_fence_i *a) * however we need to end the translation block */ tcg_gen_movi_tl(cpu_pc, ctx->pc_succ_insn); - exit_tb(ctx); + tcg_gen_exit_tb(NULL, 0); ctx->base.is_jmp = DISAS_NORETURN; return true; } @@ -430,7 +428,7 @@ static bool do_csr_post(DisasContext *ctx) { /* We may have changed important cpu state -- exit to main loop. */ tcg_gen_movi_tl(cpu_pc, ctx->pc_succ_insn); - exit_tb(ctx); + tcg_gen_exit_tb(NULL, 0); ctx->base.is_jmp = DISAS_NORETURN; return true; } diff --git a/target/riscv/insn_trans/trans_rvv.c.inc b/target/riscv/insn_trans/trans_rvv.c.inc index fa451938f1..081a5ca34d 100644 --- a/target/riscv/insn_trans/trans_rvv.c.inc +++ b/target/riscv/insn_trans/trans_rvv.c.inc @@ -41,7 +41,7 @@ static bool trans_vsetvl(DisasContext *ctx, arg_vsetvl *a) gen_set_gpr(ctx, a->rd, dst); tcg_gen_movi_tl(cpu_pc, ctx->pc_succ_insn); - lookup_and_goto_ptr(ctx); + tcg_gen_lookup_and_goto_ptr(); ctx->base.is_jmp = DISAS_NORETURN; return true; } From patchwork Sat Oct 16 18:15:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515890 Delivered-To: patch@linaro.org Received: by 2002:ac0:cd8c:0:0:0:0:0 with SMTP id d12csp139589imp; Sat, 16 Oct 2021 11:31:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwuxFhMu9OB7g2TyvSfE+ZBBt2VRZdMfymwdFZ/TNcayTtcfuBu2GrNxSfAnpyrTGVXVPgp X-Received: by 2002:a92:c246:: with SMTP id k6mr8297546ilo.201.1634409079996; Sat, 16 Oct 2021 11:31:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634409079; cv=none; d=google.com; s=arc-20160816; b=AXB6jST+x1xKKmrZUPPBhaMfb5ZbaleVKq1NiOF+RKUQ+zr5Su9ajx08bzCIZtuRy+ 5srGbKVX0l3xNFkUA8iMRK/tn5jwS1NikeFXHRdeqRzB95hH7GsAQQUTr18UlXXIDBAb uVtv6fra2JQhmJf13f3N/Cdj9wnKqkC/JNPn/JpItYNvxGmaJV2n6m64F7Mpe/yJny0Y LsFqy5KkTUl8qKkz966tLJ5v7PzPdw6UTYZoFkxVdBKy1k2dos9F1w4juNWiV+ijYUUl DJIElqnXfygEQsH/SZ54XOl6VHWPieJWKwTrdqm22XHhjq9ETG6ozpMicpHhAJjiWbS8 Bpaw== 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=Js0hOIKw65GpTS+Hl57060G5VKgpqQyhyy+p7V5A7kA=; b=HzKSmWJSPufy++TuD7iTSTjwJJf7oYx0nYnABI7mbMWZx4cLWgFq1Q6vb0hz6vg0zp TqtSxF3Ve22pKas41g0817O0Le6LGWwA/v2z3S9Rj1lujeFT0KTE70ugdfLwV7B0C5ap KaKj2B7dFwSTl/sFknvnXoiypc1j2DpRHcMXeiD0etyWFKg9CXp0OArXwPMKJZLGzkEp x07JjeVp84qIiw7fVZEuBFgQyqYQSrdRzx4nIrHMV2VuItc1hjxKyXBLFNSJv9zmCnyJ Z3ugEKKIlWJFUS8/3czhqFmAjIwc3wwTx1RaLNPhKdIGPmwGfNWrO6aT+MdHktOD8Bxj PwwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="CM7/q+sB"; 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 o15si15710541ilu.74.2021.10.16.11.31.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 16 Oct 2021 11:31:19 -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="CM7/q+sB"; 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]:56716 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboSl-0006Na-8i for patch@linaro.org; Sat, 16 Oct 2021 14:31:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41134) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mboDc-0008OG-D1 for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:41 -0400 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]:37600) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mboDX-00025U-HQ for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:40 -0400 Received: by mail-pg1-x52b.google.com with SMTP id s136so8558069pgs.4 for ; Sat, 16 Oct 2021 11:15:33 -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=Js0hOIKw65GpTS+Hl57060G5VKgpqQyhyy+p7V5A7kA=; b=CM7/q+sB2WRDGNXsfQV1Bq+rpd/P78WXCMw5xh02PO5vBuaM20G5jY5DPLDjf2dPuS wLnHMl8xeFiR0eSybMCFYd3mtw/HR6HjZasCTXWI8Ywdc1WkE6WYWZfjDHQ1RI5zzopC y6O6ryun9gr66dOdqIwSlKZOLSpQ4Q9fiKSCRRtPUHS7NIyYPDJQzScyPQG81ogPFr2A 8hhj6qONLGuYbCTlJbi6VYXHjmdhTGGDregOdiAzXJZ4hmXYYnLLKf46oiKIslROvmKv ipmSldUQMaUFdge2IKs54mZmTkirrX8P3hwFJg9WoC0poDfFbZh3pvomfLZolxToU5PU oTnQ== 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=Js0hOIKw65GpTS+Hl57060G5VKgpqQyhyy+p7V5A7kA=; b=DUwOukTc+uqIh5dkCLBRBOTRbM0qyRRPiLyegCXStA8MpM/2JvfK4fxEdzrVD9KuyZ xOWut55MZEFtdZM1dtAYrixY+jfgITgWhyGKHvNoFMoYS63Eupob6YytSTmGTUxZ1F5V 8bKohPRtwpXEHYb93PtXrkraLzIMHa4H6iIu2hqEquhxKLxUpAlf76DVnBjkQ+v/Ju2z rjtleHVYUZpbA3Y5b1kwpztH7C/m/oxa7iXkGXI4l/dQeSyd8jv3DodjlGOpz5Qf+nmz XxSYrxh2zcn/ij04YpBsjO2dpQWNKWT9rIoujHIcIVShRuU9R3M9mttkilzpIRWmzmy3 VtPg== X-Gm-Message-State: AOAM531b3z8RHYlf81L/4ew3BaztyZ6lbJHVP+ndtmR42eDx5acSNR2l ucvFNrWRG2MFFnPKyGkjRx9HHRGWS8cKAQ== X-Received: by 2002:a63:7c4e:: with SMTP id l14mr14769182pgn.389.1634408133018; Sat, 16 Oct 2021 11:15:33 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id ob5sm5075097pjb.2.2021.10.16.11.15.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Oct 2021 11:15:32 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 19/24] target/rx: Drop checks for singlestep_enabled Date: Sat, 16 Oct 2021 11:15:09 -0700 Message-Id: <20211016181514.3165661-20-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::52b; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52b.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/rx/helper.h | 1 - target/rx/op_helper.c | 8 -------- target/rx/translate.c | 12 ++---------- 3 files changed, 2 insertions(+), 19 deletions(-) -- 2.25.1 diff --git a/target/rx/helper.h b/target/rx/helper.h index f0b7ebbbf7..ebb4739474 100644 --- a/target/rx/helper.h +++ b/target/rx/helper.h @@ -2,7 +2,6 @@ DEF_HELPER_1(raise_illegal_instruction, noreturn, env) DEF_HELPER_1(raise_access_fault, noreturn, env) DEF_HELPER_1(raise_privilege_violation, noreturn, env) DEF_HELPER_1(wait, noreturn, env) -DEF_HELPER_1(debug, noreturn, env) DEF_HELPER_2(rxint, noreturn, env, i32) DEF_HELPER_1(rxbrk, noreturn, env) DEF_HELPER_FLAGS_3(fadd, TCG_CALL_NO_WG, f32, env, f32, f32) diff --git a/target/rx/op_helper.c b/target/rx/op_helper.c index 4d315b4449..11f952d340 100644 --- a/target/rx/op_helper.c +++ b/target/rx/op_helper.c @@ -451,14 +451,6 @@ void QEMU_NORETURN helper_wait(CPURXState *env) raise_exception(env, EXCP_HLT, 0); } -void QEMU_NORETURN helper_debug(CPURXState *env) -{ - CPUState *cs = env_cpu(env); - - cs->exception_index = EXCP_DEBUG; - cpu_loop_exit(cs); -} - void QEMU_NORETURN helper_rxint(CPURXState *env, uint32_t vec) { raise_exception(env, 0x100 + vec, 0); diff --git a/target/rx/translate.c b/target/rx/translate.c index a3cf720455..5db8f79a82 100644 --- a/target/rx/translate.c +++ b/target/rx/translate.c @@ -150,11 +150,7 @@ static void gen_goto_tb(DisasContext *dc, int n, target_ulong dest) tcg_gen_exit_tb(dc->base.tb, n); } else { tcg_gen_movi_i32(cpu_pc, dest); - if (dc->base.singlestep_enabled) { - gen_helper_debug(cpu_env); - } else { - tcg_gen_lookup_and_goto_ptr(); - } + tcg_gen_lookup_and_goto_ptr(); } dc->base.is_jmp = DISAS_NORETURN; } @@ -2331,11 +2327,7 @@ static void rx_tr_tb_stop(DisasContextBase *dcbase, CPUState *cs) gen_goto_tb(ctx, 0, dcbase->pc_next); break; case DISAS_JUMP: - if (ctx->base.singlestep_enabled) { - gen_helper_debug(cpu_env); - } else { - tcg_gen_lookup_and_goto_ptr(); - } + tcg_gen_lookup_and_goto_ptr(); break; case DISAS_UPDATE: tcg_gen_movi_i32(cpu_pc, ctx->base.pc_next); From patchwork Sat Oct 16 18:15:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515892 Delivered-To: patch@linaro.org Received: by 2002:ac0:cd8c:0:0:0:0:0 with SMTP id d12csp140499imp; Sat, 16 Oct 2021 11:32:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlf+vC0TZEqLHecg06U0d52uQIVuga4B/XRWNGtpUsWtPhMdfWRUXUoHorJEDLqe9DbF/3 X-Received: by 2002:a6b:ee0d:: with SMTP id i13mr8663456ioh.166.1634409158195; Sat, 16 Oct 2021 11:32:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634409158; cv=none; d=google.com; s=arc-20160816; b=LXHM2dMLRceNMJPtwtI2KH0B3rkYomBxqovTT9Vhw2lz/APuF/icf+ZyW1UaUfM7vm v/2c9l6mZonZkycX/sXEtGbR8pmdKvVBiCHZtzzrrtd5hpxzIx0id2l6z5WLwWc+IWdv v7DIomz/k8mR71tqd9hMN0FMLJLwIweSXzVncVlxRayuqtindMlulupHczmKVasuelvQ yLE83VSW07dl1ZZELNKmLuPW9tkrafXy7dy2BxFPQccCGJMegZ3dxOz6lrsqJ9muNK24 N1XZRADs56f0qXnClNOP/XZSabkghzzYfrkhWC/bbBCPAMMhKsWF0TCIiUFubBJMzt3n a/hQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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=JJxLTlxFu0AfTN8BnVgjMTGGYMK7HKK3rg1mTzBv8V4=; b=ySxNllgzBxXWR8idCnGF/XTacwexjyAMkPTzn1rlAKUgAXQRGtah9Bz9+u7gmHnvAO kPfsPREwGxE7U/Kv7X4VdRnHMzWl0lE6XgWVHcl1WO65Gt2x+LEWBdOcRkLJKdgo53za ktL57/iX9zx17VhCSCGtXtIHZGGdJJVR5Bm3VLksT5iZaHAVWJVT6IB6eJbTsPWrQtJP AfXNvjS1eLlQRwcFnY+79hS6K2YkJS5maaOs8DtwuBQKrTrM36DvKStqHTa1U+P6G7gi bdpytjF4Isd2VFxj96YWKeAQgkzHd9LxVuHozcqu6rZCOU66ZEWqJSmoMpBzI1dXRCZm QKLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dBTxRx5k; 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 e7si9676052jaf.112.2021.10.16.11.32.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 16 Oct 2021 11:32:38 -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=dBTxRx5k; 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]:58592 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboU1-0007cP-L1 for patch@linaro.org; Sat, 16 Oct 2021 14:32:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41154) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mboDc-0008ON-TC for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:42 -0400 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]:45705) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mboDX-00025r-Fx for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:40 -0400 Received: by mail-pl1-x636.google.com with SMTP id s1so6669649plg.12 for ; Sat, 16 Oct 2021 11:15:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=JJxLTlxFu0AfTN8BnVgjMTGGYMK7HKK3rg1mTzBv8V4=; b=dBTxRx5kdQAYhNnYlq9R7FHU41IPzOxuDLP0gPUn5FAwrX1LoyEMdJWz6t5B2VbDJv EMlYFRIP5zBUNGUKzI0zizxVjvMK+Bnq191MdrV4a/Irb2lp+g2vdKsV3fGTHBzIWItj funCHDrfV4oQhPexqmZBt1mMl0vq5yO9nJubAQxeknmlSTOjI8TNZ/TvdNLm0tpbH2fs HYIyJBaT7CzdYVW1oPukJ1D1cQftB5ArwrwsoKqZ9xj/AMMd0n5bhMbklTG2Jr12P2ph /BywkQQGpVFv7pDTTdb4QlmI6mKFuCXho0oyX9Ie4FebtRtnljzXxWNBMNPgXRKt6kTm /zvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JJxLTlxFu0AfTN8BnVgjMTGGYMK7HKK3rg1mTzBv8V4=; b=xxNr2Vpt0uxqIqblQxKR3gmLlBWz1D/nHZvq2EIPXJbba1Mee4oqjDvlrJc+3TV7Et ZmDVnXlQhmZBPtE5Q7/bMNjq5fFUCw+kHH24RUuazW0tiWYVx98SYz4UVeT7B0NUsClE c1TJa+cGFM/HwLeb/oS4gS2PVCOAbTzKf0xfrN6+N7zp4Dhw58NNWHTRm2xVjQ4Wr+xe k5G2SGv9KUeeMA/o+NK2+owgDUtHx06kEK9fmuz8zbDLZCrVJ3OCq3dr7cl6TpuD/EKF EesTseqhBrHQMhKBd0CVN7d31GsP+LDPrIqvEDXF3otumleqSuY4d5nviSruxsmH66aL AqGw== X-Gm-Message-State: AOAM533TFhhsHfk7CfNOJH2uSF2JTZ5hOXMblWKuAvZKP/G41ICJIOMI frTBb6XFJQ1h/i1u+5lglTFqnvLkfiM= X-Received: by 2002:a17:90a:a41:: with SMTP id o59mr36568579pjo.243.1634408133901; Sat, 16 Oct 2021 11:15:33 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id ob5sm5075097pjb.2.2021.10.16.11.15.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Oct 2021 11:15:33 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 20/24] target/s390x: Drop check for singlestep_enabled Date: Sat, 16 Oct 2021 11:15:10 -0700 Message-Id: <20211016181514.3165661-21-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::636; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x636.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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" GDB single-stepping is now handled generically. Signed-off-by: Richard Henderson --- target/s390x/tcg/translate.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) -- 2.25.1 diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index a2d6fa5cca..dcc249a197 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -149,7 +149,6 @@ struct DisasContext { uint64_t pc_tmp; uint32_t ilen; enum cc_op cc_op; - bool do_debug; }; /* Information carried about a condition to be evaluated. */ @@ -6544,7 +6543,6 @@ static void s390x_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs) dc->cc_op = CC_OP_DYNAMIC; dc->ex_value = dc->base.tb->cs_base; - dc->do_debug = dc->base.singlestep_enabled; } static void s390x_tr_tb_start(DisasContextBase *db, CPUState *cs) @@ -6596,10 +6594,8 @@ static void s390x_tr_tb_stop(DisasContextBase *dcbase, CPUState *cs) /* FALLTHRU */ case DISAS_PC_CC_UPDATED: /* Exit the TB, either by raising a debug exception or by return. */ - if (dc->do_debug) { - gen_exception(EXCP_DEBUG); - } else if ((dc->base.tb->flags & FLAG_MASK_PER) || - dc->base.is_jmp == DISAS_PC_STALE_NOCHAIN) { + if ((dc->base.tb->flags & FLAG_MASK_PER) || + dc->base.is_jmp == DISAS_PC_STALE_NOCHAIN) { tcg_gen_exit_tb(NULL, 0); } else { tcg_gen_lookup_and_goto_ptr(); From patchwork Sat Oct 16 18:15:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515897 Delivered-To: patch@linaro.org Received: by 2002:ac0:cd8c:0:0:0:0:0 with SMTP id d12csp144586imp; Sat, 16 Oct 2021 11:39:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxC4f2kY06A0qqoOtBcE6nVCah5GRgnO+1eMe3DYGZBFr2B/1ecGKPGATHySZ/mTcCtcJLt X-Received: by 2002:a25:1a46:: with SMTP id a67mr22012937yba.21.1634409543440; Sat, 16 Oct 2021 11:39:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634409543; cv=none; d=google.com; s=arc-20160816; b=nbV7E80r+207fNUzAdYEVqN2ihBQ37g+TxWreX9Xm0IMstp7SjrJcDAKZonsZSwxxp izrLOO8VY1uP5MKHQ5/+eqHNjPgsHQNgFSq5Ms2JhWr+iYEx4aw0ENFMZ2Ve/3/jfVZ+ zuEMuh+E6l5+M9c/J16CI+LJIoaXT0tHe4PCBpigv9d+f5DiwqtxxtTLo3PV2l5wvh1w I4rXc5xKo61zBWjRaK9k0fwBgMUeD+2aF+9Ulb3vj/cXuL3c1+k+JZboJ81OhP59r5cM Cn7Ni+BtHQajbfNmBzIlDOL/Tp+AKN7YYHD2c5AVcKRteSyITatpeIzsFFkp8FtFFVv0 mumA== 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=Lhm3i8dv7cISRiranLLYJSVbRTBKDG8gMQNChvdAMxQ=; b=ZXxdf7hWEtJ2ekGnKQFi5kwfGVKJZIXj+/3oDDlVcw3hPYKl+OtZd05N/IC6cWtMQ8 YaPCYpjvLWLfzoSr5QAV8i9m7RQGghFafdNoPzn467XiXeS3Ll0PJFAalx0j15wUMEfl E5qxtZNWSJFRe8+6eCqq0/ukc5RKffS/eMMtA1E0VQS5EeHQh3nQ4g7db/QXQ40qMBzl UCQUvW2PKseZelf93pKN/u00ryFbnJrXNvzNMW/A03F60lxl21cbqbo/G1xAEiOGd3nS 6lTFvpt4vUN9Z9IVKYa84WaNAB0xAy6rxiqofHga3RTGYfYFRY63vn4EXdm5TvGqkNH2 fRmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mjBe4Avo; 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 p9si9859944yba.254.2021.10.16.11.39.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 16 Oct 2021 11:39:03 -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=mjBe4Avo; 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]:46150 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboaE-0001Vs-Sm for patch@linaro.org; Sat, 16 Oct 2021 14:39:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41178) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mboDd-0008Og-PV for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:43 -0400 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]:53835) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mboDZ-000288-0G for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:41 -0400 Received: by mail-pj1-x102d.google.com with SMTP id ls18so9474594pjb.3 for ; Sat, 16 Oct 2021 11:15:35 -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=Lhm3i8dv7cISRiranLLYJSVbRTBKDG8gMQNChvdAMxQ=; b=mjBe4AvojHNphU2EhVIpblqpmvIIvhh8Dy3jl44UciNGaAvjSho5NRTn9GSOP4XvOv jt7FMnETzOxLLqpDxIWua/CCLrRrO7wp+fxkizZ17QSCstHfDdS1l6SyVaONnfGkk5+o ecWeQIsNU/I2IXpK+ENVEve5s/fDHwO2zIJADbEMofu/FQnDtk+gvXB6nQ4uAzvuGL/P AmFrDfQxVg7ZxGpB4WKVZPj43d8f2ASsgHuNTDUbvPoviwdApTrTOFnWzPazNhHEkSO3 O2eVU5DBcbegk9bOZ5tvuyRselFzmz9/azcUyYuA3hGZv8S05zvvBDdexc37XzBVjp2P l3wQ== 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=Lhm3i8dv7cISRiranLLYJSVbRTBKDG8gMQNChvdAMxQ=; b=SRt2W4Ceh9FiIhCzQt2HltWpQBO1npWQ5iuXbojGHLXkgjE0o029YJf+44OazG0XeK 7H0YX17Yr7J6A1j2a5aoV3GXhNs2L2qDVyj757roCnaRzxQG+domJqNQ5fdqPUVMDrlO W1fnR0H/OPXoucOie5bDg5EVAjIdjSiHVBHTeUnGkW7FO/30/Gf7Krwj2tQ/eE+Wj5fc NR+cYsROPNrZcAXk5lYGDOj+jnLHJF1W+m9nyAj7McYceZ6fqd0fEtkU88K9Fb+i/01h IUnThQj/E0iTlvCSGGf3aYY6dFoaIDfvJ5Oo5OLDptDOh/phXQN9r96cHsDKY5NaLkf5 V51g== X-Gm-Message-State: AOAM532e6s2P/H6cVXa35EG5kqvJ0ec8aFPWAZNfD1k2Sx/NlTy30KEa Llr4U1Ez2W2FFyNsnmp1ynZ0m7DM+QPPKA== X-Received: by 2002:a17:90b:4d08:: with SMTP id mw8mr12513619pjb.96.1634408134868; Sat, 16 Oct 2021 11:15:34 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id ob5sm5075097pjb.2.2021.10.16.11.15.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Oct 2021 11:15:34 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 21/24] target/sh4: Drop check for singlestep_enabled Date: Sat, 16 Oct 2021 11:15:11 -0700 Message-Id: <20211016181514.3165661-22-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::102d; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102d.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/sh4/helper.h | 1 - target/sh4/op_helper.c | 5 ----- target/sh4/translate.c | 14 +++----------- 3 files changed, 3 insertions(+), 17 deletions(-) -- 2.25.1 diff --git a/target/sh4/helper.h b/target/sh4/helper.h index 1e768fcbc7..8d792f6b55 100644 --- a/target/sh4/helper.h +++ b/target/sh4/helper.h @@ -3,7 +3,6 @@ DEF_HELPER_1(raise_illegal_instruction, noreturn, env) DEF_HELPER_1(raise_slot_illegal_instruction, noreturn, env) DEF_HELPER_1(raise_fpu_disable, noreturn, env) DEF_HELPER_1(raise_slot_fpu_disable, noreturn, env) -DEF_HELPER_1(debug, noreturn, env) DEF_HELPER_1(sleep, noreturn, env) DEF_HELPER_2(trapa, noreturn, env, i32) DEF_HELPER_1(exclusive, noreturn, env) diff --git a/target/sh4/op_helper.c b/target/sh4/op_helper.c index c0cbb95382..c996dce7df 100644 --- a/target/sh4/op_helper.c +++ b/target/sh4/op_helper.c @@ -81,11 +81,6 @@ void helper_raise_slot_fpu_disable(CPUSH4State *env) raise_exception(env, 0x820, 0); } -void helper_debug(CPUSH4State *env) -{ - raise_exception(env, EXCP_DEBUG, 0); -} - void helper_sleep(CPUSH4State *env) { CPUState *cs = env_cpu(env); diff --git a/target/sh4/translate.c b/target/sh4/translate.c index d363050272..ce5d674a52 100644 --- a/target/sh4/translate.c +++ b/target/sh4/translate.c @@ -240,9 +240,7 @@ static void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest) tcg_gen_exit_tb(ctx->base.tb, n); } else { tcg_gen_movi_i32(cpu_pc, dest); - if (ctx->base.singlestep_enabled) { - gen_helper_debug(cpu_env); - } else if (use_exit_tb(ctx)) { + if (use_exit_tb(ctx)) { tcg_gen_exit_tb(NULL, 0); } else { tcg_gen_lookup_and_goto_ptr(); @@ -258,9 +256,7 @@ static void gen_jump(DisasContext * ctx) delayed jump as immediate jump are conditinal jumps */ tcg_gen_mov_i32(cpu_pc, cpu_delayed_pc); tcg_gen_discard_i32(cpu_delayed_pc); - if (ctx->base.singlestep_enabled) { - gen_helper_debug(cpu_env); - } else if (use_exit_tb(ctx)) { + if (use_exit_tb(ctx)) { tcg_gen_exit_tb(NULL, 0); } else { tcg_gen_lookup_and_goto_ptr(); @@ -2324,11 +2320,7 @@ static void sh4_tr_tb_stop(DisasContextBase *dcbase, CPUState *cs) switch (ctx->base.is_jmp) { case DISAS_STOP: gen_save_cpu_state(ctx, true); - if (ctx->base.singlestep_enabled) { - gen_helper_debug(cpu_env); - } else { - tcg_gen_exit_tb(NULL, 0); - } + tcg_gen_exit_tb(NULL, 0); break; case DISAS_NEXT: case DISAS_TOO_MANY: From patchwork Sat Oct 16 18:15:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515898 Delivered-To: patch@linaro.org Received: by 2002:ac0:cd8c:0:0:0:0:0 with SMTP id d12csp146741imp; Sat, 16 Oct 2021 11:42:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwaJkhtuYqrT6gfWlIoAPrkUhEj+rRNXSaBWpSU7atZzYc3PBzY/BsQE1dpN2T3diNQbZ80 X-Received: by 2002:a25:c6c9:: with SMTP id k192mr21699018ybf.409.1634409758601; Sat, 16 Oct 2021 11:42:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634409758; cv=none; d=google.com; s=arc-20160816; b=rS2AbeLQEQdYiJlduLK1tBGxItVEo8o2lqHFl29e1PN4redzpSjHe80cCMHJHb0N/p Z73HMUqlTh9dWLBjUlGYOMtCqVm+HSRy/raCtu3MoqEfoGuWnmXyMZTwPeu5SAxj54xu dCCmd8NOwcJbdbcdjJH2qbErbs4DU9fc1pYYk/blpe+KvdiRIWfxB1H4b4E21khEbdLA u9JXqRpX5lExDiuQpHb6DMVBiT8c9TqQ6Bbxz6ZCti68kz5AgQZ6iO5VG6BeswgfF+/g 46LG07lzmGpak3yfcBY54uqiIs1H3Tlsccl/8U2JsrWURGn357ouIwSb8jlETqBmxJr1 Tz9Q== 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=NPB1z8UtX5ACFEzlMyiCpvPuDGWU/IxFEL5YV3sYj1g=; b=Hh8SM10fNXq25S4jVmU5fPnPX6LpJ0Y6EOgwFjt4vB1FLzJjImqx7IA3U1NEPtu1j1 76XJ6+uyavLOLlFWCBpeCxsENHNJb5+DM3piH00pAv9Q/7ElvBIaLZCt7us8Q6jFAtzv WWbM46bT8GPGmdc861KE3MwHYQoYr0Ck8+msKM39nKxCQ6263njuh1DFeeD80bxNStrN deRtEw9pqhioyiU6yxK8/aOqpNc1CC6EoIQvIgMZtFsJ+FYAiFV/CFyZtnZkKN6SDcZb syDAeFrsOz5hKJIeOCiIb+XTh2Yer9r/lv2WC9Dfvo2ah5QhHJGOWa4csEoTwL1oi9Bd iebA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pZKoSadM; 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 d8si10988949ybd.209.2021.10.16.11.42.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 16 Oct 2021 11:42:38 -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=pZKoSadM; 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]:50458 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbodi-0004XH-3c for patch@linaro.org; Sat, 16 Oct 2021 14:42:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41180) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mboDd-0008Oh-ST for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:42 -0400 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]:35539) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mboDZ-00028Z-6w for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:41 -0400 Received: by mail-pf1-x433.google.com with SMTP id c29so11290857pfp.2 for ; Sat, 16 Oct 2021 11:15:36 -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=NPB1z8UtX5ACFEzlMyiCpvPuDGWU/IxFEL5YV3sYj1g=; b=pZKoSadMtZuDgOlG3iJWU9aXVDuenSOHw3S60UuJDbNzOihAZhmfuA5k24TVTHHadk Bnk4WvRze5K2nCj9J8hSN9uL3DkaPDzjdPj6kWxjgLSgrmnXZI8yIahxr1DrIcNz+NQ7 FLjKSZ3CITKjOFdA1r77ujA2ntsXN6D1537p3c1maoy/TZ4Yj8sQY7zhTFS9ZzKiwVOR epkRtVFLxBDHgcdWZEtz6SPKnYucnUIzLLMGD5mHz83/goXvs0rqKhXaEZ5Ap09FaxdB zIv5J6QCBEz3OIXTUMOj7FikvR62PzGRLuimUa0hO1Y+quaH7Uj0WKannTaE+AxuqzGm 7vCg== 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=NPB1z8UtX5ACFEzlMyiCpvPuDGWU/IxFEL5YV3sYj1g=; b=zrZHE51QOinxyqMeUNwbiZbOZFhcZMxb6xy5m56FFihsuqA9QlDDVsUVxT6y3y4B5a XE/j17bxcGZ7SUKDnrF36Y80IGoPmhzh66BkccqypFl57tt+mV+9qs1h2uHLCm1HmKlx 9BBAsBDzGpIAN7C9AQFFt5EqNOuqlU/joH0ZYU8A8qqLTIp3GWH0G3F7s1mf6ItWUEXd r4CunNpWHVHzezrm6b5rXrJWiANqPHSMaCDOSmjjMsipXAMIEyDSklF84/AxU1sTN5en STSYC0uhE5YeOcD5RCg45KtiV27sHOL5qaYGnEcn/96a5X2cVt+KnT2XyqYGzyIBBPfp xBTg== X-Gm-Message-State: AOAM532RqYsW2Dt9PFAkAtGVgoc9aNh3yPfcCAOdYuFC1bjCodEJQH6R uHz/NREjUlIhcYyL5FzrbXHR+5KSBZ2GFQ== X-Received: by 2002:a05:6a00:214d:b0:44d:35e9:4ce2 with SMTP id o13-20020a056a00214d00b0044d35e94ce2mr18997912pfk.13.1634408135755; Sat, 16 Oct 2021 11:15:35 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id ob5sm5075097pjb.2.2021.10.16.11.15.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Oct 2021 11:15:35 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 22/24] target/tricore: Drop check for singlestep_enabled Date: Sat, 16 Oct 2021 11:15:12 -0700 Message-Id: <20211016181514.3165661-23-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::433; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x433.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/tricore/helper.h | 1 - target/tricore/op_helper.c | 7 ------- target/tricore/translate.c | 14 +------------- 3 files changed, 1 insertion(+), 21 deletions(-) -- 2.25.1 diff --git a/target/tricore/helper.h b/target/tricore/helper.h index 78176aa17a..b64780c37d 100644 --- a/target/tricore/helper.h +++ b/target/tricore/helper.h @@ -153,4 +153,3 @@ DEF_HELPER_2(psw_write, void, env, i32) DEF_HELPER_1(psw_read, i32, env) /* Exceptions */ DEF_HELPER_3(raise_exception_sync, noreturn, env, i32, i32) -DEF_HELPER_2(qemu_excp, noreturn, env, i32) diff --git a/target/tricore/op_helper.c b/target/tricore/op_helper.c index 32c2bc1699..9476d10d00 100644 --- a/target/tricore/op_helper.c +++ b/target/tricore/op_helper.c @@ -107,13 +107,6 @@ static void raise_exception_sync_helper(CPUTriCoreState *env, uint32_t class, raise_exception_sync_internal(env, class, tin, pc, 0); } -void helper_qemu_excp(CPUTriCoreState *env, uint32_t excp) -{ - CPUState *cs = env_cpu(env); - cs->exception_index = excp; - cpu_loop_exit(cs); -} - /* Addressing mode helper */ static uint16_t reverse16(uint16_t val) diff --git a/target/tricore/translate.c b/target/tricore/translate.c index a0cc0f1cb3..07084407cb 100644 --- a/target/tricore/translate.c +++ b/target/tricore/translate.c @@ -3225,14 +3225,6 @@ static inline void gen_save_pc(target_ulong pc) tcg_gen_movi_tl(cpu_PC, pc); } -static void generate_qemu_excp(DisasContext *ctx, int excp) -{ - TCGv_i32 tmp = tcg_const_i32(excp); - gen_helper_qemu_excp(cpu_env, tmp); - ctx->base.is_jmp = DISAS_NORETURN; - tcg_temp_free(tmp); -} - static void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest) { if (translator_use_goto_tb(&ctx->base, dest)) { @@ -3241,11 +3233,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) { - generate_qemu_excp(ctx, EXCP_DEBUG); - } else { - tcg_gen_lookup_and_goto_ptr(); - } + tcg_gen_lookup_and_goto_ptr(); } } From patchwork Sat Oct 16 18:15:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515896 Delivered-To: patch@linaro.org Received: by 2002:ac0:cd8c:0:0:0:0:0 with SMTP id d12csp142829imp; Sat, 16 Oct 2021 11:36:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzK7ozMWUktJESYp9m2sJzoFeHaDSmp0kpqrrfEDS3MLX3nP74KBlJfBEgbR0wjbJVYz4wx X-Received: by 2002:a05:6e02:1a2d:: with SMTP id g13mr8632670ile.123.1634409378794; Sat, 16 Oct 2021 11:36:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634409378; cv=none; d=google.com; s=arc-20160816; b=GVGzHSxIW9cS/1jKZnt8HkfXGqjFCRzvufOHamHMnKitxxM7vCXtIfN19XgtdT+3LJ dCpCZtcSFzur1sxTNAZDpsk6UvFCOu0Y2uHnn5meD7DU3qP9dWMIuB7MxOdfPB9ThkLM UvFfQW7Qii7QINZDUKjQawEHXBI8NOlZaRLIS1FQnzRVly7lLXRJOMcxeXeKQ1aJgMUK Tw3u5eDZBo1ovBv89tyL6KcHqzJyt6PYoyuvf3//UpF3xMdr2eL/0JPpiXl/T587qz2G KYAPnHgPHO5vihxTtCT/ctknEL1/3+w0dybVeFG72cbAABOj3ygSHBVbSoDHxWr0zhbk YMvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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=KpJskJGYG8NwOwmiH2Iu6UhY3Zn5zWd+0hF4Ppw0hnM=; b=SmVOW7/kgofSuDJb1iOGwVSkIofobtduw6cSDwp162Z64SE69wgMySw6+yvPl8qFeR 1s4B5xmBSREQWMTselpGrup1EzTn4YIM1CnC6+g3WsAR9214JfipS8Bhzb0qyP0Mq95s KNzXA1RuVGSdgJQprtPd3npMvDd64na1Z5E5rqw8tOr6ySOILVfT/0WK0ZnSR79HYZjW mnAEhPBeQl4Ji76tVCSSbgNsBR1tyRHUAdAf9gH57prbRM9Ww0u7hATATZI+A604DAYZ Zfl+3S7Zt3tQwmWKNYaPRrTcWgjCJrhsv97FOuQMAcoTc2+d0/VBJtKAg4NpB0X1rP5m UL0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=w2PaDEIj; 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 w22si11227732ior.71.2021.10.16.11.36.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 16 Oct 2021 11:36:18 -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=w2PaDEIj; 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]:39630 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboXa-0005TF-AA for patch@linaro.org; Sat, 16 Oct 2021 14:36:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41190) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mboDe-0008PL-9W for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:43 -0400 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]:39882) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mboDZ-00028m-RR for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:41 -0400 Received: by mail-pf1-x433.google.com with SMTP id d9so4071206pfl.6 for ; Sat, 16 Oct 2021 11:15:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=KpJskJGYG8NwOwmiH2Iu6UhY3Zn5zWd+0hF4Ppw0hnM=; b=w2PaDEIjRb6BzZsMnxvRucHE8xbQ8mie6Wl+fWuvdeH3yYsPorXhKGTP/guyNcdRkl lXoJwFhjUaQNH74WnxaBt/DX4ERpwgwzOx3gKl9LiErlQIrnwKRFW6IlZvZ0sKV6XgGk SyXdKWbr1+taWjABw8w7Gv3zk8MboCLFbRFLoZsGnDleyyNf2oFPyA7VLE/d2UrxUItr aZ9UPgEBCJWUzeiEUP0mtjKBQ2FJclIML0ixBhZNo1CErr0rsE++JYaSR5R9/mv4oV2A Hew5Sw9FtSBdL9D8UA1RO+WKKzldZQivjbex1gQT3lFzz4GkvYn032LwqUulJxcJ/OQg QVfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KpJskJGYG8NwOwmiH2Iu6UhY3Zn5zWd+0hF4Ppw0hnM=; b=DnF46WlaqEjE3Os4+pmU0YTVZrTwU5pBN6HzOBRSyu+Mfc8EUEcNZu1QNxcwHPar8W xhKV0LA/4RUbSXNyF/jAlesmdW9RtRsa8Y/mv596iw3QqONrZtJEfFaNuQb+HBIOTHqQ dXyVMIKaeeglId1vBXvAw82I4tVGfX1aPtT09fxbKfve6Nm1l/uJodcCwokz+KEYLPFD ctIiL75eUT9iDtURyZiuy7IxuZqnqfIRZUg3Ey86oQQsuKr1cGjihV5LvF5OMIBIrsTp /reEh2LP7/Zxj+YEu75XmzddzxNrFSPivFW5H+BfZHveS1e0MUa/+eTjfqAI24fVFj7G Xn2A== X-Gm-Message-State: AOAM530cUtHj1gsrG38KZIQcCA5RVuU9VV2dnn6Qm7qSWBCE2M8wWVvc tcaum5yA/275xnvdSVPEbTWi6ccT6qk= X-Received: by 2002:a63:8c4d:: with SMTP id q13mr14843517pgn.92.1634408136512; Sat, 16 Oct 2021 11:15:36 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id ob5sm5075097pjb.2.2021.10.16.11.15.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Oct 2021 11:15:36 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 23/24] target/xtensa: Drop check for singlestep_enabled Date: Sat, 16 Oct 2021 11:15:13 -0700 Message-Id: <20211016181514.3165661-24-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::433; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x433.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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" GDB single-stepping is now handled generically. Signed-off-by: Richard Henderson --- target/xtensa/translate.c | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) -- 2.25.1 diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c index dcf6b500ef..09430c1bf9 100644 --- a/target/xtensa/translate.c +++ b/target/xtensa/translate.c @@ -382,18 +382,14 @@ static void gen_jump_slot(DisasContext *dc, TCGv dest, int slot) if (dc->icount) { tcg_gen_mov_i32(cpu_SR[ICOUNT], dc->next_icount); } - if (dc->base.singlestep_enabled) { - gen_exception(dc, EXCP_DEBUG); + if (dc->op_flags & XTENSA_OP_POSTPROCESS) { + slot = gen_postprocess(dc, slot); + } + if (slot >= 0) { + tcg_gen_goto_tb(slot); + tcg_gen_exit_tb(dc->base.tb, slot); } else { - if (dc->op_flags & XTENSA_OP_POSTPROCESS) { - slot = gen_postprocess(dc, slot); - } - if (slot >= 0) { - tcg_gen_goto_tb(slot); - tcg_gen_exit_tb(dc->base.tb, slot); - } else { - tcg_gen_exit_tb(NULL, 0); - } + tcg_gen_exit_tb(NULL, 0); } dc->base.is_jmp = DISAS_NORETURN; } @@ -1293,12 +1289,7 @@ static void xtensa_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu) case DISAS_NORETURN: break; case DISAS_TOO_MANY: - if (dc->base.singlestep_enabled) { - tcg_gen_movi_i32(cpu_pc, dc->pc); - gen_exception(dc, EXCP_DEBUG); - } else { - gen_jumpi(dc, dc->pc, 0); - } + gen_jumpi(dc, dc->pc, 0); break; default: g_assert_not_reached(); From patchwork Sat Oct 16 18:15:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 515895 Delivered-To: patch@linaro.org Received: by 2002:ac0:cd8c:0:0:0:0:0 with SMTP id d12csp142698imp; Sat, 16 Oct 2021 11:36:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwik2wvAf8QNVor7sDgm5cTEqyBMxGk9WhU00qGlqfmy2XzSAi5hUR0RZHg4r0jVi1vqf7A X-Received: by 2002:a05:6e02:16c6:: with SMTP id 6mr8639114ilx.220.1634409368021; Sat, 16 Oct 2021 11:36:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634409368; cv=none; d=google.com; s=arc-20160816; b=KG8CB1+p5yODX08GAKRJHPfR/eswvVljp8xKj6a2XYaNMPFRvVluWIHxu0Vh8s8oct pjAD6o9XHO+K6r0mgKoMqkZPrjwQZ3ffsRrsQyJVHBvvZHdAvbQ6pD3SDtUJeSccGeDw xqdce9s5/HecPt77DchG8VEpUMG20xosN8j2SJKAjPkEIzWazB7W9cqA+uhPkTSKPtd0 1dRIeaA3xPtCPNkZdHvqvG6RyVnZ0X2DPpUeLoMJmVhuB+pFXjySQAk1g3xscaYqWY0p k17zxOfe3XGxAs8mEZfcNqP13zU7xQqjkRvmzZYlxy54LkaZOzywbzoojHQQADQHbmO4 Jhzg== 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=9lqN/uiH3UUIeVg5yhYMxWg7ld7QYTaBAGHdI8OeAIs=; b=gm3v5OW2/PJ+zAE0LkPBpDk702fC4U/Rv2G00ZtKU8bo39BH0LIrJTEO+bbquWlCW+ xFpdpTN4dvHHhzQlAjdkhEIrr0SxC3Mk8Clt2GczsVs2Ce7mVQN2ZAIVTW4HVBPwcazc qJl8Hx7A5SYs5ZELGdbKTEod9vyxZVthwh1KYBwfnxvxsLAaZLgu+EO3ymNwa9zhk8t+ X/o/DjmURgbnV74T7KEvayrbOiG/CBdM6QTU3wm5Xghb3r2aMjQjxWVqSHicbMynbeo6 7M5Jku4DP4s341yCrxb7M1Nvf36+kvH+fFFcU6RW+jM8U85gesemYPqNyyP4TFlMlFLK CVjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=mPAuZ95N; 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 c10si10192732ild.46.2021.10.16.11.36.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 16 Oct 2021 11:36:08 -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=mPAuZ95N; 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]:39048 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboXP-00056c-G4 for patch@linaro.org; Sat, 16 Oct 2021 14:36:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41202) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mboDf-0008PU-03 for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:43 -0400 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]:37476) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mboDa-00029x-Pq for qemu-devel@nongnu.org; Sat, 16 Oct 2021 14:15:42 -0400 Received: by mail-pf1-x433.google.com with SMTP id q19so11274354pfl.4 for ; Sat, 16 Oct 2021 11:15:38 -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=9lqN/uiH3UUIeVg5yhYMxWg7ld7QYTaBAGHdI8OeAIs=; b=mPAuZ95NqgeCGGOUN11IL5iIs6uSGsT7NGdnaSOP/QOhK6GgrDBqtCERNfRj3WQcek cGE1Nk6tKBCh71BUyrvVoAiQb36FaXI2OLV/Tmpb9Sb5iyVE1eTegvkmRP51EUt8bV4y qPi8YrW7cCWx00b75//wBzJF/VHaESqaMDE2QJnHXgRX1pmXTlX209/Rzao6jS3+eTDf y4lIupYx+BtzNlWan1NyxP7NiMOtB9gG67y2PyS5bdbouV1FtBsxL9h+NlA0AadK1d/T j0gKbbXlnz8Jiu5wRvSCkqo8/5Q7nrwWpIg8Z/XPbmqic5g+dfYuJJkK8e8H6jf08cv1 mEww== 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=9lqN/uiH3UUIeVg5yhYMxWg7ld7QYTaBAGHdI8OeAIs=; b=VmwqvDGKwRhTnjsKG+I+YB0nFbdJ5rtytP3LtfvVmWTlEFMeFcDPc1ziujCH+r3Ylc mh6BPefi9PU1dBO6MrOznPeVUhvLDi6vrp9pp5bp9qyE1x/QsUGZhdlBvCUyHM+Qc+6I 1zdZf9SWblrkVtj5GyN6S7Z9XukvvpjXxDNXX94AXjlNc4WKj1JiWD1loB/ppbpllrmy eeqZx92YmniO4UStvaZz7w9A6OkFhscAmPtyx7wSCVBkVqKkycqENGpjsSK1Y63hjYn8 5pCRApPBaWCg73Qn07mCblEorfXdD/YYthlMFtd+szY+JQaP/rRKdVxc9eZ4PENRCznO 4uVw== X-Gm-Message-State: AOAM530fgi08FjSI9Hr++K6Vl6vrvEWbCxAhM/1PHL1+QU3SigU5jCf3 NYsxWiuG/9MMsmOh0m/mZ3t9WLbnGzV4lg== X-Received: by 2002:a05:6a00:1ad4:b0:44d:9ab:c129 with SMTP id f20-20020a056a001ad400b0044d09abc129mr19168036pfv.14.1634408137474; Sat, 16 Oct 2021 11:15:37 -0700 (PDT) Received: from localhost.localdomain ([71.212.134.125]) by smtp.gmail.com with ESMTPSA id ob5sm5075097pjb.2.2021.10.16.11.15.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Oct 2021 11:15:36 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 24/24] Revert "cpu: Move cpu_common_props to hw/core/cpu.c" Date: Sat, 16 Oct 2021 11:15:14 -0700 Message-Id: <20211016181514.3165661-25-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::433; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x433.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: Peter Maydell , Eduardo Habkost Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This reverts commit 1b36e4f5a5de585210ea95f2257839c2312be28f. Despite a comment saying why cpu_common_props cannot be placed in a file that is compiled once, it was moved anyway. Revert that. Since then, Property is not defined in hw/core/cpu.h, so it is now easier to declare a function to install the properties rather than the Property array itself. Cc: Eduardo Habkost Suggested-by: Peter Maydell Signed-off-by: Richard Henderson --- include/hw/core/cpu.h | 1 + cpu.c | 21 +++++++++++++++++++++ hw/core/cpu-common.c | 17 +---------------- 3 files changed, 23 insertions(+), 16 deletions(-) -- 2.25.1 diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index b7d5bc1200..1a10497af3 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -1008,6 +1008,7 @@ void QEMU_NORETURN cpu_abort(CPUState *cpu, const char *fmt, ...) GCC_FMT_ATTR(2, 3); /* $(top_srcdir)/cpu.c */ +void cpu_class_init_props(DeviceClass *dc); void cpu_exec_initfn(CPUState *cpu); void cpu_exec_realizefn(CPUState *cpu, Error **errp); void cpu_exec_unrealizefn(CPUState *cpu); diff --git a/cpu.c b/cpu.c index e1799a15bc..9bce67ef55 100644 --- a/cpu.c +++ b/cpu.c @@ -179,6 +179,27 @@ void cpu_exec_unrealizefn(CPUState *cpu) cpu_list_remove(cpu); } +static Property cpu_common_props[] = { +#ifndef CONFIG_USER_ONLY + /* + * Create a memory property for softmmu CPU object, + * so users can wire up its memory. (This can't go in hw/core/cpu.c + * because that file is compiled only once for both user-mode + * and system builds.) The default if no link is set up is to use + * the system address space. + */ + DEFINE_PROP_LINK("memory", CPUState, memory, TYPE_MEMORY_REGION, + MemoryRegion *), +#endif + DEFINE_PROP_BOOL("start-powered-off", CPUState, start_powered_off, false), + DEFINE_PROP_END_OF_LIST(), +}; + +void cpu_class_init_props(DeviceClass *dc) +{ + device_class_set_props(dc, cpu_common_props); +} + void cpu_exec_initfn(CPUState *cpu) { cpu->as = NULL; diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index e2f5a64604..9e3241b430 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -257,21 +257,6 @@ static int64_t cpu_common_get_arch_id(CPUState *cpu) return cpu->cpu_index; } -static Property cpu_common_props[] = { -#ifndef CONFIG_USER_ONLY - /* Create a memory property for softmmu CPU object, - * so users can wire up its memory. (This can't go in hw/core/cpu.c - * because that file is compiled only once for both user-mode - * and system builds.) The default if no link is set up is to use - * the system address space. - */ - DEFINE_PROP_LINK("memory", CPUState, memory, TYPE_MEMORY_REGION, - MemoryRegion *), -#endif - DEFINE_PROP_BOOL("start-powered-off", CPUState, start_powered_off, false), - DEFINE_PROP_END_OF_LIST(), -}; - static void cpu_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); @@ -286,7 +271,7 @@ static void cpu_class_init(ObjectClass *klass, void *data) dc->realize = cpu_common_realizefn; dc->unrealize = cpu_common_unrealizefn; dc->reset = cpu_common_reset; - device_class_set_props(dc, cpu_common_props); + cpu_class_init_props(dc); /* * Reason: CPUs still need special care by board code: wiring up * IRQs, adding reset handlers, halting non-first CPUs, ...