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: 169929 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp371042ilk; Fri, 26 Jul 2019 11:06:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqxnahsltMKrgEDal0DPfKiaVwn/qgjAnUabfvP8XPwi4dUA9MAosxVhOBOPtpNgZj7bNFGT X-Received: by 2002:a17:906:838a:: with SMTP id p10mr71713644ejx.237.1564164418577; Fri, 26 Jul 2019 11:06:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564164418; cv=none; d=google.com; s=arc-20160816; b=efZVcxo4c8t91HPE4hZcPnPOXqe9+XF2xkNqmO16mK+Xxoc6YhZNXTqtQkCvJu8MaV CKNopht1ao7PzHSH9k7GoGj/l6tbHvrAggqUyOTHYI+11rBtiSzN5B6CfNOwH1fERzAU 8f9ZMcMUjmI/JTuhPwEp9nZAW0Zf9fKSdRbXBBhP4KspAn3yPiC6MnwCatLDVz2ZqdNd /aMq0ASKBc8Ls8X+xruq9az7inrBj/I/iQYwoY0chKz7/BhPmbOseSVOuSILSsQ+sK2a 2VzUVImMaePpjkGPAkAAYJUJQe3wM7FV0uTcmJgVNA11mQFMQETrJkVw0SdnFp+lLWCR 9usQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=CpCg1eLgsmeNBuXSBMKJnkt//MK4VjGPzn8vhxLPYT4=; b=e47TpUSwA1q95W3tdjy1HKWBeQq/CohGTQOeQuul26zB+VPkB2uL7hz0jVVL0/8fWI Yw5fB+B8cRq5TXXtZhld2ssOlQP3+VhBEE9HN/15Rs910PdTYDh1Sqf79YRFAnPXTUqU udunLZcXDHwhExBIyCSgayBxmthqguxxfX4N89Wu9P/jZZdfzMnUww+iki1N7fCGme5b 90jbh57PQvqI8oVSIEM2n7uxxu+FkpYt/JeAT/O58qyTP86nCKTtjcj7KanyWxt3UN0g gtXkz2ES6pGpA3d+0YZhynCfUA5qrjnRf5oZchv9ME8so7GTv8yIxCbzuvXmp49eQMME H5/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=QNMjh3w8; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o25si11294960ejd.215.2019.07.26.11.06.58 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 26 Jul 2019 11:06:58 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=QNMjh3w8; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:42836 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hr4cJ-0006nm-8C for patch@linaro.org; Fri, 26 Jul 2019 14:06:55 -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-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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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(-) -- 2.17.1 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)