From patchwork Fri Jul 26 17:50:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 11061721 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A96541398 for ; Fri, 26 Jul 2019 18:07:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 97A192896D for ; Fri, 26 Jul 2019 18:07:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8BFE82897D; Fri, 26 Jul 2019 18:07:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3976C2896D for ; Fri, 26 Jul 2019 18:07:02 +0000 (UTC) Received: from localhost ([::1]:42838 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hr4cO-0007C7-Ip for patchwork-qemu-devel@patchwork.kernel.org; Fri, 26 Jul 2019 14:07:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60006) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hr4OB-0008Rw-60 for qemu-devel@nongnu.org; Fri, 26 Jul 2019 13:52:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hr4O8-0001hG-35 for qemu-devel@nongnu.org; Fri, 26 Jul 2019 13:52:17 -0400 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]:37885) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hr4Nq-0001CM-Hi for qemu-devel@nongnu.org; Fri, 26 Jul 2019 13:52:14 -0400 Received: by mail-pg1-x541.google.com with SMTP id i70so14372259pgd.4 for ; Fri, 26 Jul 2019 10:51:53 -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; bh=CpCg1eLgsmeNBuXSBMKJnkt//MK4VjGPzn8vhxLPYT4=; b=QNMjh3w8HR3G0vPDqCVV1OMzSsqKpgoqDpwu/LU8YFxUHa4kQaBqG+uioKMmdFuWTW hUBr+I48dQ/YYVR456EjtWF2zNlNT8VLGcf9QrtuHWcBuF2EbEY4P0nQBeNAdkggrqQq wJWebg3i8Om8Dwz/kvHaNOxP0BTWKXZYrCmoE3yu048+k0r30HiBPgDAijS3cLbOsd3d k+V6qSRB/dw8ouyY2nlW2DWrY7gLnrtd/JcSNmovAib/syRZHuLk0e6/VFcH1vJxDMmX egcROH59F0gd6umRJZGVnBjb+ChYll7z8GlRFmNLM0TnSCVi12YhfPlr9SqizaMv+ZA1 StGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=CpCg1eLgsmeNBuXSBMKJnkt//MK4VjGPzn8vhxLPYT4=; b=pleFhxQa9+WIKrkJNLAI6HdllS0ZUvdKarik4fiiiAQa0Eyh4o3J2QZUjl6KEnNRcX cz+VWwFsGzgZOeOQRiHhE4mdnfPbG5SR5osVdihDjfWkd9Ug18g70nE6ke5JfSJd1OaB zjIGsvOssW2HJkpc68P/QeW9NC6En7JW0MjAGO3XQDlFUHjAlaIufDMc2IniEeXki/7Y qpSNcq6FAzkMNfF26k5ZyYyTkeCA12Bj+btozQ81NvlwUg+ey/tic56o+4u2LR+s9n5h vSext6UunTDeUi5Wg4V6nUF3o3CEb+IKRrJhQ6HQEKCbcX4gmjgmexdidaydkV3mI7lp 1LPg== X-Gm-Message-State: APjAAAURK1xe1Sr7qNdM0MBgu/m/zKm7+opkXFB8RhFIM1ZlTmN9T6Rh KtSWp2q9B1U5Ana7WcEd890oRyto0aU= X-Google-Smtp-Source: APXvYqzKCOAkEGfTHNztVAyyb3bE75Fpu8/PkllTbGLXMo9IesjJOtIdOukYO8/VmqXjJXRde5ioLg== X-Received: by 2002:a17:90a:ac11:: with SMTP id o17mr100551920pjq.134.1564163512683; Fri, 26 Jul 2019 10:51:52 -0700 (PDT) Received: from localhost.localdomain (97-126-117-207.tukw.qwest.net. [97.126.117.207]) by smtp.gmail.com with ESMTPSA id o24sm104287919pfp.135.2019.07.26.10.51.51 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 26 Jul 2019 10:51:52 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 26 Jul 2019 10:50:31 -0700 Message-Id: <20190726175032.6769-67-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190726175032.6769-1-richard.henderson@linaro.org> References: <20190726175032.6769-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::541 Subject: [Qemu-devel] [PATCH 66/67] target/arm: Move singlestep check from gen_jmp to gen_goto_tb 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@linaro.org, qemu-arm@nongnu.org, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP We miss quite a number of single-step events by having the check in the wrong place. Signed-off-by: Richard Henderson --- target/arm/translate.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/target/arm/translate.c b/target/arm/translate.c index c2b8b86fd2..9ae9b23823 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -2740,7 +2740,10 @@ static void gen_goto_ptr(void) */ static void gen_goto_tb(DisasContext *s, int n, target_ulong dest) { - if (use_goto_tb(s, dest)) { + if (unlikely(is_singlestepping(s))) { + gen_set_pc_im(s, dest); + gen_singlestep_exception(s); + } else if (use_goto_tb(s, dest)) { tcg_gen_goto_tb(n); gen_set_pc_im(s, dest); tcg_gen_exit_tb(s->base.tb, n); @@ -2751,16 +2754,9 @@ static void gen_goto_tb(DisasContext *s, int n, target_ulong dest) s->base.is_jmp = DISAS_NORETURN; } -static inline void gen_jmp (DisasContext *s, uint32_t dest) +static inline void gen_jmp(DisasContext *s, uint32_t dest) { - if (unlikely(is_singlestepping(s))) { - /* An indirect jump so that we still trigger the debug exception. */ - if (s->thumb) - dest |= 1; - gen_bx_im(s, dest); - } else { - gen_goto_tb(s, 0, dest); - } + gen_goto_tb(s, 0, dest); } static inline void gen_mulxy(TCGv_i32 t0, TCGv_i32 t1, int x, int y)