From patchwork Mon Oct 31 22:01:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 620262 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp3128172pvb; Mon, 31 Oct 2022 15:03:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM75fz8uB6Era25RiVCZCzyfxcEccDhJguYT/I74c317FHZX8X8UpOBr9v9LgM4ryyuojqe/ X-Received: by 2002:a05:620a:131c:b0:6fa:1888:2a68 with SMTP id o28-20020a05620a131c00b006fa18882a68mr9077454qkj.761.1667253807887; Mon, 31 Oct 2022 15:03:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667253807; cv=none; d=google.com; s=arc-20160816; b=hdYVhY3fuJqqQZ2WCpi2aRAhgyyvPWjTVqX/zKCGLaZ91Gjjdvo3Hcebr/t8wj8d0s doLg3b4SAt62Ria2jdG1Lma/ZIUilpF5cUTdfdGJCRTfbWw63MP/evfy0EA32GOrt3Wr W+AwAc+39+isuIUpSNv0KnMZ28SN9pzcv4GqNv1XEYODIEXJN+I9fjVDaGvlcUU1SSYn 2G0yk8fay/GMGFaHfOZnnpYMJugjqFVGyK0f8cTTzI7mLymUwPl1LIBKsebNZ/5B+GcB YTF1KR+p9s4hINPW92TbFptnRPRtbkARjsD+pBAbb+jdnCxuY7aw0l7a3kyCMaHe8UUv UIZw== 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=uhCsUdFjCjm7NLsxtQpH5IXHOEmssyzLxVhJRitR2HsAZeFp3a+oQfvJa0g0mCpC2r ZVpZRG9jSW3eEUjn2pulNOjMTIglQzyXmgIAX4wweETzhxZA5eaoUC8Vyg5xna4MuQSo fpzzwDHfITd550exWYkTwUvynCTob2qdRcZJbLzRzqLTp9+r4V/leq1n8aMjOvpcYgcO 7yuuoeOcJ1crPFDQmUkjDBphlv09lTeQtFeJaVsGhEzyZvJzOhmBA+mOUd7Zx6nJu0ET EvgNNe/XBHpAkvEXqN4Mhm4c1/mvm1ZntYoY1CncRxNivynq98FCEoJw7MRSyVNjsGM2 9Ykw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=M5vekugy; spf=pass (google.com: domain of qemu-devel-bounces+peter.griffin=linaro.org+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+peter.griffin=linaro.org+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 bq17-20020a05622a1c1100b003a4f4d6449bsi2749284qtb.127.2022.10.31.15.03.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 31 Oct 2022 15:03:27 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+peter.griffin=linaro.org+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=M5vekugy; spf=pass (google.com: domain of qemu-devel-bounces+peter.griffin=linaro.org+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+peter.griffin=linaro.org+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 1opcqy-0005Vo-CZ; Mon, 31 Oct 2022 18:01:59 -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 1opcqU-0005FC-EY for qemu-devel@nongnu.org; Mon, 31 Oct 2022 18:01:33 -0400 Received: from mail-io1-xd30.google.com ([2607:f8b0:4864:20::d30]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1opcqS-00015T-Nu for qemu-devel@nongnu.org; Mon, 31 Oct 2022 18:01:26 -0400 Received: by mail-io1-xd30.google.com with SMTP id p141so10933718iod.6 for ; Mon, 31 Oct 2022 15:01:24 -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=M5vekugyVmneOtnAbz3CJzUp0bmppL8R4FR8iVUyIScgCorL93Yza0ZmjeUBRxNf6j ztnFUFADt5IFVOnf4H8apNDHnbnVmwfHXSPVVm2pJLQuOf38PGLBeG5b5uGXy+JGR6bz 4bX5wLE96txlmW7ZGk9ssO10TDQT7n+joHY2uy7pKbp4tVlZk9x3QVTRuPgeKsDGliBN ZTWzJ9omPTfl+9b4kCsy+8NccsdHe6fFs0RD9rdq0wd8YFhJvFBmdzcYqJKtOIb3+8Lq 51CvXA1Iccwy0ygS3JePRnl3M25IkeAj/psY5de1Bj0mQQHHpy45gq+51e5FSiBVHw3Z pcJA== 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=Q5rQjmyW2JcyM8/6Q4+WevrYi26n+WsCaGzVHx8507sPa+ai6MT/kzW859Q17o3sF0 093rL3EEK9jyg6KD6WCwqBx4eh60PLsjfPeML/72wZ4va270peOYwkH3NQhVET6IKQt8 Q9w7D1cTptNcti9j51kSVX/+04MCUR+HcUyCdPZpfVJy8zRrO/9dTbiOTgG4J7VUmNyr p9lVYPLFAi3PQlAKVgK5EWZXnCgpw/arDl6qGEOeS0o2xYZiT6AXyBIxY0mt2Bn5kqpi 806XIL5l+Glq23Ohd7sh2VgJd/QIsk5dF3geb+BalHfT0nFQ3hqz9fgYz9AbDYOxydtF xcqg== X-Gm-Message-State: ACrzQf1QzApqWyUwpW2CXt0dKlvyAENa+a72+6Qi6WmiyvNb+44tpYEk Ten+Ae/EIeL20s2xqL3Jr4xbqqW1C6n7cQ== X-Received: by 2002:a05:6638:1210:b0:375:4aa6:ff85 with SMTP id n16-20020a056638121000b003754aa6ff85mr6843097jas.227.1667253683964; Mon, 31 Oct 2022 15:01:23 -0700 (PDT) Received: from stoup.. ([172.58.176.58]) by smtp.gmail.com with ESMTPSA id s7-20020a02c507000000b00363ec4dcaacsm3203039jam.22.2022.10.31.15.01.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Oct 2022 15:01:22 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: stefanha@gmail.com, Claudio Fontana Subject: [PULL v2 10/13] accel/tcg: Remove reset_icount argument from cpu_restore_state_from_tb Date: Tue, 1 Nov 2022 09:01:10 +1100 Message-Id: <20221031220113.414796-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221031215723.414467-1-richard.henderson@linaro.org> References: <20221031215723.414467-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::d30; envelope-from=richard.henderson@linaro.org; helo=mail-io1-xd30.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+peter.griffin=linaro.org+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