From patchwork Wed Jul 21 06:41:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 483238 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp5903195jao; Tue, 20 Jul 2021 23:42:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1UAYIGmCYIQc01SDAUtQpCNI2bF2AM1t3VB7QqdKYe7+ByWUIHE2wZVYnXdJ9/ylJ8WY+ X-Received: by 2002:a25:7394:: with SMTP id o142mr45383656ybc.220.1626849759891; Tue, 20 Jul 2021 23:42:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626849759; cv=none; d=google.com; s=arc-20160816; b=AJNHi1+t4iPVU5V3kobt0vqTnzET9SsCZr8cT3FHXs6RTzxOjnDFIX5L92tod2N4hg /kYTguuP1N3cXNYQcybgeX811gUE0v5J8jU+BUUdVjX+IUiezUluc9V8fssWr6P32wgA PWrjsT3tL9A4D71rsLZ2U8Q6J+kU8gMBrGt5Eu+b+QKtioYTXC/hOgi+7R5KIQad8olc WUQ32fwFAec393/mEed3Ce4dya4GWekvJU6FXubFjROJ71ryIxX5EsOFi9/85/4uFbV8 r8cBRxTk4fj5vRTDiSDdjKaTNWRDh1xSs9/qQTVMJfuxSTkE6sWdUfJr2dNiHd5bZohJ royA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=geDxZApSmUqLJlF8yeLXrKLXpspgtXWGcFizFU4A/+s=; b=PPrb5zoYqvZydwv4qdlC1YyCQKDWyQQxMYv9NrYyKWvEpTC9DEE2GTZo9gsdDDUC5G 946bQ0jzh7idWD3spPGbWI5A88CHQQwD1MQM9hS8BTCM6SO6v8iXWNvgF2Z55HntEBSw bunNO6gV8rQLiOku72Qmyu9ZSuO4X2r7RaijrxuFlV9+gN1Jvn6BHfx1Plailg5xVbn+ CS1YF6KhRtinmUqRMCHsAVRckcSgx4y7apeSycFIK32/UrznSZDKDkOP31L9xEqDx5Aw Yjw6a2GoAGCvTrzy+FTsMCxcmu0jjz2XZtY9eqbnUmnFiS1V72q0Y9oYNpusgbngkrvg 5lOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=d0LRJRxy; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id t39si30027716ybt.470.2021.07.20.23.42.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 20 Jul 2021 23:42:39 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=d0LRJRxy; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:45610 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m65wF-0004z8-CY for patch@linaro.org; Wed, 21 Jul 2021 02:42:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44224) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m65ve-0004x7-6O for qemu-devel@nongnu.org; Wed, 21 Jul 2021 02:42:02 -0400 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]:43646) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m65vc-0005Ka-Ql for qemu-devel@nongnu.org; Wed, 21 Jul 2021 02:42:01 -0400 Received: by mail-pl1-x62a.google.com with SMTP id b12so471440plh.10 for ; Tue, 20 Jul 2021 23:42:00 -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=geDxZApSmUqLJlF8yeLXrKLXpspgtXWGcFizFU4A/+s=; b=d0LRJRxy5wQYTQMGvkIbqouGclGE4cppIZV1Bi5MM/6vcRSDaxL4gKq8W0ioOqCSbt aL2qWmqSK5qYSvYyXZsImceKt4VoicMOi0qNMETj93nH05ozvIfyTQbWkiuZ6QZoDbkn NJ8X9x8TvRfQZVai7tc2mm+NbglodjywD9XeIf0WzW+Zq4g9N51e3ZEs3FHrZ+w7je2D AmmX3LWC/ZxvVL2cpjr0BTnD6Z3qL0nULlb8yCoBJ3IuIlYX6fZPBzlabSCPE415nasv JOxJzk3/yBc7iAJ6KuAU+DjBg1QljMp8KZdmOfADv1xVn3AOCbRduJ+Swf9/HkS6dEV7 H2UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=geDxZApSmUqLJlF8yeLXrKLXpspgtXWGcFizFU4A/+s=; b=N0KZ0lmM5KAMGEJebDUBMIp6Th9+ihyZPFGfQVVQj8z+CJ6HnJcqrBRibl99S7Q+DD J5oI/W3T3ferveMvEu1kJ6liJMgKpGEX4j5dzoXpwJ64g3toEN2c44tx+eD0YAcbAyAT OUHTqiGfsCuCuu0tYj1RtEzvncUeeqwXY0DvgDlLTIWz/bGFf8ixrkUdMukGDxjx+WQl lf9WP7HuvCQnWaFAo84o6/ONYvQBWh/xAgXlfKNn8COFSYsoGeyLqgwkZ1zIQaKpR0Qf ojWikXiQCf3b1Gg4ApFRkfm88nDDTnsFkbINIXD7MQ0il3h11Zi2YSoF0IVnhRnCZye/ x4Fw== X-Gm-Message-State: AOAM533eSYFITb1nMaq4YA6UGECRK+pJVWNVoJBkmlaJutylZXkobPjx osA6v0fFSy3vGqIn3kb+gAuG3+uVcBJJJg== X-Received: by 2002:a17:90a:e513:: with SMTP id t19mr34084096pjy.104.1626849719468; Tue, 20 Jul 2021 23:41:59 -0700 (PDT) Received: from localhost.localdomain (204-210-126-223.res.spectrum.com. [204.210.126.223]) by smtp.gmail.com with ESMTPSA id q17sm21146132pjd.42.2021.07.20.23.41.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jul 2021 23:41:59 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH for-6.2 01/23] accel/tcg: Handle gdb singlestep in cpu_tb_exec Date: Tue, 20 Jul 2021 20:41:33 -1000 Message-Id: <20210721064155.645508-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210721064155.645508-1-richard.henderson@linaro.org> References: <20210721064155.645508-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62a; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Currently the change in cpu_tb_exec is masked by the debug exception being raised by the translators. But this allows us to remove that code. Signed-off-by: Richard Henderson --- accel/tcg/cpu-exec.c | 11 +++++++++++ 1 file changed, 11 insertions(+) -- 2.25.1 diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index fc895cf51e..313f0b748e 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; }