From patchwork Thu Feb 22 11:50:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Kellermann X-Patchwork-Id: 13567174 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6F4FC48BEB for ; Thu, 22 Feb 2024 11:51:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C577C6B008A; Thu, 22 Feb 2024 06:51:17 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BDF896B008C; Thu, 22 Feb 2024 06:51:17 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9E6D56B0092; Thu, 22 Feb 2024 06:51:17 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 791826B008A for ; Thu, 22 Feb 2024 06:51:17 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 1E9CDA0DCF for ; Thu, 22 Feb 2024 11:51:17 +0000 (UTC) X-FDA: 81819274194.14.322F8DE Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) by imf16.hostedemail.com (Postfix) with ESMTP id 5A45718000E for ; Thu, 22 Feb 2024 11:51:15 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=ionos.com header.s=google header.b=LXxXzMzX; dmarc=pass (policy=quarantine) header.from=ionos.com; spf=pass (imf16.hostedemail.com: domain of max.kellermann@ionos.com designates 209.85.128.47 as permitted sender) smtp.mailfrom=max.kellermann@ionos.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708602675; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=rnyD5PxkKV5o19zNsO0L5tf/fTdRWviw2NTc0WpmPto=; b=avOgARAAFmPPr6TJTp0u+3KSVqkq14HB/p43mBBIhDAFtfYMeKWZIeiN2NZvGDewSuRH/e oGCT9py/+jgTgDWgI40lzk6IhNxXYGVy97y3B6dN2gHs4UKRmY/Ksmm43Kgon3CbwDH1iT BFkROUAM6Lsq88SJ5CootWj8FfCyp6Q= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=ionos.com header.s=google header.b=LXxXzMzX; dmarc=pass (policy=quarantine) header.from=ionos.com; spf=pass (imf16.hostedemail.com: domain of max.kellermann@ionos.com designates 209.85.128.47 as permitted sender) smtp.mailfrom=max.kellermann@ionos.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708602675; a=rsa-sha256; cv=none; b=CtnZty4Mg922xkIHlmU6JurM/KFYNG9dJsPp1kpz/4n6u/uzOGDsEDAd1AsEN+4vojzoSj P5+QBawP2NOQnziT5hLf+pY7RfmLQoJagoBcKFCtfNydg+ZnXoucoqCsuL+xDQ0kGb/YQo kkwq4nhYDpJHkMs17/5guj+a+s8Hh4I= Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-412698ac6f9so4597475e9.0 for ; Thu, 22 Feb 2024 03:51:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1708602674; x=1709207474; darn=kvack.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=rnyD5PxkKV5o19zNsO0L5tf/fTdRWviw2NTc0WpmPto=; b=LXxXzMzXS5H+aCuQLxhuM2qx10I6UYKxj0Zy4kGflPuCQea1ICej/CYj7wFJq2pow6 2nhpEO+7tTxhu4MAinUrKLRRDwFgLc55nQTeaBSZCnf2vdO5NFDFK/klhGDsSEeFWd02 /jKEWjyVlkGkOlG4sg9IFu5FaMxg0oyi3+jpAuONxuuNkiPxFtW9ozeommjBvCLPqneY yfrNEyW+ddyiNZ4kji5ORNOZOpVZaKlltkG/FxOCtERgGJEtvPnWAMqOJ9ZAjfgaowIJ 6UOSZyeJkXiYaDYGQADr1eQ6drbplr1dESQ4gIGssbQ8bKizMwYgCOEZqKzEnmfGXhSi +OeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708602674; x=1709207474; 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=rnyD5PxkKV5o19zNsO0L5tf/fTdRWviw2NTc0WpmPto=; b=utzeQzDr1j6DQ118aUGsr3brveR16J5hyB5KFM6B/fpkHz+aUWWPcFFccKTxxToEIU /+mltA/io7u3122W+jXuXE0GOxksiwOHN4tuRJpOexaNBTed2hYHWLyttgNi5mkrg4cP 5aPXtZ6LpXUZrMB1PYm3s3tk4vRyQw22c83C4lzw2948lGPK/AIPjt15EB5sRuGQQOYm 1zjSclWZDwtbJcgXKXykZMifElLb0lxFmNwxdFpfPQw1E739wXWHWFEtqw1YPM1yg4Rt 7YKIyBxHMWNVY0JeF0caRFhFmCBMVptUE0JaKdmE8mlhkSAYyOlecVTjE8HREjS1NqaA 9MdA== X-Forwarded-Encrypted: i=1; AJvYcCW8JwWFXHL9tKQcBxHBXMNCSNuvbwKHg5MEqRS8WRnf1Ti7tm33GHUVwtEZsPivhpC95y1VBGREUN3YVykB5J9gAIE= X-Gm-Message-State: AOJu0YwFwXhjV8Oux7C07FggrmzzuzoQ3d/37uSUJOqx4u8IKtLHCOCj 34e/RySleuaRUcqsxUiXOlZu+NyFRXLa6740Wt7G/Gr3/44jQ4eOWy+SGMsQ4CY= X-Google-Smtp-Source: AGHT+IFfueNkE9tnjKhfFyaIv+QALqBUvLT98iMXV3rV/HToXDFD1IoXBeXq5yhH3kCVsjL9LprabQ== X-Received: by 2002:a05:600c:444a:b0:411:c8a7:7b09 with SMTP id v10-20020a05600c444a00b00411c8a77b09mr1966316wmn.10.1708602674092; Thu, 22 Feb 2024 03:51:14 -0800 (PST) Received: from raven.intern.cm-ag (p200300dc6f010900023064fffe740809.dip0.t-ipconnect.de. [2003:dc:6f01:900:230:64ff:fe74:809]) by smtp.gmail.com with ESMTPSA id co18-20020a0560000a1200b0033d4c3b0beesm15044920wrb.19.2024.02.22.03.51.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 03:51:13 -0800 (PST) From: Max Kellermann To: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: willy@infradead.org, Max Kellermann Subject: [PATCH v2 13/14] linux/mm.h: move high_memory to mm/high_memory.h Date: Thu, 22 Feb 2024 12:50:54 +0100 Message-Id: <20240222115055.1172877-14-max.kellermann@ionos.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240222115055.1172877-1-max.kellermann@ionos.com> References: <20240222115055.1172877-1-max.kellermann@ionos.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 5A45718000E X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: f6zu4cky5qdpy9xjuqci9fa6enier56t X-HE-Tag: 1708602675-467078 X-HE-Meta: U2FsdGVkX19ff50BalWB2qadSzB/MfeoYG1IOD0vfjPNZ+K/+EvqZWpgsg6wYOv2WFZtdm8qCcVip1G/nE6EgRrvZo7EuSwWoXSjxY+s6WlWplAw9ssXlgKwkeQA6oZIjeSzjKQ0pmwLXdoILltfHr+WonnABifcPNkNkaekF7O367/Zdc+rc0GFik7UYH+TzU5I9YJqOYl92mGdl0cuyRBQdDWznmij8S0GQyZ9T9W+kcktxzlFTexSUSqeZLviT1DdbK1AZ6xqTvIq+FSWyWB4tpK+bT700riJjn4j1fVj8ZcQFiqkqCs6tf4WyDf3BQ//socnc7X2q6AHpwZ7HM4/ZSvX2D4VWHmADA/zxP+VdQ8LtgyMa76M941ck6Y3d+lEgQbZa7af8wvw42ha47eqds7/ui3Hgg0Sg1Bqfci7g8qaa627qLnTGPHrG/XnHbU+N0grHu8iqVswf+dnl0hgN49HcobKAlgvpupLnkavIejq02rNB8vPxr+So1elxT9aL8v2Tm/tKZ7sHqWuoLj8kPzig1n7szj6oNe0jDNcGKAWra6Hh8T4nYNqqrrPEZc49/L/64Nurs0zpll7Zn74SN7eKK0s12Zrk1bcVy9hfKrY5Vwh0LxG3FEF2JGOU8J6N9qFFeVebAtC6e32Mr4TwP20OhaEYtTRTWQpeOdyELruGYymNzLoSzRKoPKis/v22EjA87vVTnWA+gOZiZFGv0sHCAac2EqoF9nPIfzk43+Be4mOlescM2L35jtR5PrqiHn6kfOJR0K3GKrz50aDh+CG9/1QpWpZvbyfqyh0mXWXmyqbupO4tmEM6C9FQTLZoJK89+rK5QaeIA51bqvEBj1TXmryrGRLT7PNv9CHzGtxVFct3MvviQx3Sy7v9M7WJj06FAc+OtXkj8irvaP1hKWSpi+26Dr0/SVnhYxJaql0WlfF0YCQjZ9bNdKqyoXgVSpcdMlZ7Fnv25u x0+mNXIl 32CQ5v1puqeM7Frg2sBAHeC7NSJMeuc+CwW9UKvTEEYAu8smU1qMEflcFhuegNT0+yPERp0iwLQJhiyM75TuzjfwnJ4wvoXZ9wWte6sy022nx/zeaU49ohKu78alM5VZN145bBYL/ZSq38JpcQBlwLu/ewJxGMN5rV+ez X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: This variable is used by lots of arch/*/include/asm/ headers, but these do not (and should not) include the huge linux/mm.h header. Let's move this "extern" variable to a separate header and include this one in arch/. Signed-off-by: Max Kellermann --- arch/arm/include/asm/memory.h | 4 ++++ arch/arm/include/asm/pgtable.h | 2 ++ arch/csky/include/asm/page.h | 1 + arch/hexagon/include/asm/mem-layout.h | 4 ++++ arch/m68k/include/asm/page_mm.h | 1 + arch/m68k/include/asm/pgtable_mm.h | 1 + arch/parisc/include/asm/floppy.h | 1 + arch/powerpc/include/asm/book3s/32/pgtable.h | 4 ++++ arch/powerpc/include/asm/nohash/32/pgtable.h | 1 + arch/powerpc/include/asm/page.h | 1 + arch/x86/include/asm/floppy.h | 1 + arch/x86/include/asm/pgtable_32_areas.h | 4 ++++ drivers/mtd/nand/onenand/onenand_samsung.c | 1 + include/linux/mm.h | 2 +- include/linux/mm/high_memory.h | 7 +++++++ 15 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 include/linux/mm/high_memory.h diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h index ef2aa79ece5a..a67afb213e2e 100644 --- a/arch/arm/include/asm/memory.h +++ b/arch/arm/include/asm/memory.h @@ -387,6 +387,10 @@ static inline unsigned long __virt_to_idmap(unsigned long x) */ #define ARCH_PFN_OFFSET PHYS_PFN_OFFSET +#ifndef __ASSEMBLY__ +#include +#endif + #define virt_to_page(kaddr) pfn_to_page(virt_to_pfn(kaddr)) #define virt_addr_valid(kaddr) (((unsigned long)(kaddr) >= PAGE_OFFSET && (unsigned long)(kaddr) < (unsigned long)high_memory) \ && pfn_valid(virt_to_pfn(kaddr))) diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h index be91e376df79..eb80f6a65619 100644 --- a/arch/arm/include/asm/pgtable.h +++ b/arch/arm/include/asm/pgtable.h @@ -11,6 +11,8 @@ #include #ifndef __ASSEMBLY__ +#include + /* * ZERO_PAGE is a global shared page that is always zero: used * for zero-mapped memory areas etc.. diff --git a/arch/csky/include/asm/page.h b/arch/csky/include/asm/page.h index 4a0502e324a6..016f722fbe43 100644 --- a/arch/csky/include/asm/page.h +++ b/arch/csky/include/asm/page.h @@ -32,6 +32,7 @@ #ifndef __ASSEMBLY__ +#include #include #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && \ diff --git a/arch/hexagon/include/asm/mem-layout.h b/arch/hexagon/include/asm/mem-layout.h index e2f99413fe56..a09116c50043 100644 --- a/arch/hexagon/include/asm/mem-layout.h +++ b/arch/hexagon/include/asm/mem-layout.h @@ -10,6 +10,10 @@ #include +#ifndef __ASSEMBLY__ +#include +#endif + /* * Have to do this for ginormous numbers, else they get printed as * negative numbers, which the linker no likey when you try to diff --git a/arch/m68k/include/asm/page_mm.h b/arch/m68k/include/asm/page_mm.h index e0ae4d5fc985..f958655d1931 100644 --- a/arch/m68k/include/asm/page_mm.h +++ b/arch/m68k/include/asm/page_mm.h @@ -5,6 +5,7 @@ #ifndef __ASSEMBLY__ #include +#include #include /* diff --git a/arch/m68k/include/asm/pgtable_mm.h b/arch/m68k/include/asm/pgtable_mm.h index dbdf1c2b2f66..ec593656bdc5 100644 --- a/arch/m68k/include/asm/pgtable_mm.h +++ b/arch/m68k/include/asm/pgtable_mm.h @@ -13,6 +13,7 @@ #ifndef __ASSEMBLY__ #include +#include #include #include diff --git a/arch/parisc/include/asm/floppy.h b/arch/parisc/include/asm/floppy.h index b318a7df52f6..98ed37c5dc59 100644 --- a/arch/parisc/include/asm/floppy.h +++ b/arch/parisc/include/asm/floppy.h @@ -8,6 +8,7 @@ #ifndef __ASM_PARISC_FLOPPY_H #define __ASM_PARISC_FLOPPY_H +#include #include diff --git a/arch/powerpc/include/asm/book3s/32/pgtable.h b/arch/powerpc/include/asm/book3s/32/pgtable.h index 52971ee30717..03e0a32e1c2c 100644 --- a/arch/powerpc/include/asm/book3s/32/pgtable.h +++ b/arch/powerpc/include/asm/book3s/32/pgtable.h @@ -4,6 +4,10 @@ #include +#ifndef __ASSEMBLY__ +#include +#endif + /* * The "classic" 32-bit implementation of the PowerPC MMU uses a hash * table containing PTEs, together with a set of 16 segment registers, diff --git a/arch/powerpc/include/asm/nohash/32/pgtable.h b/arch/powerpc/include/asm/nohash/32/pgtable.h index 9164a9e41b02..8a9f5b546e4a 100644 --- a/arch/powerpc/include/asm/nohash/32/pgtable.h +++ b/arch/powerpc/include/asm/nohash/32/pgtable.h @@ -5,6 +5,7 @@ #include #ifndef __ASSEMBLY__ +#include #include #include #include /* For sub-arch specific PPC_PIN_SIZE */ diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h index e5fcc79b5bfb..c541e71d3d5c 100644 --- a/arch/powerpc/include/asm/page.h +++ b/arch/powerpc/include/asm/page.h @@ -7,6 +7,7 @@ */ #ifndef __ASSEMBLY__ +#include #include #include #include diff --git a/arch/x86/include/asm/floppy.h b/arch/x86/include/asm/floppy.h index 6ec3fc969ad5..7756e984f146 100644 --- a/arch/x86/include/asm/floppy.h +++ b/arch/x86/include/asm/floppy.h @@ -10,6 +10,7 @@ #ifndef _ASM_X86_FLOPPY_H #define _ASM_X86_FLOPPY_H +#include #include /* diff --git a/arch/x86/include/asm/pgtable_32_areas.h b/arch/x86/include/asm/pgtable_32_areas.h index b6355416a15a..b339137b4f4e 100644 --- a/arch/x86/include/asm/pgtable_32_areas.h +++ b/arch/x86/include/asm/pgtable_32_areas.h @@ -3,6 +3,10 @@ #include +#ifndef __ASSEMBLY__ +#include +#endif + /* * Just any arbitrary offset to the start of the vmalloc VM area: the * current 8MB value just means that there will be a 8MB "hole" after the diff --git a/drivers/mtd/nand/onenand/onenand_samsung.c b/drivers/mtd/nand/onenand/onenand_samsung.c index fd6890a03d55..7c3cc270386d 100644 --- a/drivers/mtd/nand/onenand/onenand_samsung.c +++ b/drivers/mtd/nand/onenand/onenand_samsung.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include diff --git a/include/linux/mm.h b/include/linux/mm.h index ad5971219ef6..b5cfe35ee7f2 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -81,7 +82,6 @@ static inline void totalram_pages_add(long count) atomic_long_add(count, &_totalram_pages); } -extern void * high_memory; extern int page_cluster; extern const int page_cluster_max; diff --git a/include/linux/mm/high_memory.h b/include/linux/mm/high_memory.h new file mode 100644 index 000000000000..e504aafd0d48 --- /dev/null +++ b/include/linux/mm/high_memory.h @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _LINUX_MM_HIGH_MEMORY_H +#define _LINUX_MM_HIGH_MEMORY_H + +extern void * high_memory; + +#endif /* _LINUX_MM_HIGH_MEMORY_H */