From patchwork Thu Apr 24 00:48:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 883857 Delivered-To: patch@linaro.org Received: by 2002:a5d:474d:0:b0:38f:210b:807b with SMTP id o13csp3205068wrs; Wed, 23 Apr 2025 18:14:08 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW5h9/oYr6kyBMpaJFMJt2KsuxxtQ0ha/wehdNFnDCs92k2oNE70NbbbNoDZs2XQwKU0kaEZQ==@linaro.org X-Google-Smtp-Source: AGHT+IH8rL1qfcCAtk/ymqVT8P+qGXrcHoZlVFTtuOENfXA4cHVv7ay5ZfwSQe2QTCvHji5p4LwV X-Received: by 2002:a05:622a:120e:b0:476:90ea:8ee4 with SMTP id d75a77b69052e-47eb44ad617mr10510201cf.32.1745457248545; Wed, 23 Apr 2025 18:14:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1745457248; cv=none; d=google.com; s=arc-20240605; b=T8oD9Tfwy3wKejBnBGlJNtbI0RPpn+qLcpAJrM0hxWELG5D1Q0xqkIVFuBATlx822z NVLXr9hYy+1GtsbhGSMyuCbcZTghBE7GNy/rIN0qHseJOfoTJTDh4hyUXI3ZeLiOmKrY VzwEpTKETVl2Jdk87LY5wyqVRFzEet0PVYewyC2gu5Mj0timPWh13FYAToDQ7fbMJ+8j HPQ9HYnVgBWlZe5Y0x53LybSdA3R+sVF7ppgw+l18OLJdcIkAp4OcAvldEijRE1DpYxX fB7ltKGpPTWxvnJ2EGKUXr7otyxXmKzSyXJ5taPnWAtZLRZ0cGwG4eljn1qEC+jBazNv QuFw== 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=kmSekyJdLD+byQ4wK17YzPBAZbfCl98xaVqmrAmqTEQ=; fh=i/pWNGcx7KiR3ewgypxpPkuORYlkCnVXLqKVm9/UgNc=; b=QNArDBk36l0eZaVXII4wBTvcRaBSMwBgYRBDwCOnJytYOnR8iz9XTzpcZq03DqMqJ5 Q/Qr4z2qkJx2UHF38pJya8QYENoTl5OzmwuzWSqcF/GIpWU0/eKWcB/QFz8GIXIkVf4g yquI3/UFFnBOq9iB4YHCv263FYR53xNEKiRKpDq0KluL+be0WI49lqqMm9yIhIGpfvS7 KLiA7ujFAEja/BZ0Iqld7Xjlq3+Rx2Tbkoss3J1gZvAfIkF+y5Rr41in8y/DJoH1HNtl vBftYiYaCfjrr0D26ixbcpVp33kXPWdaLVWdLqxpnKafxNOu3NFfQj+RigYdOR1Llj6i sHJw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kYmeMnuM; 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-47ea1993753si5583431cf.331.2025.04.23.18.14.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 Apr 2025 18:14:08 -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=kYmeMnuM; 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 1u7ksa-0000W9-1f; Wed, 23 Apr 2025 20:55:52 -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 1u7kqX-00015c-TQ for qemu-devel@nongnu.org; Wed, 23 Apr 2025 20:53:46 -0400 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u7kqG-0004k7-1D for qemu-devel@nongnu.org; Wed, 23 Apr 2025 20:53:30 -0400 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-73c17c770a7so477926b3a.2 for ; Wed, 23 Apr 2025 17:53:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1745456006; x=1746060806; 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=kmSekyJdLD+byQ4wK17YzPBAZbfCl98xaVqmrAmqTEQ=; b=kYmeMnuMuHWVt0X5D93In7IbP4dcUuRRlCqVuNY61iMlfysxZxbySpe+U/RdJ3B8A2 6t+D8uB+fqO41pazOsBo4UaPKU7B1dXoWJ2X/Mar5LGxePHnDCki9X2f11vyet/0MSkq zNTHjmbfcReMLPURAwaSDtISVsfotB/oBRYCdQ2QqKUG8JsuAK9WDCWyOzpgn4A7QNFK SebVZfegynE90oNXTVw9TrfI4o235obZ10hKnpzOf/aqMRYz8/UXWEEhnsUJNaTcawQc A2dB8uUxmL+/WgtjA9vxy13NZmlSSG3bgUhYkQ6Ohgq4UbsEgh1cLtgTjuERaB0ANM33 Qs0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745456006; x=1746060806; 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=kmSekyJdLD+byQ4wK17YzPBAZbfCl98xaVqmrAmqTEQ=; b=jIaUjWQb3KYca8C6YhdzorMwOyrxdspM0tZvcfgbthvLl9fymVrjOBxD7JQDRja65U BAr7lm2TVmVAdn0Bs7cQbuM5RxDbtsQBiFaP98kXci9u+K0wOUpZjOmf9GnuJC1GzD3/ NVsrW9Cu9jMIHqsng5ISZgUdp237MhrYoiik5L7U0nXJLl+MVdTktj+rF+3w7fm4MSJv UzJ0Ox/78viWoRNK3cwWywjDTCuZprhvOHQWzJZ3RcGu9s+JIPOl/pWWGOdU1JdLMd6h VPIVKqUWj3ak4i9iYtKrf9hOG+VWKuXqdaUsr5WqJ+55yWbIQc8l2CKJSU2adJ41Wxxp g1Qg== X-Gm-Message-State: AOJu0Ywa9Xwhmf+q8fAsDW+5ZLC8HmjO0qEyMQzJE2AmfFlz7fsE+U7A AdRgy3YZM8QxmnfFCnQPd+WFGf6kUIZ2nwHj0+hLK0FsyAje+9rLNw/AkAbHH9epYnnjduvL77v w X-Gm-Gg: ASbGncv2LSFs1rlkhqywGIAKOR4mxQ6DceWOKxTCEn5X/N/JWZPSH+Qdl1X4DaFft3V gMbR+daWBDbIZX2s2cLdEr7Q3e7uPqXIvsFVDQq3ZKNmERG462o+Rwgep1ZW2FNUoUleT5sOcqk ScDVRVsO6NMLcmWcwJGHfSUTLEYt8hmzHlDgZFTmjjX8jBMdQiEvnj9kd/T5tEupMWyuqrtvmQL IgnChvjBqNfvWbKyiImvBVsPKigfqyxjaIctxHlY/GtgZp+SLupJFJScr3NbWKiKz1no8+dH5fO M+YBdYxIfbDjNHg6p6WzDT2YwRwwO5xZzPByoREPPIOFUdOfw44mnD4JR7YZIgM+bfnfQpOp/Xw = X-Received: by 2002:a05:6a20:d48b:b0:1f5:7d57:830f with SMTP id adf61e73a8af0-20444f8a679mr824547637.33.1745456006463; Wed, 23 Apr 2025 17:53:26 -0700 (PDT) Received: from stoup.. (71-212-47-143.tukw.qwest.net. [71.212.47.143]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-73e25a6a971sm209353b3a.103.2025.04.23.17.53.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Apr 2025 17:53:26 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Pierrick Bouvier Subject: [PULL 068/148] accel/tcg: Move get_page_addr_code* declarations Date: Wed, 23 Apr 2025 17:48:13 -0700 Message-ID: <20250424004934.598783-69-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250424004934.598783-1-richard.henderson@linaro.org> References: <20250424004934.598783-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x435.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: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- 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"