From patchwork Tue Apr 22 19:26:57 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 883050 Delivered-To: patch@linaro.org Received: by 2002:a5d:474d:0:b0:38f:210b:807b with SMTP id o13csp2589256wrs; Tue, 22 Apr 2025 12:41:44 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUGXe3fQ+Jq+SQo9KSH4ilm35ygHOZjgUe+dFRscho1IbgCxE5kty5iXDGYoJcFmwYXglKyoQ==@linaro.org X-Google-Smtp-Source: AGHT+IGbLbHHVHRRlAcCvqXIJLVH5GiF7vzeQhvFn95tPF8h9KT5LbsTv9rp7KXAw1+HqstjTwQh X-Received: by 2002:ac8:5e14:0:b0:478:de12:14f6 with SMTP id d75a77b69052e-47aec3e2ee2mr221320381cf.31.1745350904716; Tue, 22 Apr 2025 12:41:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1745350904; cv=none; d=google.com; s=arc-20240605; b=SO14xkwwpgZP5ao+qeBRzyjTliQXCL8i4ryQghy6xm7DgY4xxVdfQBflOqZcFZs+HZ GruL7oqqJzMpmu3pBUuom/G8Fn9LHMNEZHrK8cvuOt/2ObzkO/2QA3ri6WvYk9Rasqmg wNL14IYIO2CJl5AOK4OpkoTvm22rrZQxk4H5pBNe4qE/wLIN6B5ztDaiLqHm8Ni7gkGK F5Z7WTrtF1uIR0xosD/IZe6c69j4yUoe6OeFTOwu15OBCZ7kCj8iwIjNTDeExNjUzORD YeowC1WffW9DUTmGoW8P14LxIkLpfU2FqqnsVMfzci3fQ3C1deLO/9Zhp+7mSb5Pt+oh 2d1g== 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=Mym6I21VutfSQahS1cIV8VVwJqeJPoQQbXrANWwquXs=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=S9UgTzV1yqo3T5LZQlU9+vp9IClGpR66MtzPaWL3sabsHsqln4IZjXT9T8fCxAF08X PRZxCqDYfU4oO0kQ2hbWtnEjWXgzajkgPh1W4O7bMvCQdzMywLLc2m8/auwZkAKYEDY8 gz6v8XL6NqMdr3uwA7tIe1J5BYJtjAJ52isD5GrXYWu/ujcNpErWTc6lwu6HeOolMDGT ObIRiZKV6sxx9abakhf8rUx7hpj+Of/yHPAn08b1txzNC5OTGaX1wstRvxGT49LtTzY9 Fg6bQ9K6kyx46p2Chi46rDTGvrjf7PasKe9YtEgWjnlbsJD2T1buvs221yzRzT5V0V7n GCZg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Iw/hVEvO"; 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-47ae9ca3b52si119385081cf.266.2025.04.22.12.41.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Apr 2025 12:41:44 -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="Iw/hVEvO"; 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 1u7JOf-0004HP-4L; Tue, 22 Apr 2025 15:35:11 -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 1u7JLp-00010q-D8 for qemu-devel@nongnu.org; Tue, 22 Apr 2025 15:32:13 -0400 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u7JLj-0006ex-Uv for qemu-devel@nongnu.org; Tue, 22 Apr 2025 15:32:12 -0400 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-2295d78b45cso88962875ad.0 for ; Tue, 22 Apr 2025 12:32:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1745350325; x=1745955125; 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=Mym6I21VutfSQahS1cIV8VVwJqeJPoQQbXrANWwquXs=; b=Iw/hVEvOmqyJJQshqXecZe2kQHvTtnM0mKg1j27hkzQuM8uy0tBUpz/dI9mjXeDpPb 23qZuaSK2WWHz2XGf5ebJiwyEScNzT3RpcZpt/5p3xpZ2kBnHMX7HCpdJcOxTvQhmN6x uUT8KaawqcnfTSPweJpvuZA8NE4XVSJyUV9jRkt+DfcXNc8GWw1fhA/5Y9JRYifG41YD XVA8g/UwEbPvbVDRH17wD9hmo4q8iQTmaeyiQiP5rW+ViXpiIos2AEHbhn+xDjqXW4d4 tczgvqnvhsaGNjXGsfsfVZmbZtcC2YBV2Xshm5zLpxgwU9c0byBrbxpY2wsJkxHdsn2l 8kNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745350325; x=1745955125; 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=Mym6I21VutfSQahS1cIV8VVwJqeJPoQQbXrANWwquXs=; b=wrPK0C8nSMO4Tm1WDnN9Yly6G4s+jhXdDz2FzS63L66j8DoeHO8GLhIbiZ2jitePB4 3H8AS4D+tddxjVizYNzF+Ad4LdoT3MiHTTnz2wnzHGpHDNOeY9s+2Wxbr3KtnPDeQ4SC DX9m+OtgEAlXC27Hm80PA0g7L1aGyUPTyEHIufsa0DgVDPe/wi0yWz5JpYU4/3LP+mz5 8bOHB86atjgKMvKgQwqNCPD5NIFgp3v5CH0pRKxa6HdmKWm1PQVbIpX3+D5X/XXAlLOE usOqnjls6atafDJBOStAQU1pZivZfndugPx2TjwDFNshOVujGuU6hVmctaLb3TtJK1hL hL0g== X-Gm-Message-State: AOJu0Yz54BX9xz5m5o7cKtTzSgm+GWnr4af7mc4X236nlfFKejjORw8I /KrwYSQ5JqyENXYhfXFSI1A7Nbvhln6ZtMK/7831E+7ywFDhnM8V3jQkg9cLMl7rG7YhaT1Cmam x X-Gm-Gg: ASbGncvnAg3VT3N1RgxwlSNFwfSBrkT3PooFzfeeiWL3OR+l7ruOMuiBvIOiWT4aD6r OjMSdsqMoFouX4BPpsTk1dHmxlA6+hVVjXE9j33rDEQiJ1ntg/rhUSOtdog3Ev/qFVFHOmcUvro k+c7TVlP7xOxDAy9x3Ql1cvq8dB+3pEEz0tjk6sjZh1jgMzPE75Jtu1kejF//NR3vKZlORkKQ2S R8PsH2zvnQggftcnX0NbQz4SXyNjgJ/yCeZQYO5EbQxiHJr1UeQ07im+3IQjq7UtV9FXeGH9i9q zZLpTLPncTBuJP1gIMvqwFnXS6fJ9Omi4+NqlfWRUBOLSpq+Nl9T3RgwIJSrSBRj2xW43b7RCoI = X-Received: by 2002:a17:902:e2ca:b0:227:e74a:a063 with SMTP id d9443c01a7336-22c53605110mr193726305ad.37.1745350325296; Tue, 22 Apr 2025 12:32:05 -0700 (PDT) Received: from stoup.. (71-212-47-143.tukw.qwest.net. [71.212.47.143]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-22c50bdda3bsm89312635ad.27.2025.04.22.12.32.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Apr 2025 12:32:05 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH 068/147] accel/tcg: Move get_page_addr_code* declarations Date: Tue, 22 Apr 2025 12:26:57 -0700 Message-ID: <20250422192819.302784-69-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250422192819.302784-1-richard.henderson@linaro.org> References: <20250422192819.302784-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62f.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Move the declarations from exec/exec-all.h to the private accel/tcg/internal-common.h. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- accel/tcg/internal-common.h | 34 ++++++++++++++++++++++++++++++++++ include/exec/exec-all.h | 34 ---------------------------------- accel/tcg/translator.c | 1 + 3 files changed, 35 insertions(+), 34 deletions(-) diff --git a/accel/tcg/internal-common.h b/accel/tcg/internal-common.h index 9b6ab3a8cc..2f00560d10 100644 --- a/accel/tcg/internal-common.h +++ b/accel/tcg/internal-common.h @@ -74,4 +74,38 @@ uint32_t curr_cflags(CPUState *cpu); void tb_check_watchpoint(CPUState *cpu, uintptr_t retaddr); +/** + * get_page_addr_code_hostp() + * @env: CPUArchState + * @addr: guest virtual address of guest code + * + * See get_page_addr_code() (full-system version) for documentation on the + * return value. + * + * Sets *@hostp (when @hostp is non-NULL) as follows. + * If the return value is -1, sets *@hostp to NULL. Otherwise, sets *@hostp + * to the host address where @addr's content is kept. + * + * Note: this function can trigger an exception. + */ +tb_page_addr_t get_page_addr_code_hostp(CPUArchState *env, vaddr addr, + void **hostp); + +/** + * get_page_addr_code() + * @env: CPUArchState + * @addr: guest virtual address of guest code + * + * If we cannot translate and execute from the entire RAM page, or if + * the region is not backed by RAM, returns -1. Otherwise, returns the + * ram_addr_t corresponding to the guest code at @addr. + * + * Note: this function can trigger an exception. + */ +static inline tb_page_addr_t get_page_addr_code(CPUArchState *env, + vaddr addr) +{ + return get_page_addr_code_hostp(env, addr, NULL); +} + #endif diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index fcad3446fe..f52a680f42 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -143,40 +143,6 @@ struct MemoryRegionSection *iotlb_to_section(CPUState *cpu, hwaddr index, MemTxAttrs attrs); #endif -/** - * get_page_addr_code_hostp() - * @env: CPUArchState - * @addr: guest virtual address of guest code - * - * See get_page_addr_code() (full-system version) for documentation on the - * return value. - * - * Sets *@hostp (when @hostp is non-NULL) as follows. - * If the return value is -1, sets *@hostp to NULL. Otherwise, sets *@hostp - * to the host address where @addr's content is kept. - * - * Note: this function can trigger an exception. - */ -tb_page_addr_t get_page_addr_code_hostp(CPUArchState *env, vaddr addr, - void **hostp); - -/** - * get_page_addr_code() - * @env: CPUArchState - * @addr: guest virtual address of guest code - * - * If we cannot translate and execute from the entire RAM page, or if - * the region is not backed by RAM, returns -1. Otherwise, returns the - * ram_addr_t corresponding to the guest code at @addr. - * - * Note: this function can trigger an exception. - */ -static inline tb_page_addr_t get_page_addr_code(CPUArchState *env, - vaddr addr) -{ - return get_page_addr_code_hostp(env, addr, NULL); -} - #if !defined(CONFIG_USER_ONLY) MemoryRegionSection * diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c index 2ab081b95f..5f0aa9d56a 100644 --- a/accel/tcg/translator.c +++ b/accel/tcg/translator.c @@ -17,6 +17,7 @@ #include "exec/translator.h" #include "exec/plugin-gen.h" #include "tcg/tcg-op-common.h" +#include "internal-common.h" #include "internal-target.h" #include "disas/disas.h" #include "tb-internal.h"