From patchwork Mon Oct 31 05:39:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 620201 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp2604963pvb; Sun, 30 Oct 2022 22:42:02 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5jF4/WQ+4JaWJGvd+zG32x9CkIMjlwTl6tCh+VYBQ286oxV4YETAUeUyWPibxrnsx20eWi X-Received: by 2002:a05:6214:242a:b0:4b9:98bf:92d2 with SMTP id gy10-20020a056214242a00b004b998bf92d2mr9392735qvb.89.1667194921893; Sun, 30 Oct 2022 22:42:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667194921; cv=none; d=google.com; s=arc-20160816; b=guOkFIwATUyhC5QsUpI22bUv9yiX1C7s35JSDqLZNiLgVaXNKOElD39PpcIehPSw01 id6hDixOpgEYsTwrnaKMx51oX0546PBVd8g4UnTTIkGP7+HPahbgjHdZZZoskSvtAvq0 m4xzIXW78FVGVzBaU++dw70P+h9PTVm3Oi+4762ZAWc+M0gOnuvm4bh0o5njyRPyv1UU ZfK/gTVrkX1rOsqAcophV/EVOdAUdZ2joS+3uuBLtf2luktGxy4yLwpPUkuhH18RycGB /SDhC0qeTbqCkPIgeDbJ4jZLoBjVVLtN7iq/CCRcQjGJzqQLbm733b6o77SxrbtxQrcQ Z7HA== 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=pHovg2Xl8QyDLQtBEdt9XNRM2MkqgWVEnsJO4pbYzFIjer/6iWf1EFwIhsOHdHkoK1 LOX7Mbs6SbPxFNU+xNe+Pk5IpE8654RfxWLD5ZhBmk57dGCm628kkbhJ7Er+oD3i1P4l IVr8CpV7yGfLz+MW2gGofkgmJ0lQD3Bz60xM7SiP1eTlDqKUS7fS7VFFjhKEpqaEvACV X2tlKONXyHAE3DoG6h7Qmfy+p8iT6nFNY2udc9SaDBJB5r/wMFU8hLKunlTXn1ODDOUX RaakAPMpyXEiReEep7hFIGbFvjKb8DxU0srBVVfzEN4DXTLdC58XzUYudVtaNuSfA+Z3 Vypw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=v690nMUk; 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 eq1-20020ad45961000000b004bb6281f813si3341272qvb.506.2022.10.30.22.42.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 30 Oct 2022 22:42:01 -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=v690nMUk; 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 1opNXW-0001ng-M8; Mon, 31 Oct 2022 01:40:50 -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 1opNXV-0001m5-52 for qemu-devel@nongnu.org; Mon, 31 Oct 2022 01:40:49 -0400 Received: from mail-oa1-x2d.google.com ([2001:4860:4864:20::2d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1opNXT-00045m-Fb for qemu-devel@nongnu.org; Mon, 31 Oct 2022 01:40:48 -0400 Received: by mail-oa1-x2d.google.com with SMTP id 586e51a60fabf-13b23e29e36so12473192fac.8 for ; Sun, 30 Oct 2022 22:40:46 -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=v690nMUk+aUOCBbF8KBNfMPy7DDyo1NIrel5zhYqBjxZf9MmF5cBB5Huc71fGiS/nc BwfQ0y12CqdO/0A8J9q3A9X9KVc+LBtz97XQLCc0TuUdQiNLf2yCLK4306WA+a/rI3Ig ueY8YqUeem7jp0+9HwjkS7O9UI6l9a6EcB+MfX/5q5XnA6UclZs5j6ZJ4YeAUbAh78Mv 37N8/WLUJXwAjfBYMk1XaWG1P6+865MFJCgP5Lqzm6Wircqp2RLwXLkfYCZk21Wje0Yb qxGcmLVsTIeTqshh+8ryhUW353+2HSTuDqMySoOocCfKVNWtNJDg/C8m8XsYjjy1kWy8 NdfQ== 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=J35eT8RymXPVOiiORAk5BY5UO2YQBMIMgx90LiT9xXMMhqT2dmstVmi4JCAB58hUMy 77LdE4vzGxsXX4HNfA67p56gh4WdBlHmlU+ejjz/3IjgogxrLBfwqwqVGHKpaiSPr8n6 HaYt2hDSmrc5LHIsXxN2JbkCwhqsTUn76IZh5NoZQiplOkwHfvou5pYGYivCLekWuWXy GfOUY8e7TIG79aFLMJXotfxcXSJvHxhjhN0Xw3Je5NX+b/9frN4G4MeaPBa8Nj/ZY7oy IivoD3jkDoUmm1dNvi0AD8MJwCrgsfSYCYUEJbJjupIP9189y7/7i7y5g230T4f3zCp7 bAYw== X-Gm-Message-State: ACrzQf2Qi1jpozrd1sNtxwGa8GilE0JUkZh5Kcrc9sPIJuAdYg0oVcPf ny6QVIiE7OlfP9bHIPOyN3MMAdMyC6dodQ== X-Received: by 2002:a05:6870:970e:b0:13c:5da4:aeb0 with SMTP id n14-20020a056870970e00b0013c5da4aeb0mr11772929oaq.27.1667194846093; Sun, 30 Oct 2022 22:40:46 -0700 (PDT) Received: from stoup.. ([172.58.176.235]) by smtp.gmail.com with ESMTPSA id u8-20020a9d4d88000000b006618586b850sm2473857otk.46.2022.10.30.22.40.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Oct 2022 22:40:45 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Claudio Fontana Subject: [PULL 10/11] accel/tcg: Remove reset_icount argument from cpu_restore_state_from_tb Date: Mon, 31 Oct 2022 16:39:47 +1100 Message-Id: <20221031053948.3408-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221031053948.3408-1-richard.henderson@linaro.org> References: <20221031053948.3408-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2001:4860:4864:20::2d; envelope-from=richard.henderson@linaro.org; helo=mail-oa1-x2d.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