From patchwork Mon Oct 24 13:24:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 617875 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp2743627pvb; Mon, 24 Oct 2022 07:04:54 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7kcV87WonKW6PjXo9QooJr3uBKyUEhulFaLlN05goE355wuWSoGydJaWWZxmseBOaH5SwP X-Received: by 2002:ae9:ebc6:0:b0:6ef:41a:17e9 with SMTP id b189-20020ae9ebc6000000b006ef041a17e9mr15956406qkg.709.1666620294010; Mon, 24 Oct 2022 07:04:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666620294; cv=none; d=google.com; s=arc-20160816; b=RW6IhiLUGtMiYIx3G4LMGvwnI4uw96TmXboJrBCI/oz+2U5B5Zuyqyzbhpon5NbLIK BclXgWDEY6O83bMVjM7tzdm6IbhVMAsNGTZs6rpoTmFr2gNu9DY+rsrf45gkWMj6iL1J 9TEBvFJe/zOLzrmuZJpPis6e2S90o2lXEhS9oOUObSCvf6bZpLsw3kqsSHGLQJyBk2rd HNvlv4IzA0NtW9h6/ObB7LDeS6CZP9ulWbyz9C/KLV3E6mMzvfkepOVVE6MIivjvNUGm Pq4J8T3t8aP8guoH2xyx/U/yGbHhYmRAiaC+p4kcT5Cs1AzRCUwhFkzKSP1rPDdwoWyv 594g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender: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=f8qsMcCsQagx0RPMC3BDVQY/Bl0raSyyh0zngsEm1gg=; b=Z1tlhFr3PwTUJUYXPZh4j6ZK8fjiI9O4dCCtJ7Z7+Bx2Btfg5xtsJ5Y7Xvz8arfPmF EdPVYtPr9G2yr0vhVl7i27wVzGMSMVLrdaA+yZfmYCZtUHfVTiiixPceGB2ExjESOudm YlGf5cGOVTfoy//MX8u5rcNK81IYh119byNkdjrRdLwWr5ac06tb83bw+AIoGF9BWvti ztqPLsGL1NwWXs1rXqZybF8mRsIKhnQrpBW4vsEOJTXYUnr7n2CSn61FKhOPkfHwQYuB wu4bdoE0c9B4Rh3/EVhNakREIJ0YVOtXsQYS6FlNgFkwpoAjZ/vOMFgXj3+Xqj7J6Rp9 2YCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IkLdm1m8; 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 bi34-20020a05620a31a200b006cf982c28absi16645615qkb.687.2022.10.24.07.04.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Oct 2022 07:04:53 -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=IkLdm1m8; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1omxTM-0003gP-8a; Mon, 24 Oct 2022 09:26:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1omxTE-0003b7-Ie for qemu-devel@nongnu.org; Mon, 24 Oct 2022 09:26:24 -0400 Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1omxTC-0004Dt-Vy for qemu-devel@nongnu.org; Mon, 24 Oct 2022 09:26:24 -0400 Received: by mail-pg1-x531.google.com with SMTP id e129so8666114pgc.9 for ; Mon, 24 Oct 2022 06:26:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=f8qsMcCsQagx0RPMC3BDVQY/Bl0raSyyh0zngsEm1gg=; b=IkLdm1m8k8vObCoOFbHK97HUhGpL3KJo9Dq3Doc56b7wjGiXrW1xudd1AZR2BwZzwZ 4EdSw0YbOvwmjMli10KGq+459ZSFxWjIvIaQuj85JgQuMwLJ5becRje96QpPAzvm7gy6 fNhMuBg/TLWabQ/H+lFVtCy39crHzfQILhokLoIpMm+VNrHSrIKikQJMTIHVqo0RRVr4 DdYs3aQYFIrJoZoZXClPh9K8A71xtbg0qefhF0+8DhCrVcbWEpbqy+nzBEirUcU0QTlR Vz3+3A6tbr/PgJypR+Sz1y7l8s368pvUUpAlWgqeUFaW8zFupQp4XR/WjW90/4YT8rKD aM7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=f8qsMcCsQagx0RPMC3BDVQY/Bl0raSyyh0zngsEm1gg=; b=2AEEZLNWwi+ljjeqoQkUi4xeyxC899S7nnslnXPIS+THTNABD1r828kjaKLHVHi+n5 kQQwV9X5diDKe0QSKhn69oXAWf2HbnRgooEFDrrqIvZo/sLItNwIInAXYGu6KCCf/MTC l0Io+MUUdTe4G3S4n9a6wZvplULpV/7GUVnKp6SlqQB4z+bZfIU+UdAs1uWnnKpM+uhp suQWSu+qtozn17LmcGPLtkJ5nRvLL2/VTWycw1DyY6M69eO1FmP7z7Yl7urT4c1j204i 1iY4b3JYgUX/ArBRYuJOTHmXQNSE/xvieXuUEHFEuajHjHk6nOr2g6xRwZ4x84jR82dg D+tg== X-Gm-Message-State: ACrzQf3nhiU/bjAQEhP+dbA0RGMiPkdkLBUi7we5Hv6ZayQl/SHcZDli R3WaD3qNLFMxopygUgPE3FRJIJNbiQ6mMA== X-Received: by 2002:a05:6a00:16c4:b0:535:890:d4a with SMTP id l4-20020a056a0016c400b0053508900d4amr33795615pfc.0.1666617981378; Mon, 24 Oct 2022 06:26:21 -0700 (PDT) Received: from stoup.. ([103.100.225.182]) by smtp.gmail.com with ESMTPSA id b12-20020a1709027e0c00b00178ab008364sm17009216plm.37.2022.10.24.06.26.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Oct 2022 06:26:20 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 29/29] accel/tcg: Remove reset_icount argument from cpu_restore_state_from_tb Date: Mon, 24 Oct 2022 23:24:59 +1000 Message-Id: <20221024132459.3229709-31-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221024132459.3229709-1-richard.henderson@linaro.org> References: <20221024132459.3229709-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::531; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x531.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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org The value passed is always true. Signed-off-by: Richard Henderson Reviewed-by: Claudio Fontana --- accel/tcg/translate-all.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index dd439b5e3c..9e7dd41795 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -353,12 +353,11 @@ static int cpu_unwind_data_from_tb(TranslationBlock *tb, uintptr_t host_pc, } /* - * The cpu state corresponding to 'host_pc' is restored. - * When reset_icount is true, current TB will be interrupted and - * icount should be recalculated. + * The cpu state corresponding to 'host_pc' is restored in + * preparation for exiting the TB. */ static void cpu_restore_state_from_tb(CPUState *cpu, TranslationBlock *tb, - uintptr_t host_pc, bool reset_icount) + uintptr_t host_pc) { uint64_t data[TARGET_INSN_START_WORDS]; #ifdef CONFIG_PROFILER @@ -371,7 +370,7 @@ static void cpu_restore_state_from_tb(CPUState *cpu, TranslationBlock *tb, return; } - if (reset_icount && (tb_cflags(tb) & CF_USE_ICOUNT)) { + if (tb_cflags(tb) & CF_USE_ICOUNT) { assert(icount_enabled()); /* * Reset the cycle counter to the start of the block and @@ -404,7 +403,7 @@ bool cpu_restore_state(CPUState *cpu, uintptr_t host_pc) if (in_code_gen_buffer((const void *)(host_pc - tcg_splitwx_diff))) { TranslationBlock *tb = tcg_tb_lookup(host_pc); if (tb) { - cpu_restore_state_from_tb(cpu, tb, host_pc, true); + cpu_restore_state_from_tb(cpu, tb, host_pc); return true; } } @@ -1715,7 +1714,7 @@ tb_invalidate_phys_page_range__locked(struct page_collection *pages, * restore the CPU state. */ current_tb_modified = true; - cpu_restore_state_from_tb(cpu, current_tb, retaddr, true); + cpu_restore_state_from_tb(cpu, current_tb, retaddr); cpu_get_tb_cpu_state(env, ¤t_pc, ¤t_cs_base, ¤t_flags); } @@ -1874,7 +1873,7 @@ static bool tb_invalidate_phys_page(tb_page_addr_t addr, uintptr_t pc) restore the CPU state */ current_tb_modified = 1; - cpu_restore_state_from_tb(cpu, current_tb, pc, true); + cpu_restore_state_from_tb(cpu, current_tb, pc); cpu_get_tb_cpu_state(env, ¤t_pc, ¤t_cs_base, ¤t_flags); } @@ -1904,7 +1903,7 @@ void tb_check_watchpoint(CPUState *cpu, uintptr_t retaddr) tb = tcg_tb_lookup(retaddr); if (tb) { /* We can use retranslation to find the PC. */ - cpu_restore_state_from_tb(cpu, tb, retaddr, true); + cpu_restore_state_from_tb(cpu, tb, retaddr); tb_phys_invalidate(tb, -1); } else { /* The exception probably happened in a helper. The CPU state should @@ -1940,7 +1939,7 @@ void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr) cpu_abort(cpu, "cpu_io_recompile: could not find TB for pc=%p", (void *)retaddr); } - cpu_restore_state_from_tb(cpu, tb, retaddr, true); + cpu_restore_state_from_tb(cpu, tb, retaddr); /* * Some guests must re-execute the branch when re-executing a delay