From nobody Sat Sep 6 18:50:34 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=1757136014; cv=none; d=zohomail.com; s=zohoarc; b=lA2rldCZWML83QhgeN2rCRqQKgAIUjgNDphWsmjzpCp/MmLBfEChG5/YU3MsJ6K7Z3KUlSN2q6jbrOSJfVFJJldwwvzAFsR/IPalOnq1kbEK0XaDO5u1WtCPehJTZ7b2L8Vw8Leu/yOFNv5ILhOJEfka8w5noGqCFS2+c7ve5EM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757136014; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=v0lsKCQL+YqSEvwOxx8MYwslyW+UoFwzM6ZVUUq2n68=; b=NZsonT9GcBDrFqxyclx/eV1wuzVJD6maYLsSfEgMN+FaL7+6bi3473sEwVxsc7LTL0nVAA45foPj3eHfm4U2Jrv4KzLLZ3EUe844fMIv68/VqvvrnMZlr4YVU+2jkDNitbmT3KhkZf/An0PrUMJgjsnbVM7lyMtzpYKZAjFXTrg= 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) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1757136014191275.9563509109523; Fri, 5 Sep 2025 22:20:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uulKL-0000Pu-Hl; Sat, 06 Sep 2025 01:19:07 -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 1uulK9-0000MJ-Hb for qemu-devel@nongnu.org; Sat, 06 Sep 2025 01:18:54 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uulJt-0006pG-28 for qemu-devel@nongnu.org; Sat, 06 Sep 2025 01:18:53 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-45cb6428c46so22902595e9.1 for ; Fri, 05 Sep 2025 22:18:34 -0700 (PDT) Received: from stoup.21wol.it (93-51-222-138.ip268.fastwebnet.it. [93.51.222.138]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45b6f306c22sm441197735e9.13.2025.09.05.22.18.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Sep 2025 22:18:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1757135911; x=1757740711; darn=nongnu.org; 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=v0lsKCQL+YqSEvwOxx8MYwslyW+UoFwzM6ZVUUq2n68=; b=SazRQJIzLeP3tLxLQYQ4+U46bx8obuc+XTI6pIfMXXJ8no34Oma+jABNPLvmCwB7/I ddMquOdOxjh7aoSi8NyuTJDLqIuVXstXeZWfWvNHSSayPtk4P6eZBeG6AutHytsFcUJ7 fZfSUt1Y9WYGR7By++LVaAreckpTfHiKnmCGzcpnRqeEUKunBne4KaSGFSnF8xFVKXLC oC9PT7M8As4UM6FvniXYAAteUP/Z2cfNLc0X5Ii7gR/aVoqf+ASTVbIIWxSTDKuDYqrR Dtk7ImpNl+MYap3s7rlYJ5sLfTvEKye3PlRXvobT/QC40DmvL8wSY2UHp9AaO/F6cAFo 2C6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757135911; x=1757740711; 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=v0lsKCQL+YqSEvwOxx8MYwslyW+UoFwzM6ZVUUq2n68=; b=thhyCIKWByyPX9HYfuk1qx0zpmFxy4NcMfNI+oXFV//mCAJSB6X17SUNt9YuL+3MtY MUmh7ftJh2ld4H0/Z5bsRaMCkPUiyOxtjoYqWpHgp0U8YqYQtV+wvjZ+jcifcXC9sBHW U1tLOI6WZsOMzeiQBz7v5t6ld+l0bDXDfHrEsMd/e47TgWJZkTYuUoY3R4qzF+0/XznI MGF6sKJaY8HHXUuWf9Sh9/N4OivyCtQkPY9O9VygqQj2IQeGpOTAmLNYkAqPTfeRivIs HLBOwE5HpC/CL8mhzYpDA3GbVSBJ2cgVYUbLyypce/ddl2gbfXeU1FOZiVNlA1HLG3lo uhkw== X-Gm-Message-State: AOJu0Yx/TuNHTWF+ZqhprZA0txhclZrOAI55iaalZHWh5l2wF8ps5+JN V3qG6pT6iXoMbqX5yl098RtZUxRkoQebM2muL29zMnTxwKc9neCOsHucdAq77sACqmZ7XfM0pMF 6nYDBd5w= X-Gm-Gg: ASbGnctUVzwNzDQmpwz/8pSFVmrp8ZX4TiepByeoO6Y8YIOxdgnZY8rzTzbiJXBjnVz 9HehRrjqIvHrIRcamENCDUJH6GNI9cntimFkiXxkHFXRlvgiE9YMbLdnWSAcNE+R64fANGaOfyU 4Oqy5UrCT5jMojZijmSU1+2Opja3aO0UN5m5tKvDqmIlsDeRaBxuo/XErBdAqXSeNj9CyQSsxZH cOt0JQXx8Y5cxpMYBijaAVlDBFTnysIBmaO/CPN+IY31ua61eWNVuH9C74F7xry4jxc8LnQbfkb KW3jD9fdnqHx6kTLPP0i1yUJmYVn8ob0UDPXpjox7jvZ7UQEnEx0PX9v46b6N1AcLK01d6lBXOs /+4baWWWyhXlN4G/u/GhXmpKEs8wIY8VjJ8XQaBVKqTwaDfGLRnHwt+w6S/payM19Ri+DyedLYC r8mJxpnG8= X-Google-Smtp-Source: AGHT+IEdfjJblnOldJkH6fLe9Qi5fP1TuUCXHGlO3YEW8NIom8f8JUiORAArwcVBdicVFmb10ZKFAA== X-Received: by 2002:a05:600c:4683:b0:45b:83fe:9cf7 with SMTP id 5b1f17b1804b1-45ddde95a94mr9680615e9.6.1757135911124; Fri, 05 Sep 2025 22:18:31 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: alex.bennee@linaro.org, philmd@linaro.org Subject: [PATCH 11/11] accel/tcg: Remove tb_flush Date: Sat, 6 Sep 2025 07:18:20 +0200 Message-ID: <20250906051820.160432-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250906051820.160432-1-richard.henderson@linaro.org> References: <20250906051820.160432-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::331; envelope-from=richard.henderson@linaro.org; helo=mail-wm1-x331.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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1757136016469116600 Content-Type: text/plain; charset="utf-8" All uses have been replaced with tb_flush__exclusive. Signed-off-by: Richard Henderson Reviewed-by: Pierrick Bouvier --- include/exec/tb-flush.h | 19 ++++++++----------- accel/tcg/tb-maint.c | 22 ---------------------- 2 files changed, 8 insertions(+), 33 deletions(-) diff --git a/include/exec/tb-flush.h b/include/exec/tb-flush.h index f3898d1826..d6586b9d5f 100644 --- a/include/exec/tb-flush.h +++ b/include/exec/tb-flush.h @@ -9,21 +9,18 @@ #define _TB_FLUSH_H_ =20 /** - * tb_flush() - flush all translation blocks - * @cs: CPUState (must be valid, but treated as anonymous pointer) + * tb_flush__exclusive() - flush all translation blocks * - * Used to flush all the translation blocks in the system. Sometimes - * it is simpler to flush everything than work out which individual - * translations are now invalid and ensure they are not called - * anymore. + * Used to flush all the translation blocks in the system. + * Sometimes it is simpler to flush everything than work out which + * individual translations are now invalid and ensure they are + * not called anymore. * - * tb_flush() takes care of running the flush in an exclusive context - * if it is not already running in one. This means no guest code will - * run until this complete. + * Must be called from an exclusive context, e.g. start_exclusive + * or vm_stop. */ -void tb_flush(CPUState *cs); - void tb_flush__exclusive(void); + void tcg_flush_jmp_cache(CPUState *cs); =20 #endif /* _TB_FLUSH_H_ */ diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c index d1695be00b..0fe7a0de8a 100644 --- a/accel/tcg/tb-maint.c +++ b/accel/tcg/tb-maint.c @@ -778,28 +778,6 @@ void tb_flush__exclusive(void) qemu_plugin_flush_cb(); } =20 -static void do_tb_flush(CPUState *cpu, run_on_cpu_data tb_flush_count) -{ - /* If it is already been done on request of another CPU, just retry. */ - if (tb_ctx.tb_flush_count =3D=3D tb_flush_count.host_int) { - tb_flush__exclusive(); - } -} - -void tb_flush(CPUState *cpu) -{ - if (tcg_enabled()) { - unsigned tb_flush_count =3D qatomic_read(&tb_ctx.tb_flush_count); - - if (cpu_in_serial_context(cpu)) { - do_tb_flush(cpu, RUN_ON_CPU_HOST_INT(tb_flush_count)); - } else { - async_safe_run_on_cpu(cpu, do_tb_flush, - RUN_ON_CPU_HOST_INT(tb_flush_count)); - } - } -} - /* remove @orig from its @n_orig-th jump list */ static inline void tb_remove_from_jmp_list(TranslationBlock *orig, int n_o= rig) { --=20 2.43.0