From patchwork Tue Jun 4 09:55:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 801381 Delivered-To: patch@linaro.org Received: by 2002:a5d:65c4:0:b0:35b:5a80:51b4 with SMTP id e4csp2312515wrw; Tue, 4 Jun 2024 02:57:45 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW4LkeDnj5NKEvxTZwc9KZsuDmQzkarWrOEvShKTZSi9uiGEDj3IffsaJrVnal8ulfCAOmwtUAy8hgmSnpZQQ0Q X-Google-Smtp-Source: AGHT+IG9vJJ/FhE4Qg9tmhTck2dSOVLwlfwLC6i47qfe/62S2GL5BiU0MXbnjN/O4Vfb/pdevbtg X-Received: by 2002:a05:622a:50c:b0:43f:fc16:6b25 with SMTP id d75a77b69052e-44019d98b3emr31206461cf.27.1717495065704; Tue, 04 Jun 2024 02:57:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1717495065; cv=none; d=google.com; s=arc-20160816; b=OAky7SztJpn0XDVDLP3TZ/Z0nP2KVjLWMqWcKDthFexY9D3vEnwWR74PHd9NHctJ8U xT6cJznN2YM0AdQ88ODdHWj3D6a8MCbFp5NXBnKLeOZhsYJnrFsLCmarPMiO1K1e0rzS p3VOiDlccUg/Tx979EzYK29cOEpp+ZtK8gzwoOadAzMdBuBQqoX0LEdbmsiz/tWYd0eR SvoRV43JWPX/cN6tvI8LtFLsI8/jWkZUB/JACBhp5Bx7by6OvncVk3tk1RJ4ZdYDFuC4 FJr6sNKxjUao+YAuSje93vH6cXsqZlIlEKIeh2iodoL3hu37yDqgaY3Qlwi/RPuWhoQW Ybng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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=Cmg1ayuApwmH79kPzx40QOBelO6dVSgqwUpaSLnFGiQ=; fh=ZOEI4bjC5BR2ZQQDBiGKHpAsfXe7zC3VMY773pmcdus=; b=P0/fZhGL8IohlrfZEe1pd1sItTMszHWfwf0p3h4dwSntWud7Ox3dDOPf8C3S8UXjn0 6plLhzPl+YlPPzG/DMjiwOEyIUmHWhxihNQM5xBKTqP6zc7ylnDZ8029z0eXAFCnF4Dp b1qaDOOhP1+laWW/ynRiKbqGqBmDgbyusFscbAgyNCB4ISsV+LxBKpITBN0BD3Hb9YB+ yTAvnRTKGcGPpWzakiqg5fCE3sHb/QHZQ9s9/g+eUK+Hr3p4CYGKsT2RXKmoV3VdUq+f XJv+h3b+IAyrMPjhAxYJ1ZkzOpv7CMGlg9m9hSo89/fUj5tODvbNgmoNvdeKFBeFUrXr PeUQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YHiAQmUr; 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 d75a77b69052e-43ff257eb9csi107367871cf.462.2024.06.04.02.57.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 04 Jun 2024 02:57:45 -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=YHiAQmUr; 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 1sEQv3-0007iK-7w; Tue, 04 Jun 2024 05:57:29 -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 1sEQv1-0007Sq-HH for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:57:27 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEQuz-000282-1C for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:57:27 -0400 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-35e573c0334so1245505f8f.1 for ; Tue, 04 Jun 2024 02:57:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717495043; x=1718099843; 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=Cmg1ayuApwmH79kPzx40QOBelO6dVSgqwUpaSLnFGiQ=; b=YHiAQmUrSvdPbTySjrFpb2kMvhNiLXAd9lpVFSjnBQinrhDJ1mjfPoPU6ccvKe8nV6 /aO+UnKUr+JfRzIoqRUUUox+mXe4XuIUBdO4qOnEK1RGfgjafI7rwX6U3nJvGv9AoHD2 URCt/1/nCqUVUKscFCnw9cawRDeYcCe5ZDzaILYoegSYwHwozyTXP200wfbJCI7fmn27 iBVlKQW10bcG4VbPY+IyyJ+jN/oQ63awjBw4p3k36qdagbu6guWLjx8uEQnru/juNozO zudkoXnDx9BTkY8iouMx00xmiJ8OMXCfOpYyDF4uz2n4n517iKXLGQ0HQqdPv/btnCQt sT5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717495043; x=1718099843; 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=Cmg1ayuApwmH79kPzx40QOBelO6dVSgqwUpaSLnFGiQ=; b=fOejli+M/+6OrPPsHzkeBpZXfC6yKMlwv734aOHBv0oGkpOtXxD0hl5WIwd2KDp6WR GmRIH/hZ6LLLwBwtV2JOPobiSpmKEc6jwMA4k4+cy78SbALQ4fMA2xBtX5gj8Lonxs96 HNc26g6anyUgl70FPuhGdVrdecrQuXyKAejBojfCHmjN3a0xvGB726oQzKUEN95NdVHw p36MOSZ9GeYlgxKdCV6X82NV9lB8DgZTkFz/p49KB0YDK4aMguAeA9/HFvxDdGayJAot +39q20plA/jtapDroX+q0oFcjEmloBLMc3sTWsgIq+8fZv5q5GpFyei3AjjZ8DdnfULi 5S8A== X-Gm-Message-State: AOJu0Yzaj9Sn4u9KMXjpzcYI1DpZy4a0U4if1GMBbqPpXbVMR3r+yHM5 13FKH0tslQzz6T0KveAmU0Ez+ucrKCPIq5w53JM5qRTOP47+qAS7Eo5z1zVAdswwH2XqqjzkvJI Z X-Received: by 2002:adf:eb4a:0:b0:354:ece6:d9b9 with SMTP id ffacd0b85a97d-35e7c54b2b9mr1879055f8f.15.1717495042682; Tue, 04 Jun 2024 02:57:22 -0700 (PDT) Received: from m1x-phil.lan ([176.176.159.34]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35e4f0fd15esm8443084f8f.68.2024.06.04.02.57.21 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Jun 2024 02:57:22 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Pierrick Bouvier Subject: [PULL 13/32] accel/tcg: Move common declarations to 'internal-common.h' Date: Tue, 4 Jun 2024 11:55:49 +0200 Message-ID: <20240604095609.12285-14-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240604095609.12285-1-philmd@linaro.org> References: <20240604095609.12285-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=philmd@linaro.org; helo=mail-wr1-x42f.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, T_SCC_BODY_TEXT_LINE=-0.01 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 'internal-target.h' is meant for target-specific declarations, while 'internal-common.h' for common ones. Move common declarations to it. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Pierrick Bouvier Message-Id: <20240528145953.65398-3-philmd@linaro.org> --- accel/tcg/internal-common.h | 15 +++++++++++++++ accel/tcg/internal-target.h | 14 -------------- accel/tcg/tcg-all.c | 2 +- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/accel/tcg/internal-common.h b/accel/tcg/internal-common.h index cff43d221b..a8fc3db774 100644 --- a/accel/tcg/internal-common.h +++ b/accel/tcg/internal-common.h @@ -15,6 +15,8 @@ extern int64_t max_delay; extern int64_t max_advance; +extern bool one_insn_per_tb; + /* * Return true if CS is not running in parallel with other cpus, either * because there are no other cpus or we are within an exclusive context. @@ -41,4 +43,17 @@ static inline bool cpu_plugin_mem_cbs_enabled(const CPUState *cpu) #endif } +TranslationBlock *tb_gen_code(CPUState *cpu, vaddr pc, + uint64_t cs_base, uint32_t flags, + int cflags); +void page_init(void); +void tb_htable_init(void); +void tb_reset_jump(TranslationBlock *tb, int n); +TranslationBlock *tb_link_page(TranslationBlock *tb); +void cpu_restore_state_from_tb(CPUState *cpu, TranslationBlock *tb, + uintptr_t host_pc); + +bool tcg_exec_realizefn(CPUState *cpu, Error **errp); +void tcg_exec_unrealizefn(CPUState *cpu); + #endif diff --git a/accel/tcg/internal-target.h b/accel/tcg/internal-target.h index 4e36cf858e..fe109724c6 100644 --- a/accel/tcg/internal-target.h +++ b/accel/tcg/internal-target.h @@ -69,19 +69,7 @@ void tb_invalidate_phys_range_fast(ram_addr_t ram_addr, G_NORETURN void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr); #endif /* CONFIG_SOFTMMU */ -TranslationBlock *tb_gen_code(CPUState *cpu, vaddr pc, - uint64_t cs_base, uint32_t flags, - int cflags); -void page_init(void); -void tb_htable_init(void); -void tb_reset_jump(TranslationBlock *tb, int n); -TranslationBlock *tb_link_page(TranslationBlock *tb); 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 tcg_exec_realizefn(CPUState *cpu, Error **errp); -void tcg_exec_unrealizefn(CPUState *cpu); /* Return the current PC from CPU, which may be cached in TB. */ static inline vaddr log_pc(CPUState *cpu, const TranslationBlock *tb) @@ -93,8 +81,6 @@ static inline vaddr log_pc(CPUState *cpu, const TranslationBlock *tb) } } -extern bool one_insn_per_tb; - /** * tcg_req_mo: * @type: TCGBar diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c index c6619f5b98..2090907dba 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -38,7 +38,7 @@ #if !defined(CONFIG_USER_ONLY) #include "hw/boards.h" #endif -#include "internal-target.h" +#include "internal-common.h" struct TCGState { AccelState parent_obj;