From patchwork Tue Jun 4 09:08:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Kellermann X-Patchwork-Id: 13684926 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 6D5AEC25B7E for ; Tue, 4 Jun 2024 09:09:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 192E26B00A7; Tue, 4 Jun 2024 05:09:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 11A896B00A8; Tue, 4 Jun 2024 05:09:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EAF346B00A9; Tue, 4 Jun 2024 05:09:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id CB2146B00A7 for ; Tue, 4 Jun 2024 05:09:27 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 94E7B1401A7 for ; Tue, 4 Jun 2024 09:09:27 +0000 (UTC) X-FDA: 82192632774.27.22AB408 Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) by imf11.hostedemail.com (Postfix) with ESMTP id A69A44000B for ; Tue, 4 Jun 2024 09:09:25 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=ionos.com header.s=google header.b="HzrRq/ro"; spf=pass (imf11.hostedemail.com: domain of max.kellermann@ionos.com designates 209.85.208.45 as permitted sender) smtp.mailfrom=max.kellermann@ionos.com; dmarc=pass (policy=quarantine) header.from=ionos.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1717492165; 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=n3U0KL7w5U75JMn9WGwTfgeaFpYbfkGLETLiHeR3bJI=; b=RgTsP6e6zDFy6Bo+O0A39P58pHFpQRch7jWMpI7xABH6yuLp6QOn9q0LWXPWowoRVQHkJj 3BMRm1TwY/7W0qer1G7ZZiGDefo8TXYvihci9JsNuX4rV+vny+A/wjVis5x9Z6MhZd3pht hH9SebqDhD/jewunvUiVXb2kC2MmPg0= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=ionos.com header.s=google header.b="HzrRq/ro"; spf=pass (imf11.hostedemail.com: domain of max.kellermann@ionos.com designates 209.85.208.45 as permitted sender) smtp.mailfrom=max.kellermann@ionos.com; dmarc=pass (policy=quarantine) header.from=ionos.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717492165; a=rsa-sha256; cv=none; b=5hc0eSGPu29VSPrHqP8yefOETp79hSvzz/oBYMJN2SRWVDNeDELoPKOzG0ur2gXtb6VM86 CdZtBoHCXrCk64htuRPJl+tDDsp+YButgbMU2CDaR97WSloJsRAczUTekQ+Pp5Rh/Mrk6x CNneoXBuF8nNoS3Lf3zbcxCyKE4qlvE= Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-57a1fe639a5so895691a12.1 for ; Tue, 04 Jun 2024 02:09:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1717492164; x=1718096964; 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=n3U0KL7w5U75JMn9WGwTfgeaFpYbfkGLETLiHeR3bJI=; b=HzrRq/rold4V1UXGmF8ZJd3TgxxAg15cl+Dk+3jIJ1a5u/0yWMTsG7bGSuEWUwCTUJ m2PhuuaQ7Ce/FtxlkeFc5N+F7Cbfu1Er3cQ33Bi3KDQsmHamPY68Jcot4AMiplcY6u+3 +YZEWKapjPjNX5MMwN7KeZBJZRFp7C7caUhB+BjL5pn7qJvkjIvo25xxFZ/A0zODXWKc NzQz0+ghcDcN1FvNORvG0T8K3WLJGstHluKfETZ5X4mhEx3+wbIX4d4TrTDcQtMxIx3P wOI3SV/DPZP5vSPoQkPUFYStWu3nkx70RTp6mSJYZdKFG74ITA2jQ7oPxcq+d+7B4Gl8 nucQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717492164; x=1718096964; 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=n3U0KL7w5U75JMn9WGwTfgeaFpYbfkGLETLiHeR3bJI=; b=nMZrg3X+ZmpcHLtHKiDeJi/UTbgmaGc9fcuTl6+Km1ovPRAqUNKFVnfk0xdhsrfHoC pQFPewhhPEtFb3bZsSl5zbYzcAyUYgo+RqZfpuofqOHtIIZVr2xSSQVsb1GbMgMLNzyF Ilm4tS1CpBcWMC+sa18iweJYR7FV3sGPiZ2J1inzI57Z6bOjZl7SeSQAiseQSTABhveI xuxNLpHoDoY7HUFm/rsdymFTcTUxi29EmXJlb+pE6KYr3SfYk73dBjEdGiOqEsH17IdY +A3swhkJG/9ttNkCT/qV+5t9lViT1L+K6u2QKvBMMjr2aysJxwZESroUIu/Z1v2jY/lK k1EA== X-Forwarded-Encrypted: i=1; AJvYcCWto88UZnAffcXjJKkoB7Erh4hnfUNdjC54oZ3t3uPW8mviizDhoOZRoODZPeNQhzh5rozaR+hVeawef4BMLQv+oFU= X-Gm-Message-State: AOJu0Yy0cNaInvpaZNTtlAogT/JnzpbqBl5wBFhvBdYcSKb++z0OsVNC FzphJzSTHlvlHdYAvshnC0XNJh+IuqJt2ZxMdrrDSAjHvVx9QisksNuYPEnA6u8hPnUySDw3XT2 iveU= X-Google-Smtp-Source: AGHT+IEufjYupL5V5fjGHiqCyxBU1VmyGKHrnjXAzODktOVBv2dBJp+P8PCQHm8Bv1pzw0q+GjsDJg== X-Received: by 2002:a17:906:c4ca:b0:a68:3bf0:79eb with SMTP id a640c23a62f3a-a683c10d453mr547303066b.47.1717492164227; Tue, 04 Jun 2024 02:09:24 -0700 (PDT) Received: from raven.blarg.de (p200300dc6f4f9200023064fffe740809.dip0.t-ipconnect.de. [2003:dc:6f4f:9200:230:64ff:fe74:809]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a68fa49e66fsm328376766b.129.2024.06.04.02.09.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 02:09:22 -0700 (PDT) From: Max Kellermann To: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: willy@infradead.org, sfr@canb.auug.org.au, david@redhat.com, Max Kellermann Subject: [PATCH v6 14/15] linux/mm.h: move high_memory to mm/high_memory.h Date: Tue, 4 Jun 2024 11:08:44 +0200 Message-Id: <20240604090845.2182265-15-max.kellermann@ionos.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240604090845.2182265-1-max.kellermann@ionos.com> References: <20240604090845.2182265-1-max.kellermann@ionos.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: A69A44000B X-Stat-Signature: 18rhpg4r4jwyi544g7eah6igbxj67r4i X-HE-Tag: 1717492165-318320 X-HE-Meta: U2FsdGVkX1/9YJWEyYES5pf4/ttMbSxogVb78Wzpv8CG4Kk5ig3Y1DPofgOG3g29Fyitboo47PneMDGxHx8aqHO6a9b/Fl2HL5ntFVhNJcipIc+P1C6sqi/CE4vY/PAEyP+ZG7u2bMloIhjx0QeWwuWFZU6WZgwb5EY9qeBi8bKczRdqnAu0Cs8sf9A8lbFN2m1qAoYR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E4OfAu1GCNHjZgApHv4ru6WQt0DH/wZuA3ZhtxFdxjymKAQAxiiy2rSgWHAQcSt2No6zjcxxRd+9I4aNnX7e6Qh9lLcC/Uy4YqjtFsjuWNt160oIy6E9z1fu4PLJOSTs9WGML5kXGPeDQM= 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 0ca6c408c07f..17ccc91c3cd6 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 e411e5a70ea3..9ae87fc2c648 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 6c9089adbb4e..83613e9297b5 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -83,7 +84,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 */