From patchwork Sun Jan 28 04:41:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 767234 Delivered-To: patch@linaro.org Received: by 2002:adf:ee41:0:b0:33a:e5bd:fedd with SMTP id w1csp348302wro; Sat, 27 Jan 2024 20:46:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IF7fxsOju/UTevTAVdm2FCCs6bKuYOJfwSWS1Y0t6LOd0vzJSWtGYiWboUgRGurgdyhhhiO X-Received: by 2002:ae9:f713:0:b0:783:d709:54e3 with SMTP id s19-20020ae9f713000000b00783d70954e3mr2844334qkg.25.1706417212811; Sat, 27 Jan 2024 20:46:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706417212; cv=none; d=google.com; s=arc-20160816; b=CVFphaU1DUxrVHKD5VKcDrYMj31QNSpiaUuhBg5+gupPjLjW7myPa3dXaCLq3iawy4 wTEY/ZqpsBs28iQ3fpVvdZ+yPNI4JIwFeCTrP5VlEwIqKZ34LxqvmnFCuwyzjQVyzNHV hsM+Sp6QJ3HRZ6t9UxkFkxBeSa/i3Tytxo4jq8uJ3W0aA2MBZKuxLd1Ihx42GZObD8CM HVNGuZ0HEKVox3I0H03E7Ncz6hPXfTE63e4cTZc0J+qkdJGxpiTPR5TnZjCa/+f+Iotz E11HZt1/9Cjk/YEfcBC2R31mpc0LXct6zZ0GygHCyUnbeW7VCcohJLn2Cb/8eJoGznqQ 3c/Q== 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=b//53eqNBjSFpOfVle7vTtty4ZHIEf38Wv0KnQlUNkk=; fh=l3rThTWYtfg9kQ3pwkdseR7wGfUMT6wsJF5cqMswxYY=; b=sHYv48JGPqnnMoMsu1azg5/oJvQTc7vObeiwbmyZyLB+ngHzbwmDemlZrhSgaGulkv rWdVRaFv2IZL9rWfPBBWmRF0VclAQlUNPEEHaxuzceCuoNTAZNl+URu2F1AtsBEUysHA s2WKW5HJT+liHA8JhJCcul7EUwKZYdJb4c4KVUlBlEdVTfQ0U4BRmHXwlnW6fYUTkiqP BD/RBrSkZqff6vLFHHV2BhrX+kXCoEvTg5CMLKrEq3w4HfM0NQGETnrt9Lp3xiDaperp Evt19pAZkEhg5ITZTnAg7+AYmPcQtCoPrFuwikqfKzfrlJVEDZjP8hvojRVgcx16j5KC 1B9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MmtVTpvt; 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 c28-20020a05620a201c00b007834885d561si4669947qka.595.2024.01.27.20.46.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 27 Jan 2024 20:46:52 -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=MmtVTpvt; 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 1rTx0H-0004jE-5z; Sat, 27 Jan 2024 23:42:45 -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 1rTx0G-0004it-4p for qemu-devel@nongnu.org; Sat, 27 Jan 2024 23:42:44 -0500 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rTx0E-0004Is-JU for qemu-devel@nongnu.org; Sat, 27 Jan 2024 23:42:43 -0500 Received: by mail-pj1-x1035.google.com with SMTP id 98e67ed59e1d1-2906dffd8ddso1350739a91.3 for ; Sat, 27 Jan 2024 20:42:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706416961; x=1707021761; 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=b//53eqNBjSFpOfVle7vTtty4ZHIEf38Wv0KnQlUNkk=; b=MmtVTpvtDxcbcobH5GUe3J/pBqYp66zXh69JcCoVzSq4aJKLnWxrNkwgaH0MYObcJl 9rv8H9/v8+k6gGO6yjH+Gm7Dg/DA7ppJGyS2O1Fst0wY4H2NrVrXRAcedrTztO+dG/gm v+mX2YbAYgPRC9GMn0qJmezmJuswZx8Ao93VLormZWHF3js67tcmrcxxg6LWUa2jzKWY Ag55kz/0sABoq+Glap81JqWeqyVqX/yNP6V5Cr+0yPMocPWcQcvdpp7EAhcNQvJ4aMUI T/ylokk59oz6TxJbiFd8jlJR2Ux5KOfxubXWJUwduDZyVDwvq0KxeY/lJ+P/gAfddw19 rDnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706416961; x=1707021761; 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=b//53eqNBjSFpOfVle7vTtty4ZHIEf38Wv0KnQlUNkk=; b=RP5uSACYuzjuUWGjQYeTwyhQxnVufiI0Tk/aJdzg+eDOPxvyz+sihwaGnAmwXyUsu0 TOd6mQJcKFoPY3Ocx2USqRwk5kI8XNlgxqfvozcq3dijn5rklZ46A5p3sCpwNlE69DGx kPMxA1fo7AwrpqSPymGon8Hv6hbY0ugs5DKZsKQQUjC+5xaLL1+yv2PVBMNXSkYRa7t4 JVfvrvMgU6s44HOxcFFRvUbc9FCoZXAnBQmwJR8O+yFVZgnT3FWNkMxLjGOuOyancu9y GTSexaeOxoACRzeCHlOnD3SaEngCUbJ/VCvFEeXtGKcDNcdlKRGA7N3HCy/7jqRHPYf0 nHgA== X-Gm-Message-State: AOJu0YxMHjnpZ2MQYiePWmUH9sNCu/Qk1S+St35RHT24QeHB2YEjUTq3 5II8cjuJG0Bb/05VLFVlsGRfZlRvl2qL7L41DDl0DeQgq7hAEIgNBdWZtq/hVmh3GQaGT17lsRk oGUedDA== X-Received: by 2002:a17:90b:1207:b0:28e:7a18:4e4a with SMTP id gl7-20020a17090b120700b0028e7a184e4amr1514464pjb.81.1706416961361; Sat, 27 Jan 2024 20:42:41 -0800 (PST) Received: from stoup.. (ppp121-45-131-89.bri-pow-que-bras31.tpg.internode.on.net. [121.45.131.89]) by smtp.gmail.com with ESMTPSA id w24-20020a17090aaf9800b002906e09e1d1sm5631873pjq.18.2024.01.27.20.42.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Jan 2024 20:42:40 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Anton Johansson Subject: [PATCH 09/33] include/exec: Move PAGE_* macros to common header Date: Sun, 28 Jan 2024 14:41:49 +1000 Message-Id: <20240128044213.316480-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240128044213.316480-1-richard.henderson@linaro.org> References: <20240128044213.316480-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1035; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1035.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 From: Anton Johansson These don't vary across targets and are used in soon-to-be common code (cputlb.c). Signed-off-by: Anton Johansson Message-Id: <20240119144024.14289-15-anjo@rev.ng> Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson --- include/exec/cpu-all.h | 24 ------------------------ include/exec/cpu-common.h | 30 ++++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 24 deletions(-) diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index 5340907cfd..edee87d3f4 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -171,34 +171,10 @@ extern const TargetPageBits target_page; #define TARGET_PAGE_ALIGN(addr) ROUND_UP((addr), TARGET_PAGE_SIZE) -/* same as PROT_xxx */ -#define PAGE_READ 0x0001 -#define PAGE_WRITE 0x0002 -#define PAGE_EXEC 0x0004 -#define PAGE_BITS (PAGE_READ | PAGE_WRITE | PAGE_EXEC) -#define PAGE_VALID 0x0008 -/* - * Original state of the write flag (used when tracking self-modifying code) - */ -#define PAGE_WRITE_ORG 0x0010 -/* - * Invalidate the TLB entry immediately, helpful for s390x - * Low-Address-Protection. Used with PAGE_WRITE in tlb_set_page_with_attrs() - */ -#define PAGE_WRITE_INV 0x0020 -/* For use with page_set_flags: page is being replaced; target_data cleared. */ -#define PAGE_RESET 0x0040 -/* For linux-user, indicates that the page is MAP_ANON. */ -#define PAGE_ANON 0x0080 - #if defined(CONFIG_BSD) && defined(CONFIG_USER_ONLY) /* FIXME: Code that sets/uses this is broken and needs to go away. */ #define PAGE_RESERVED 0x0100 #endif -/* Target-specific bits that will be used via page_get_flags(). */ -#define PAGE_TARGET_1 0x0200 -#define PAGE_TARGET_2 0x0400 - /* * For linux-user, indicates that the page is mapped with the same semantics * in both guest and host. diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h index 1a8fad9222..ba10351576 100644 --- a/include/exec/cpu-common.h +++ b/include/exec/cpu-common.h @@ -219,4 +219,34 @@ G_NORETURN void cpu_loop_exit_atomic(CPUState *cpu, uintptr_t pc); G_NORETURN void cpu_loop_exit(CPUState *cpu); G_NORETURN void cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc); +/* same as PROT_xxx */ +#define PAGE_READ 0x0001 +#define PAGE_WRITE 0x0002 +#define PAGE_EXEC 0x0004 +#define PAGE_BITS (PAGE_READ | PAGE_WRITE | PAGE_EXEC) +#define PAGE_VALID 0x0008 +/* + * Original state of the write flag (used when tracking self-modifying code) + */ +#define PAGE_WRITE_ORG 0x0010 +/* + * Invalidate the TLB entry immediately, helpful for s390x + * Low-Address-Protection. Used with PAGE_WRITE in tlb_set_page_with_attrs() + */ +#define PAGE_WRITE_INV 0x0020 +/* For use with page_set_flags: page is being replaced; target_data cleared. */ +#define PAGE_RESET 0x0040 +/* For linux-user, indicates that the page is MAP_ANON. */ +#define PAGE_ANON 0x0080 + +/* Target-specific bits that will be used via page_get_flags(). */ +#define PAGE_TARGET_1 0x0200 +#define PAGE_TARGET_2 0x0400 + +/* + * For linux-user, indicates that the page is mapped with the same semantics + * in both guest and host. + */ +#define PAGE_PASSTHROUGH 0x0800 + #endif /* CPU_COMMON_H */