From patchwork Thu Oct 27 10:02:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 619178 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp175569pvb; Thu, 27 Oct 2022 03:06:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6hine2KYP/dZW9miC9tETR3xINitVCkrMdGZPKW97gidfr6RLMBv9fjCJm2JAPuGBlWl7Z X-Received: by 2002:a05:622a:1493:b0:39c:e9e4:312 with SMTP id t19-20020a05622a149300b0039ce9e40312mr40595515qtx.49.1666865168851; Thu, 27 Oct 2022 03:06:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666865168; cv=none; d=google.com; s=arc-20160816; b=F+BE1kFX2HDrCpuTwnduYYtpxkBmmkmIsmPGVoKzsnTB7g+EGUe44ihxmYcQmzCT+D 9OD5S+CbhtH+4hIcsOOShrmloUsV/wqrC5Duo5bIgH9s0C/wz5Jjk2QqaHBe6ViaavGO tCqwSs6ie8v0UsPQhSdDGe8Dut+YAoLibQFGuk1/5Gy0cffxCOq7gr+m9wn5AWyQeAJR MrCPBYCJFx1Xzx1hZIlcfQ5OW9zVSgp+7Qip9FzUQNFoQRQXay7iMkDK2uUZELog/qxs lf5eCq/ZFFbWayBiB18fkD2pMofVC5jILPr1kU3Gs9vsizTYrmF+EnK2e78UiMIi/6Ig voKQ== 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:cc:to :from:dkim-signature; bh=i4zXGhAahLgSXdO3U/esGQ4mxgb9DP6esDERUUVmeB4=; b=IFA5g6mFd58nJ3P+IdLco7AiLK/NcNb0UzY2iX8wPTdFJZlUOS4RF8UY0rgzV1clxk 0fEuEXMBrXqYb+xujAZHBBsP0sEw1Ag3APBH7HM9UOoon9qHwtjarZL2rgkmV5z6L/fL gdGEur1rpV26IhGluuMZXefd6I1Afm3JjWvCPA9tWNjqyxjYByvZx5G2hhBnqDp86lyn DePwQLWPaarL5vBOeXz4nGP+3NUR3YIpDM+ZAH1Mh/2+6D9sKLk+bHkPEDfNqCrfCBOe g5QDAq/bHzqj/gxSQHeA7QJrXaUhL2D2Q2kgaO1hjcthVUZYSeFTX7bHd2sCsXklG6+4 qsbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kZP9a0wr; 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 l11-20020ac8724b000000b00398f9199e9fsi523945qtp.724.2022.10.27.03.06.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 27 Oct 2022 03:06:08 -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=kZP9a0wr; 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 1onzji-00083t-Dw; Thu, 27 Oct 2022 06:03:42 -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 1onzjY-0007O7-EK for qemu-devel@nongnu.org; Thu, 27 Oct 2022 06:03:32 -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 1onzjV-0004Gd-I4 for qemu-devel@nongnu.org; Thu, 27 Oct 2022 06:03:32 -0400 Received: by mail-pg1-x531.google.com with SMTP id h2so851611pgp.4 for ; Thu, 27 Oct 2022 03:03:27 -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:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=i4zXGhAahLgSXdO3U/esGQ4mxgb9DP6esDERUUVmeB4=; b=kZP9a0wrjTxiZWCgdkAAOSMDxyZPtKB7Sr0kkfzSMVgib+KoU09/9I/Gqy46voRYSq OSv6T03K1HM6gVxdWI9Yq7ItWPA/vcehP90iycBOTxtnURpx1aUHfL0mcprcwVKg2I3A PPRRspUXaIQUEg8qkqFdXn4XY5hXlA1DKMrdv+L04maZE5GmBkR02Fhu9FhkBF41ii66 SVYDkHZTrvH8xzvj5fxi7J9rsZ2nVh2HumSpuH3tkNf7d484hLo/LSXqFbFc9W/ekK5l 4YunTfcPSxRriHYhdWiJgWOZqqUUki6o8gq6TIthx7zT8yJ/sLMx/aKxYqOFkWtJWFoT oDmA== 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:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=i4zXGhAahLgSXdO3U/esGQ4mxgb9DP6esDERUUVmeB4=; b=wcDLTovkm9mW5zljs+v6mu6ZwXFTHGK2HAB0wqKYzPs6hZxZtURqRUJDQyVkIViPR3 AT0xaiRv5YAHG2PxvP8/yWrTZxSAeeugiO5OEnTVdbfF05oqH1wcD7WarU+X64VIrueQ N+K5YAU6GLxrAplLv6EyCeSOuUVKXqmdtSNKIbX5xlHbjeRBEJ2WpP/KfrUL4GkoyaaM F3h7Yrn0K5Al7wGZzAUX6Xr7lAw34t0ba31jNYXatE4pIpbR+RZGQcfXd2153qb5A9Nc LiHHEr2Xwygym8VgpYWT2zSKdQVAFYech9AB7idUq08k1FXRluSwCyBKlWGnXFzIcCXp M76w== X-Gm-Message-State: ACrzQf0DedicHp4mFxVcKbqduijrD+gtw63xnLKa1CXvBDvE5gpl8jKy xXpEC8Lnu0Zy7g/JJXKsxCdRBYxGktMc7blj X-Received: by 2002:a63:2c4c:0:b0:434:e001:89fd with SMTP id s73-20020a632c4c000000b00434e00189fdmr41231987pgs.444.1666865006768; Thu, 27 Oct 2022 03:03:26 -0700 (PDT) Received: from localhost.localdomain ([2001:8003:501a:d301:3a91:9408:3918:55a]) by smtp.gmail.com with ESMTPSA id n13-20020a17090a2bcd00b0020a825fc912sm2354631pje.45.2022.10.27.03.03.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Oct 2022 03:03:26 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: cfontana@suse.de Subject: [PATCH v2 6/6] accel/tcg: Remove reset_icount argument from cpu_restore_state_from_tb Date: Thu, 27 Oct 2022 21:02:54 +1100 Message-Id: <20221027100254.215253-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221027100254.215253-1-richard.henderson@linaro.org> References: <20221027100254.215253-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. Reviewed-by: Claudio Fontana Signed-off-by: Richard Henderson --- accel/tcg/internal.h | 2 +- accel/tcg/tb-maint.c | 4 ++-- accel/tcg/translate-all.c | 15 +++++++-------- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/accel/tcg/internal.h b/accel/tcg/internal.h index 9c06b320b7..cb13bade4f 100644 --- a/accel/tcg/internal.h +++ b/accel/tcg/internal.h @@ -107,7 +107,7 @@ TranslationBlock *tb_link_page(TranslationBlock *tb, tb_page_addr_t phys_pc, tb_page_addr_t phys_page2); bool tb_invalidate_phys_page_unwind(tb_page_addr_t addr, uintptr_t pc); void cpu_restore_state_from_tb(CPUState *cpu, TranslationBlock *tb, - uintptr_t host_pc, bool reset_icount); + uintptr_t host_pc); /* Return the current PC from CPU, which may be cached in TB. */ static inline target_ulong log_pc(CPUState *cpu, const TranslationBlock *tb) diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c index c8e921089d..0cdb35548c 100644 --- a/accel/tcg/tb-maint.c +++ b/accel/tcg/tb-maint.c @@ -536,7 +536,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); } #endif /* TARGET_HAS_PRECISE_SMC */ tb_phys_invalidate__locked(tb); @@ -685,7 +685,7 @@ bool tb_invalidate_phys_page_unwind(tb_page_addr_t addr, uintptr_t pc) * function to partially restore the CPU state. */ current_tb_modified = true; - cpu_restore_state_from_tb(cpu, current_tb, pc, true); + cpu_restore_state_from_tb(cpu, current_tb, pc); } #endif /* TARGET_HAS_PRECISE_SMC */ tb_phys_invalidate(tb, addr); diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 90997fed47..0089578f8f 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -282,12 +282,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. */ 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 @@ -300,7 +299,7 @@ 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 @@ -333,7 +332,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; } } @@ -1032,7 +1031,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 @@ -1068,7 +1067,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