From nobody Fri Dec 19 17:07:00 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1592913286; cv=none; d=zohomail.com; s=zohoarc; b=S6fxbrWyXNlFwvm5xTP1eYnglLMDaLdsdWcLvJfKMZ14rIVpiAyPwItSDwBwMXKx+uSz2yRZT63SR7RSvD9/wU/RcXe1t+xGjaBwRnvcwQYFsLQ93nRmwpvr/h6dIvBEiuB4NlyAUuSBb5oqJfA5TB0YEtr6/PSwhoOHjgCHxrI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592913286; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=TIdOwUcKS8Gkz5ItNSYHwPJjx8yUuXeef+8VZHen8tM=; b=Kp7r0FHCdEmvq/fxsaNpk0gWpR1/HCbfH/+c3qKY94k/IGbaWbZwVageoIu1uc+YRLOinieYlUW6D9sxkSDJYz7/RgLDSQ0PBSjm6Nc3Qh1CsWlwkti4wDI6HjiN/PNDqH+dlgS3obP00+Z9Q19vob/AlkWuPQvILGi/PcU6z64= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1592913286010177.2349217540375; Tue, 23 Jun 2020 04:54:46 -0700 (PDT) Received: from localhost ([::1]:52712 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jnhVk-0003sD-PQ for importer@patchew.org; Tue, 23 Jun 2020 07:54:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44220) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jnhH8-0003BV-58 for qemu-devel@nongnu.org; Tue, 23 Jun 2020 07:39:38 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:34836) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jnhH6-0003Ie-28 for qemu-devel@nongnu.org; Tue, 23 Jun 2020 07:39:37 -0400 Received: by mail-wm1-x32a.google.com with SMTP id g21so2877004wmg.0 for ; Tue, 23 Jun 2020 04:39:35 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id m10sm4022177wru.4.2020.06.23.04.39.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jun 2020 04:39:33 -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=TIdOwUcKS8Gkz5ItNSYHwPJjx8yUuXeef+8VZHen8tM=; b=imy4i4Co6UtuJzDk0F1E4i7QeE36rYb+vtDSf+yrjRXTXfX7DHXgRtccBP4X3kZNmJ u55HjgLJ24gZNThHiPesfWAbEURzl3JZLcFkikMeqrfA3mQxPSOoq5m5aMlBoZeDeASY h3C+OV+Mo8ZBAfkQY30V5YsBUjmnkbmY8vIFB9BfLItbxDOpkkIpqAga94aHVelGfzaP zx+kTFN/MT+H1WLZsv0yAFLkzyVKTNO4scYEFplY+EF5bxYaUwkjGfAT/Z53bxRn7YaD WkBsIHStssp7IzMurUv72IQhleIwvIUtx1aqa0nvfNiCzn9PekWdgEIQBWJvuJFriy07 SmCw== 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=TIdOwUcKS8Gkz5ItNSYHwPJjx8yUuXeef+8VZHen8tM=; b=qtBYXQ8ERt0IwTT/b1Jeo5DRoiQ1evLJX0s2O/a7pp/O1h1XJVvo6gXRZdGbq2eagR QesoKTyoKmWdP+b5GVyyPmREhDgyK2CIqRv2sHl/eprOlE7Ix/mgxSdV9nvzHlSe1Ave xludtMA73sVnBoEsCBTFQ4MjKuBLztqEg24zKEx3I72vHRKDhHaHwvmjrwKr9SN4ZiBr 8I0qHE5SRO3L7CC3d6MOmP6Iwyr7sHzxw6ynDa3qi938Xvl0aNskVXrtuQdX4mhLDdnd GNwROV+AHpk1TQNzIXkowqjCSnZ/nJSkCNhioBycpmIolcgjtCouyZokq/6Aoj+syVTe 5QeA== X-Gm-Message-State: AOAM532lMkTUS2KJLgumzpgdEqGgJZV1nRTOy4dq10Jg650PmT/txyze VtR81C/ObMDha8D4lpJdVIgSHuPIuYE+KQ== X-Google-Smtp-Source: ABdhPJzpkT4+445FBBC0kusfDrJseOsuVV2JdKdBNiUqdZ58dvfBhYnR97yGU8wa1EaNv0m7nLuw2Q== X-Received: by 2002:a1c:e910:: with SMTP id q16mr10371833wmc.188.1592912374300; Tue, 23 Jun 2020 04:39:34 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 24/42] target/arm: Remove unnecessary gen_io_end() calls Date: Tue, 23 Jun 2020 12:38:46 +0100 Message-Id: <20200623113904.28805-25-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200623113904.28805-1-peter.maydell@linaro.org> References: <20200623113904.28805-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32a.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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=_AUTOLEARN 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Since commit ba3e7926691ed3 it has been unnecessary for target code to call gen_io_end() after an IO instruction in icount mode; it is sufficient to call gen_io_start() before it and to force the end of the TB. Many now-unnecessary calls to gen_io_end() were removed in commit 9e9b10c6491153b, but some were missed or accidentally added later. Remove unneeded calls from the arm target: * the call in the handling of exception-return-via-LDM is unnecessary, and the code is already forcing end-of-TB * the call in the VFP access check code is more complicated: we weren't ending the TB, so we need to add the code to force that by setting DISAS_UPDATE * the doc comment for ARM_CP_IO doesn't need to mention gen_io_end() any more Signed-off-by: Peter Maydell Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Richard Henderson Reviewed-by: Pavel Dovgalyuk Message-id: 20200619170324.12093-1-peter.maydell@linaro.org --- target/arm/cpu.h | 2 +- target/arm/translate-vfp.inc.c | 7 +++---- target/arm/translate.c | 3 --- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 677584e5da0..cf66b8c7fb0 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -2334,7 +2334,7 @@ static inline uint64_t cpreg_to_kvm_id(uint32_t cpreg= id) * migration or KVM state synchronization. (Typically this is for "registe= rs" * which are actually used as instructions for cache maintenance and so on= .) * IO indicates that this register does I/O and therefore its accesses - * need to be surrounded by gen_io_start()/gen_io_end(). In particular, + * need to be marked with gen_io_start() and also end the TB. In particula= r, * registers which implement clocks or timers require this. * RAISES_EXC is for when the read or write hook might raise an exception; * the generated code will synchronize the CPU state before calling the ho= ok diff --git a/target/arm/translate-vfp.inc.c b/target/arm/translate-vfp.inc.c index e1a90175983..bf31b186578 100644 --- a/target/arm/translate-vfp.inc.c +++ b/target/arm/translate-vfp.inc.c @@ -119,15 +119,14 @@ static bool full_vfp_access_check(DisasContext *s, bo= ol ignore_vfp_enabled) if (s->v7m_lspact) { /* * Lazy state saving affects external memory and also the NVIC, - * so we must mark it as an IO operation for icount. + * so we must mark it as an IO operation for icount (and cause + * this to be the last insn in the TB). */ if (tb_cflags(s->base.tb) & CF_USE_ICOUNT) { + s->base.is_jmp =3D DISAS_UPDATE; gen_io_start(); } gen_helper_v7m_preserve_fp_state(cpu_env); - if (tb_cflags(s->base.tb) & CF_USE_ICOUNT) { - gen_io_end(); - } /* * If the preserve_fp_state helper doesn't throw an exception * then it will clear LSPACT; we don't need to repeat this for diff --git a/target/arm/translate.c b/target/arm/translate.c index 408fb7a492f..795964da1f1 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -7785,9 +7785,6 @@ static bool do_ldm(DisasContext *s, arg_ldst_block *a= , int min_n) gen_io_start(); } gen_helper_cpsr_write_eret(cpu_env, tmp); - if (tb_cflags(s->base.tb) & CF_USE_ICOUNT) { - gen_io_end(); - } tcg_temp_free_i32(tmp); /* Must exit loop to check un-masked IRQs */ s->base.is_jmp =3D DISAS_EXIT; --=20 2.20.1