From patchwork Thu Nov 14 01:12:59 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: 843101 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcc:0:b0:382:184f:390f with SMTP id e12csp48942wrc; Wed, 13 Nov 2024 17:16:23 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWP0u0s0uawhbxvEM18iEWHXdP6k6PQTsQUVaEDLkuBX5uI8uEStcDK3IrJXB5eoERyuAUSzw==@linaro.org X-Google-Smtp-Source: AGHT+IFsKa9GxCU/mB/ny6xIai9/RUH5c9Eulo0Vrq7bRLIT+wNItGEoD86dn2orjSAV3iUAouKr X-Received: by 2002:a05:622a:45:b0:461:5571:5cc6 with SMTP id d75a77b69052e-46358fe3648mr5323531cf.46.1731546982817; Wed, 13 Nov 2024 17:16:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731546982; cv=none; d=google.com; s=arc-20240605; b=i0UXOnZO9dY30YlyC0uiTfTWerN7xGIEaXef4BDNvUuCIuAGmty2O8MejJkHdfc8Hy Gzo0Ck8DoLIePmeInGtE6FQ9ka7gR2j8jbHCMh2D/GraE9fdfiY7Ff3DDaK+hkoRxupR nZ193BH9l2jxH6L9FXZRVRu8PEDasPBhMzsogiGv9j3wUDS6YDDSEOJ56ple8oum8nvq XaEFr4+8SKBGfRdRgDDvuuJv9CUG93ut9ujQtAtHo9ADSzUzg6pSV3D9qf0+0gA3w2mE KG/afhVQmoBaVZ0hUkc1mHDbq30kJAU1JFuQ5ghC6RljbVbQq8643UUfhxM3MiQKLJUd 2y+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=H8uiLmmGjHl/HLmoj7E2H8Y9eTAxD3FMaBkjbXtSXv0=; fh=PtI+10KP2AD2mJcG9WXb486WigI08Ueg9SETF84o4ug=; b=Y5h9zgsz72mErVWZZKurMu7x8wuMb1fUbNxDdmrWrlliqsxhb0GjiQwE+eZoQyrA47 3PD7Nr8fow8IcGTgT4l4hBwBO3boeSCVIqIsjZI292IT2UIjma/BZjRdhO7DdQaPsOdL snRt0sXuHdi9UwlARtuuBc3NWMYUnkBm8BfELH2DgmExLZ3cgNNOQnnAuQzzryKLe9iK PzwnW/dEkIGKyKF5SK6jESCpt3oV+C2Rf6vitSbyO567vypElL+un2U951GI/IeZDHRg Xt6wWmZ8/HzxbgUw56cubK7FTmuNcnx2OIxlSQ+AjggxsZsfEhWPmoFi8Ie2XWz9eYtt Xppg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iQd6E1PL; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-462ff680bd5si173326331cf.588.2024.11.13.17.16.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 13 Nov 2024 17:16:22 -0800 (PST) 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=iQd6E1PL; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tBOS8-0000vh-Lz; Wed, 13 Nov 2024 20:15:20 -0500 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 1tBOS4-0000fW-Op for qemu-devel@nongnu.org; Wed, 13 Nov 2024 20:15:16 -0500 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tBOS1-0002O7-1d for qemu-devel@nongnu.org; Wed, 13 Nov 2024 20:15:16 -0500 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-37d50fad249so78289f8f.1 for ; Wed, 13 Nov 2024 17:15:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1731546909; x=1732151709; 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=H8uiLmmGjHl/HLmoj7E2H8Y9eTAxD3FMaBkjbXtSXv0=; b=iQd6E1PLfhAmmSxaNkK7kRkbGpRAItX8KK1D+sz5Qu97I6dLfFRg622ZkReGncPSO7 BBb1kw+FiynOrlM0WmRktdp5zvz5a/8r78t1fq+b9XCREZiClIp+7QW/gQo5D9ugJfYv JK3mVKBq3s+ZZBNWv2FyKOi91opTSLqmA/huLfRiEEVMXt0h65Bm8MRdg3BHYLNfoWbO ffUwumYbalcDFV3sHUe7+cqYFnIma4AHh2UlWUj77T5qWMSx+fD0uER+cgEypiKvbHJH m9F/RFATzLE2g0cPm1deI4wWuHWE2SGFx40iihnfd0MgXYGLqugyiyju8suC/WHFdTMm U0pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731546909; x=1732151709; 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=H8uiLmmGjHl/HLmoj7E2H8Y9eTAxD3FMaBkjbXtSXv0=; b=qEBSdyaXf/ekgRbZMoWUFhpOw6QnBptEC9ttwpoPw1BoldE3dOO45S/s/X1sJwHf9H hQDfSsRDq+xmyan6qXhJvveOO31urYWb6v+U7UV+6ERIuwV1DZ9o4nvFBN83NITrs0WH 8C6TFTDAIjZI/B0tIc0oYFvqn6TnaDW4Sg0S1+FW8E50nfOqEUUm8n4iWtQ4gnV59GB1 g2FBxBV1MbuzNo7P71s+TUWUUudNzegknwqsvV5NvYYKegpT+y5xyYOgO4+61sdmmmmG 8B70lQ4s6x5+Ddn7+a8kzTlAcDQHRKvmvJUtEa7EL1LGeRRHom4mIkEoYKEiWYJK31Dd vVAQ== X-Forwarded-Encrypted: i=1; AJvYcCViNevRySIlCGqeEXvgQR1Efsu/BRfquuySH+19HepAPptoItVJR43jT/9xG3gBtiEMUwlTGcpbjtP2@nongnu.org X-Gm-Message-State: AOJu0YxLBFNnjJw785waP6i2xepPVtAebrDaBYJfgQZBP5KEqkBYa9r9 qdv6yy/ulb+cMjM87EgclY4rpzua7jbjYlfwOjbhNdY1vsOzcfWi2CHpFWXOv60= X-Received: by 2002:a5d:59a6:0:b0:37d:4d3f:51e6 with SMTP id ffacd0b85a97d-381f186bf72mr19363024f8f.14.1731546908922; Wed, 13 Nov 2024 17:15:08 -0800 (PST) Received: from localhost.localdomain ([176.187.209.238]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-381ed987d95sm19923679f8f.44.2024.11.13.17.15.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 13 Nov 2024 17:15:08 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Paolo Bonzini , Richard Henderson , Anton Johansson , qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Thomas Huth , qemu-arm@nongnu.org, Peter Xu , Pierrick Bouvier , qemu-riscv@nongnu.org, David Hildenbrand , Peter Maydell , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-s390x@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 14/24] exec: Declare tlb_init/destroy() in 'exec/cputlb.h' Date: Thu, 14 Nov 2024 02:12:59 +0100 Message-ID: <20241114011310.3615-15-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241114011310.3615-1-philmd@linaro.org> References: <20241114011310.3615-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=philmd@linaro.org; helo=mail-wr1-x431.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=unavailable 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 Move CPU TLB related methods to "exec/cputlb.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier --- include/exec/cputlb.h | 28 +++++++++++++++++++++++----- include/exec/exec-all.h | 17 ----------------- accel/tcg/cpu-exec.c | 1 + 3 files changed, 24 insertions(+), 22 deletions(-) diff --git a/include/exec/cputlb.h b/include/exec/cputlb.h index 6cac7d530f..5386e53806 100644 --- a/include/exec/cputlb.h +++ b/include/exec/cputlb.h @@ -22,15 +22,33 @@ #include "exec/cpu-common.h" -#ifdef CONFIG_TCG +#if defined(CONFIG_TCG) && !defined(CONFIG_USER_ONLY) + +/** + * tlb_init - initialize a CPU's TLB + * @cpu: CPU whose TLB should be initialized + */ +void tlb_init(CPUState *cpu); + +/** + * tlb_destroy - destroy a CPU's TLB + * @cpu: CPU whose TLB should be destroyed + */ +void tlb_destroy(CPUState *cpu); -#if !defined(CONFIG_USER_ONLY) -/* cputlb.c */ void tlb_protect_code(ram_addr_t ram_addr); void tlb_unprotect_code(ram_addr_t ram_addr); -#endif -#endif /* CONFIG_TCG */ +#else + +static inline void tlb_init(CPUState *cpu) +{ +} +static inline void tlb_destroy(CPUState *cpu) +{ +} + +#endif /* CONFIG_TCG && !CONFIG_USER_ONLY */ #ifndef CONFIG_USER_ONLY diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 2c06e54387..d792203773 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -47,17 +47,6 @@ static inline bool cpu_loop_exit_requested(CPUState *cpu) } #if !defined(CONFIG_USER_ONLY) && defined(CONFIG_TCG) -/* cputlb.c */ -/** - * tlb_init - initialize a CPU's TLB - * @cpu: CPU whose TLB should be initialized - */ -void tlb_init(CPUState *cpu); -/** - * tlb_destroy - destroy a CPU's TLB - * @cpu: CPU whose TLB should be destroyed - */ -void tlb_destroy(CPUState *cpu); /** * tlb_flush_page: * @cpu: CPU whose TLB should be flushed @@ -242,12 +231,6 @@ void tlb_set_page(CPUState *cpu, vaddr addr, hwaddr paddr, int prot, int mmu_idx, vaddr size); #else -static inline void tlb_init(CPUState *cpu) -{ -} -static inline void tlb_destroy(CPUState *cpu) -{ -} static inline void tlb_flush_page(CPUState *cpu, vaddr addr) { } diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 8163295f34..8770493590 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -24,6 +24,7 @@ #include "hw/core/tcg-cpu-ops.h" #include "trace.h" #include "disas/disas.h" +#include "exec/cputlb.h" #include "exec/exec-all.h" #include "tcg/tcg.h" #include "qemu/atomic.h"