From patchwork Fri Mar 7 18:56:34 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 871244 Delivered-To: patch@linaro.org Received: by 2002:a5d:64c8:0:b0:38f:210b:807b with SMTP id f8csp916076wri; Fri, 7 Mar 2025 10:59:22 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWEBQPE4XOnyNqHkaJ36DQ1bz6O0qYMzP5Fr6S9knTpp4pSmPZiUOI0cJ9utKb4MAVlwmOQAg==@linaro.org X-Google-Smtp-Source: AGHT+IERDfZQe/7G1B8ozwvrl/5yIifA6ZtG8AWt/C+nu3mQKtYC1nTDG5XfLo674J8+hha0x+0z X-Received: by 2002:a05:620a:2607:b0:7c0:b24c:c3c8 with SMTP id af79cd13be357-7c4e617ac54mr597416785a.42.1741373961760; Fri, 07 Mar 2025 10:59:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1741373961; cv=none; d=google.com; s=arc-20240605; b=L06zaZ8CRqf6PLoNHV9JEEvFbdV1z1//3TgQnbo1DZSuI2SdooPk7kgf9M8HSlz53R mChQs78gObVDJtKrIi/xltus4zz50Eizdek//8PxLkcQVcNChlllqJnanZc1E6GX7DQY rB35E6sX9SU64h81KVeLpwM0hxYr0CM1QHzaeWewSidsJGEnwef5JBxFY3lEpe/WL5v7 Z39Uam+ijfizQwgK2qhd8xaEYfaANJEW4BUe2j8Vs7oRcC1RiTRPxz3nafKndEi+C2te 8E0ksX9cRy424ODczXNPtfu7vecpEvZmR7msNK+RWsARI2MauOPnrwd43J2VoRmFJpkz p/SQ== 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=OZUhu3BnFzDT2DJGeBZFOFqKQQp7EogeXchL7RAMkqI=; fh=qKKfiElUquWdkyrWxyzPwUbXApIM0f/sdIVQxneHhZM=; b=M6lyM5YN76bw00xPZBObgsXDkdmkilcTrBqNWTyKsIp1Zu4k8/f8QeQsgp4axzGPLW REHIJRzoakW5wGek15tJ5mIskWg/mCcyAsfdKA9yQLLsiC1xXuCll1jC4nSe4CReu0N/ EtEfLG0rB0EAzn6pFxx0UMafJEkhI6SVBnbWu20HssxRw3jmnRJVw4JV74PBFuYZ6+xm wUCVQEmIVIU3LeE8+4Bb0pgk7fMzgAitpgVWlV72EvbDvlSBU61rK4AIl8dFLp21iexY 5rkM0qmDSZUiYuDHo8T0MMriWXwP3ol7RZy+lszi1sGl3fkoWfvk/8bqhSh4LAk+kEjU tofQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TjFxp62l; 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-4751db241efsi38060471cf.445.2025.03.07.10.59.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Mar 2025 10:59:21 -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=TjFxp62l; 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 1tqcse-0007XL-Pw; Fri, 07 Mar 2025 13:57:09 -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 1tqcsR-0007S6-25 for qemu-devel@nongnu.org; Fri, 07 Mar 2025 13:56:56 -0500 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tqcsP-0007mC-2V for qemu-devel@nongnu.org; Fri, 07 Mar 2025 13:56:54 -0500 Received: by mail-pj1-x1030.google.com with SMTP id 98e67ed59e1d1-2fee05829edso4743171a91.3 for ; Fri, 07 Mar 2025 10:56:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741373812; x=1741978612; 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=OZUhu3BnFzDT2DJGeBZFOFqKQQp7EogeXchL7RAMkqI=; b=TjFxp62lW6qfz2KMRvOfTFrngP/swyyxTDqLTVU9VmcS2EzN/2r6STr/RjbgutX5wu ay9jP/RSBa24CzrCpzaln6YtEvqU+pLKKzt6jrvB3Vd+Qp94DFWUTcjtT0EbW5JuANZA sL/gJYkQbNti4S9yTkjEcTmOPYId01lWeHbOGOtRfUzXQMU7/E79PJyOPqIaAkA9Y2I9 TYEePamAwscer3rpgB8wq7I677QKsOTlBlfuPaThe7hrmgrhTUFQs9K+FBnocuhmLEWG 2HNZpCnmAoOSC7PB3vDCBGhUlrMKei1reDJBRLYou7F6XpwHZLppWNXZMESLHufOmajU vciw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741373812; x=1741978612; 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=OZUhu3BnFzDT2DJGeBZFOFqKQQp7EogeXchL7RAMkqI=; b=BpMCSHsiY/8zdt2FS0T916/2SurcljnTXuakUmhLupR35CbU9WuRk4NbHk3sjm/15u m7kT6tijffyT4YGEUNUqcB/MjH5mCCXOqBCqldDTUfu2xqSjEttjRFeXniGKsA961oTC PC4fL/lgICljTAt4mFzNpnr6ry8sNPtCoAIcWOQ3BgmTZgate+MXBUFSDmZkRkBnqxD3 arVsx2cNSvkiZp3z2wKjBDdNUDcdXWEAcBkVtwWTgE2c000ffn4RfRzA/qvzZBct50Aq tMFm1e1H8PYTNQgF1BG6MfV9LPLrPqPYe1Dhe6BJRToD4wMcZGMralFASj2hO6AuOXOU ZGTg== X-Gm-Message-State: AOJu0YxGf6m+ygIFTPjgReVemckjk1wUqJ1fa5VIQbZ2PgSVWV1f2OvA obs2gxMw3vadYpOPfCWUjidSMqHOpshaVJTM9AdD9CbcWkxlRzIAfLfm4YZ5nl5HphArg/em5NP N X-Gm-Gg: ASbGnctSq08v1xIBZjrg90DlvFph77ltrX4RHOfklGK1hNw1q7SzW7JLXmlfVL1uAWj W5fSNx0V8tVoyABTWCPmk4wVO4SCQBBptYEVWpOR0DBSXy+oPbDmbRdwpE0jwkJ4pzqt7pcDMZn Tq/uDlD9NwbOQ2TUaDP3rZs5JhTyENmLuAEXd3YqpuZSGMhWoIz339bL+cIvn8sphf2wy0Unwk1 3Yi+pYlEcy0H0+BdhB7hPfgkQtGb8Xx38GMgv8PJ+gY/N43oyEouWlVt44kmSoELgMDYbbcSeQs QRwVwuP4C+N0lDBYBxirJLqddIuq4McjxO5LR8NH11u9lOnaZrYKAFb3XFtytfHHqowlAcZd948 u X-Received: by 2002:a17:90b:3804:b0:2ee:edae:75e with SMTP id 98e67ed59e1d1-2ff7ce77a3fmr7203085a91.13.1741373811734; Fri, 07 Mar 2025 10:56:51 -0800 (PST) Received: from stoup.. (174-21-74-48.tukw.qwest.net. [174.21.74.48]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ff693534f8sm3391917a91.17.2025.03.07.10.56.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Mar 2025 10:56:51 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: philmd@linaro.org, Pierrick Bouvier Subject: [PATCH 05/16] exec: Declare tlb_set_page_with_attrs() in 'exec/cputlb.h' Date: Fri, 7 Mar 2025 10:56:34 -0800 Message-ID: <20250307185645.970034-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250307185645.970034-1-richard.henderson@linaro.org> References: <20250307185645.970034-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1030.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 From: Philippe Mathieu-Daudé Move CPU TLB related methods to "exec/cputlb.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson Message-ID: <20241114011310.3615-17-philmd@linaro.org> --- include/exec/cputlb.h | 28 ++++++++++++++++++++++++++++ include/exec/exec-all.h | 25 ------------------------- target/i386/tcg/system/excp_helper.c | 2 +- target/microblaze/helper.c | 2 +- 4 files changed, 30 insertions(+), 27 deletions(-) diff --git a/include/exec/cputlb.h b/include/exec/cputlb.h index 733ef012d1..56dd05a148 100644 --- a/include/exec/cputlb.h +++ b/include/exec/cputlb.h @@ -21,6 +21,8 @@ #define CPUTLB_H #include "exec/cpu-common.h" +#include "exec/hwaddr.h" +#include "exec/memattrs.h" #include "exec/vaddr.h" #ifdef CONFIG_TCG @@ -62,4 +64,30 @@ void tlb_reset_dirty_range_all(ram_addr_t start, ram_addr_t length); void tlb_set_page_full(CPUState *cpu, int mmu_idx, vaddr addr, CPUTLBEntryFull *full); +/** + * tlb_set_page_with_attrs: + * @cpu: CPU to add this TLB entry for + * @addr: virtual address of page to add entry for + * @paddr: physical address of the page + * @attrs: memory transaction attributes + * @prot: access permissions (PAGE_READ/PAGE_WRITE/PAGE_EXEC bits) + * @mmu_idx: MMU index to insert TLB entry for + * @size: size of the page in bytes + * + * Add an entry to this CPU's TLB (a mapping from virtual address + * @addr to physical address @paddr) with the specified memory + * transaction attributes. This is generally called by the target CPU + * specific code after it has been called through the tlb_fill() + * entry point and performed a successful page table walk to find + * the physical address and attributes for the virtual address + * which provoked the TLB miss. + * + * At most one entry for a given virtual address is permitted. Only a + * single TARGET_PAGE_SIZE region is mapped; the supplied @size is only + * used by tlb_flush_page. + */ +void tlb_set_page_with_attrs(CPUState *cpu, vaddr addr, + hwaddr paddr, MemTxAttrs attrs, + int prot, int mmu_idx, vaddr size); + #endif diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index f43c67366b..62d6300752 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -156,31 +156,6 @@ void tlb_flush_range_by_mmuidx_all_cpus_synced(CPUState *cpu, uint16_t idxmap, unsigned bits); -/** - * tlb_set_page_with_attrs: - * @cpu: CPU to add this TLB entry for - * @addr: virtual address of page to add entry for - * @paddr: physical address of the page - * @attrs: memory transaction attributes - * @prot: access permissions (PAGE_READ/PAGE_WRITE/PAGE_EXEC bits) - * @mmu_idx: MMU index to insert TLB entry for - * @size: size of the page in bytes - * - * Add an entry to this CPU's TLB (a mapping from virtual address - * @addr to physical address @paddr) with the specified memory - * transaction attributes. This is generally called by the target CPU - * specific code after it has been called through the tlb_fill() - * entry point and performed a successful page table walk to find - * the physical address and attributes for the virtual address - * which provoked the TLB miss. - * - * At most one entry for a given virtual address is permitted. Only a - * single TARGET_PAGE_SIZE region is mapped; the supplied @size is only - * used by tlb_flush_page. - */ -void tlb_set_page_with_attrs(CPUState *cpu, vaddr addr, - hwaddr paddr, MemTxAttrs attrs, - int prot, int mmu_idx, vaddr size); /* tlb_set_page: * * This function is equivalent to calling tlb_set_page_with_attrs() diff --git a/target/i386/tcg/system/excp_helper.c b/target/i386/tcg/system/excp_helper.c index 864e3140e3..6876329de2 100644 --- a/target/i386/tcg/system/excp_helper.c +++ b/target/i386/tcg/system/excp_helper.c @@ -20,7 +20,7 @@ #include "qemu/osdep.h" #include "cpu.h" #include "exec/cpu_ldst.h" -#include "exec/exec-all.h" +#include "exec/cputlb.h" #include "exec/page-protection.h" #include "tcg/helper-tcg.h" diff --git a/target/microblaze/helper.c b/target/microblaze/helper.c index 5d3259ce31..27fc929bee 100644 --- a/target/microblaze/helper.c +++ b/target/microblaze/helper.c @@ -20,7 +20,7 @@ #include "qemu/osdep.h" #include "cpu.h" -#include "exec/exec-all.h" +#include "exec/cputlb.h" #include "exec/page-protection.h" #include "qemu/host-utils.h" #include "exec/log.h"