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: 12563769 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36A96C433EF for ; Sat, 16 Oct 2021 18:18:14 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D2F0A61152 for ; Sat, 16 Oct 2021 18:18:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D2F0A61152 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:54680 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboG4-0002mJ-My for qemu-devel@archiver.kernel.org; Sat, 16 Oct 2021 14:18:12 -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-Google-Smtp-Source: ABdhPJxgIzm8HAVRP/A8eY/bPIeNWkvZjrUx66cBNrLUxb181K4qJw6tIlpEX4f/3MLhce8NyH6EOw== 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+qemu-devel=archiver.kernel.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(+) 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: 12563779 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6A191C433EF for ; Sat, 16 Oct 2021 18:20:41 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 11FE360E78 for ; Sat, 16 Oct 2021 18:20:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 11FE360E78 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:34746 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboIR-0008SZ-TU for qemu-devel@archiver.kernel.org; Sat, 16 Oct 2021 14:20:39 -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-Google-Smtp-Source: ABdhPJyMYIqR7tGylaB9+dLp+5xaLJlowHo/p+s2IkPmBLbgcz9qpj4sZhzQ/Bh7tW3gLEpqeE5pUg== 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+qemu-devel=archiver.kernel.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(-) 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: 12563777 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E756BC433F5 for ; Sat, 16 Oct 2021 18:20:36 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 939CD61152 for ; Sat, 16 Oct 2021 18:20:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 939CD61152 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:34640 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboIN-0008OA-KB for qemu-devel@archiver.kernel.org; Sat, 16 Oct 2021 14:20:35 -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-Google-Smtp-Source: ABdhPJzTfWseQKZ/gcqiRm4GmRihgywrUF7m5BKSGglp/E5Q3UeuWzI3eQfsrKZlJT685ghWOCpcXQ== 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?q?=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.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(-) 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: 12563773 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 79543C433EF for ; Sat, 16 Oct 2021 18:18:16 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 16F9C60E78 for ; Sat, 16 Oct 2021 18:18:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 16F9C60E78 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:54772 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboG7-0002pk-2o for qemu-devel@archiver.kernel.org; Sat, 16 Oct 2021 14:18:15 -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-Google-Smtp-Source: ABdhPJyATnW2kHeMmo9fxXCzkrPXGmpCbC+j//bYr5AVF5xBgnmiyad6BZTdc/mgd9ts1OIJBiUIDQ== 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+qemu-devel=archiver.kernel.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(-) 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: 12563771 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B80E9C433F5 for ; Sat, 16 Oct 2021 18:18:14 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6B66B60E78 for ; Sat, 16 Oct 2021 18:18:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6B66B60E78 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:54718 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboG5-0002nd-9x for qemu-devel@archiver.kernel.org; Sat, 16 Oct 2021 14:18:13 -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-Google-Smtp-Source: ABdhPJwZYKhrDlWv4pQychI65zSVs04KdrzdvaqFdqoYYdxl/j98w9lP1Fw1PHytmOjsg1sMnvE+mw== 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+qemu-devel=archiver.kernel.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(-) 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: 12563781 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 975B8C433EF for ; Sat, 16 Oct 2021 18:20:51 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3753061152 for ; Sat, 16 Oct 2021 18:20:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3753061152 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:34894 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboIc-00006s-9s for qemu-devel@archiver.kernel.org; Sat, 16 Oct 2021 14:20:50 -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-Google-Smtp-Source: ABdhPJxrBERw83X6tbiXJANjfzB1JepbZiZeqxmh4zms1uruXeQZ2w3WVslBELdOufRl6NzsoMK/lQ== 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+qemu-devel=archiver.kernel.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(-) 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: 12563787 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0BF92C433FE for ; Sat, 16 Oct 2021 18:24:13 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B70A060E78 for ; Sat, 16 Oct 2021 18:24:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B70A060E78 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:43414 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboLr-0005u4-Sx for qemu-devel@archiver.kernel.org; Sat, 16 Oct 2021 14:24:11 -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-Google-Smtp-Source: ABdhPJyZA8+99UNhhi1KdWsFHA2yd1iufYIodoLYkDwTc2b1R41fxBZAkJ0BFYHhZXSLB52bqMCODw== 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+qemu-devel=archiver.kernel.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(-) 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: 12563799 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44884C433EF for ; Sat, 16 Oct 2021 18:28:51 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E0AFB61152 for ; Sat, 16 Oct 2021 18:28:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E0AFB61152 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:54610 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboQL-0004yy-WA for qemu-devel@archiver.kernel.org; Sat, 16 Oct 2021 14:28:50 -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-Google-Smtp-Source: ABdhPJyw9ZuPn8elYArksqCRm7PFOyaRzMjNgJTe7TYjSofFpqJsQQ1vCXPwt2h7oMTtgpYVJ6zVpA== 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+qemu-devel=archiver.kernel.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(-) 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: 12563791 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F21CC433EF for ; Sat, 16 Oct 2021 18:25:34 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BFED560E78 for ; Sat, 16 Oct 2021 18:25:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BFED560E78 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:45886 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboNA-0007YR-Sg for qemu-devel@archiver.kernel.org; Sat, 16 Oct 2021 14:25:32 -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-Google-Smtp-Source: ABdhPJwHgbbwWXdZx9NL28bzyOpxZfqop06WABOp+vq+r7uioQ+p5UFIX8b1q7rZz5SCMaBQVIa/wg== 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+qemu-devel=archiver.kernel.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(-) 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: 12563785 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1A72C433F5 for ; Sat, 16 Oct 2021 18:24:11 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 52A7061152 for ; Sat, 16 Oct 2021 18:24:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 52A7061152 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:43180 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboLq-0005kp-6y for qemu-devel@archiver.kernel.org; Sat, 16 Oct 2021 14:24:10 -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-Google-Smtp-Source: ABdhPJxVSAQdthF/KDOWX00Xtual7L+myD59jn0gJaLVX25VOqPkq4zq5MEBDt1Ct4ReguebhYFuaQ== 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+qemu-devel=archiver.kernel.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(-) 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: 12563795 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1581C433EF for ; Sat, 16 Oct 2021 18:28:04 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AC45961152 for ; Sat, 16 Oct 2021 18:28:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AC45961152 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:52196 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboPa-0003Ns-PI for qemu-devel@archiver.kernel.org; Sat, 16 Oct 2021 14:28:03 -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-Google-Smtp-Source: ABdhPJzJbHoJXuQJGphTcx6rCvuzeabTBK9Du3Bk3pXlp1wz3RCurvmecSZceoccVHboKbQLsBmGCw== 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+qemu-devel=archiver.kernel.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(-) 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: 12563783 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A9A0C433F5 for ; Sat, 16 Oct 2021 18:22:41 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C119560EFF for ; Sat, 16 Oct 2021 18:22:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C119560EFF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:37168 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboKN-0001n3-KL for qemu-devel@archiver.kernel.org; Sat, 16 Oct 2021 14:22:39 -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-Google-Smtp-Source: ABdhPJwnrr+egkWl1COic2AtkYUHUTZf0eyAqTqQDJagfiYNGtax/5griFEGujGjeQyZ/RVQdPH5nA== 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+qemu-devel=archiver.kernel.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(-) 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: 12563789 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB39BC433EF for ; Sat, 16 Oct 2021 18:24:13 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5062161152 for ; Sat, 16 Oct 2021 18:24:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5062161152 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:43432 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboLs-0005ub-Ds for qemu-devel@archiver.kernel.org; Sat, 16 Oct 2021 14:24:12 -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-Google-Smtp-Source: ABdhPJxQuihKRrhJuAJ5t6i2lyCl3S+KNqeJcV/Ip95qeD1m+w5YTw2LAkmIICAR9DopgsoMqPf/DA== 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+qemu-devel=archiver.kernel.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(-) 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: 12563797 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00791C433F5 for ; Sat, 16 Oct 2021 18:28:06 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B814661152 for ; Sat, 16 Oct 2021 18:28:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B814661152 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:52334 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboPc-0003TF-Kc for qemu-devel@archiver.kernel.org; Sat, 16 Oct 2021 14:28:04 -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-Google-Smtp-Source: ABdhPJyQvWmYqZYlMiAA/0u8AnbO2sBEiR8/PHkmiXwvQE74ndzOc10Qg5lne3s4gXhkHZHvGSuzLg== 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+qemu-devel=archiver.kernel.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(-) 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: 12563807 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD703C433F5 for ; Sat, 16 Oct 2021 18:33:21 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 94AED61152 for ; Sat, 16 Oct 2021 18:33:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 94AED61152 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:34984 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboUi-0002Nt-IV for qemu-devel@archiver.kernel.org; Sat, 16 Oct 2021 14:33:20 -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-Google-Smtp-Source: ABdhPJx8mIO5EJb8JyrIVkcKl/dq0roNX+d4tUWOHqC/DQ4bJDto/WqfUssAn3JAMckrhunEDs3Maw== 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+qemu-devel=archiver.kernel.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(-) 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: 12563803 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9649EC433F5 for ; Sat, 16 Oct 2021 18:32:43 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2080560F11 for ; Sat, 16 Oct 2021 18:32:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2080560F11 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:33026 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboU6-00015w-2b for qemu-devel@archiver.kernel.org; Sat, 16 Oct 2021 14:32:42 -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-Google-Smtp-Source: ABdhPJzrBgFr7UXFfXd4re9U/VWphRAkUbmggVT0YtYeuRXnKm9F1NlIbwvyv+Wx/vPX1y0tyIhg3Q== 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+qemu-devel=archiver.kernel.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(-) 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: 12563809 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34411C433EF for ; Sat, 16 Oct 2021 18:36:14 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D97BB60F59 for ; Sat, 16 Oct 2021 18:36:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D97BB60F59 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:41682 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboXU-0006sk-TB for qemu-devel@archiver.kernel.org; Sat, 16 Oct 2021 14:36:12 -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-Google-Smtp-Source: ABdhPJzzrkh6gQgqiKedXWcG8vwB8rm9H1M16ugKS/WmIF1120iGgKjHP7QYAKD5t0MTj5O4ZLzI0w== 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+qemu-devel=archiver.kernel.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(-) 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: 12563793 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 96842C433F5 for ; Sat, 16 Oct 2021 18:28:02 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1E61960F59 for ; Sat, 16 Oct 2021 18:28:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1E61960F59 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:52018 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboPZ-0003Gt-4d for qemu-devel@archiver.kernel.org; Sat, 16 Oct 2021 14:28:01 -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-Google-Smtp-Source: ABdhPJyLtfJp4txZQDcHZpTldaYRobm/HvGcNsVpFBXbDZI8WRxZKNNhj2TGpY8WZp1J2UgxakVUIA== 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+qemu-devel=archiver.kernel.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(-) 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: 12563801 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88DCCC433F5 for ; Sat, 16 Oct 2021 18:32:31 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1A44C60F41 for ; Sat, 16 Oct 2021 18:32:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1A44C60F41 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:60824 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboTu-0000oP-3d for qemu-devel@archiver.kernel.org; Sat, 16 Oct 2021 14:32:30 -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-Google-Smtp-Source: ABdhPJzGTviiB6V+FV6d9dVwSh9ZKQU0mIIxqabPQDvr6mdlto/faVny7fAQ8y4JuNVzZ8nLqr2vBQ== 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+qemu-devel=archiver.kernel.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(-) 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: 12563805 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9FE35C433EF for ; Sat, 16 Oct 2021 18:33:17 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2932960F59 for ; Sat, 16 Oct 2021 18:33:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2932960F59 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:34514 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboUe-00025U-7G for qemu-devel@archiver.kernel.org; Sat, 16 Oct 2021 14:33:16 -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-Google-Smtp-Source: ABdhPJyooHD2z4SxBdDqPWxR5+UbNOl1D6kIqLVIlPlBh0Cl8kqlYyOYUYgnCkj0w8L1KI+zeZBJCQ== 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+qemu-devel=archiver.kernel.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(-) 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: 12563815 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B621C433F5 for ; Sat, 16 Oct 2021 18:39:41 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0E36F61152 for ; Sat, 16 Oct 2021 18:39:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0E36F61152 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:48226 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboap-0002tu-Vj for qemu-devel@archiver.kernel.org; Sat, 16 Oct 2021 14:39:39 -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-Google-Smtp-Source: ABdhPJw97mG8UdFCO6aeVaH7V+j1iF578vrxPjXRaYStftzcD4ldZ4SEL2d+hZHBZGJxAwZD0/EPTw== 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+qemu-devel=archiver.kernel.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(-) 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: 12563817 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4C34EC433FE for ; Sat, 16 Oct 2021 18:42:54 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D222D6115C for ; Sat, 16 Oct 2021 18:42:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D222D6115C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:51638 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbodw-0005KT-Ln for qemu-devel@archiver.kernel.org; Sat, 16 Oct 2021 14:42:52 -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-Google-Smtp-Source: ABdhPJxWj6d/lv1tsx/6E7l68IAukl4EizDhcDt+FFMh6zANh95o/0mGfttlKO35eAlzRlYQH9CWjg== 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+qemu-devel=archiver.kernel.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(-) 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: 12563813 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88468C433EF for ; Sat, 16 Oct 2021 18:36:59 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 482A960F59 for ; Sat, 16 Oct 2021 18:36:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 482A960F59 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:43158 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboYD-0007wW-Cf for qemu-devel@archiver.kernel.org; Sat, 16 Oct 2021 14:36:58 -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-Google-Smtp-Source: ABdhPJxykYVAU4EJpf/58WBPTDBWXFNrIZeGbpzz4WXD0MACkqFTCAf94p083iWqlvXiPCno+2G+7g== 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+qemu-devel=archiver.kernel.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(-) 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: 12563811 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 011A0C433EF for ; Sat, 16 Oct 2021 18:36:50 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 81AF261152 for ; Sat, 16 Oct 2021 18:36:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 81AF261152 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:42770 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mboY4-0007gG-Eh for qemu-devel@archiver.kernel.org; Sat, 16 Oct 2021 14:36:48 -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-Google-Smtp-Source: ABdhPJxpka6enIz+swhTS0AJV6ZoARdmBcNtb4SmfXAF7jMtZSF5qDOUvgXz+0lgI7+AkWmBrvLvhQ== 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+qemu-devel=archiver.kernel.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(-) 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, ...