From patchwork Tue Mar 5 08:59:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Kellermann X-Patchwork-Id: 13581866 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 5307EC54E41 for ; Tue, 5 Mar 2024 09:00:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BD4936B00A2; Tue, 5 Mar 2024 03:59:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B88456B00A3; Tue, 5 Mar 2024 03:59:53 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 913BB940007; Tue, 5 Mar 2024 03:59:53 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 73B7B6B00A2 for ; Tue, 5 Mar 2024 03:59:53 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 4D06D40DA3 for ; Tue, 5 Mar 2024 08:59:53 +0000 (UTC) X-FDA: 81862387866.10.EEF8296 Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) by imf04.hostedemail.com (Postfix) with ESMTP id 5289740005 for ; Tue, 5 Mar 2024 08:59:51 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=ionos.com header.s=google header.b=a90ocAmI; dmarc=pass (policy=quarantine) header.from=ionos.com; spf=pass (imf04.hostedemail.com: domain of max.kellermann@ionos.com designates 209.85.218.50 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=1709629191; 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=rAj7+x69ZY+4IfKY/7bKK9Eao6rfkUHshm8TstoFK2I=; b=UGFLv8UkmF+ia+9gMxjXU0WCyOGp67p+lbrrxdjMa+ONe1+gzzQ7JJFKXkqWB802y4kswm gFypOPgCMdmiXVbyGUNhTpMJOiDCu9wfT4S8wbcGdZuxmxIk+WpHshZAx/L6CKNsVu4iuj DeKqEFlETsCv/XUJamc7ixhNcs9jzuA= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=ionos.com header.s=google header.b=a90ocAmI; dmarc=pass (policy=quarantine) header.from=ionos.com; spf=pass (imf04.hostedemail.com: domain of max.kellermann@ionos.com designates 209.85.218.50 as permitted sender) smtp.mailfrom=max.kellermann@ionos.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1709629191; a=rsa-sha256; cv=none; b=RHwO7LcAZ1GUn4rQOjlLr4VDSpVY7irOwtP1oXq2oq4TQDhePwB7yO1dYXIPTxIHxQF2IN bhRoA8bRlnUo4Z/pawC19vz9Yu+fuvie5r/snLJlgKmmfVgUQHhEG89oiFJHFbCJYVjaM2 hHIDjriBFfvvCVehMfJiBErTC5SFW/o= Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-a4515f8e13cso257821466b.3 for ; Tue, 05 Mar 2024 00:59:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1709629190; x=1710233990; 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=rAj7+x69ZY+4IfKY/7bKK9Eao6rfkUHshm8TstoFK2I=; b=a90ocAmIVzWITolZry5NC7XfeRqgUuWEQORLKlb2jcpFJ32iySoto4wZvhEBPrGKO8 /OYlpdHtcIFepye9B0u/VkTvdYj0kDosZiwDNtVDeCqu1IjTVe/iwtHAmDG4pmlw8HOt hT6b02cuV6jl5CdummmLdkxHS/CJudZhTlNXfDFRnVqW7sQh0pIEsk1ohrKSCsAYf0oP cpOmd6HJBzskZkJ6+67iSNp3+pH6jYN9vA8mTnFb79kHjOi4gm/RHbdeDBwkSB1ay8mc DS8dXXD3zL+X+Y35H34iSwyE1H6dUf55YYCdWDgeagzqjm/Dgirs1L3qnciRRTkZe0Dv UECQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709629190; x=1710233990; 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=rAj7+x69ZY+4IfKY/7bKK9Eao6rfkUHshm8TstoFK2I=; b=tMJcpn21VX8Fs7H231s2psMy1CgJQh+NvyU7DJfV0f+T5hf1VHnowdyWtpM1HWmyuw Wy/pOHGEMNLHtDsT5oUrbVKEo7PPOdDZmEvLo6qKog1gOC6SLCpoSkxK0E6e0ogEpitX T/k4GCSIYwX1hBapKep65rxrdw/gQZUXIOqxttUyRO69sD49tPfG6nRj8wstsgcQKPg4 xi66/huomTQ0VlX17tAFaGztEuI1C5w4xX382A0KFf7xfYQdDjMXXe/ZG4oSaaCJmAd8 xEk5vAzz0n3meuzGDWAv8atQuTtKypEL1VO9UBkjp6dw5hbJGFjqJgjeg/MmaLH4xxIW SgFA== X-Forwarded-Encrypted: i=1; AJvYcCXeMezoCC5BDqgiBYNQc0ZjyDUu72MQS2FQPqs1RmJ8C/Gydx10LT9GA/JKU6go7lnURf1Q/mM4dj+hGqGzBWM40wg= X-Gm-Message-State: AOJu0YyTATtr22uv7C5bdxK6+MxWsYbdwmF9zyYmSn5B0CS4/NqbxQb0 9UIFCD9JzitTVwyx+8wQS62C8BhzDfrDW2jQJM8qYp4g/h13dvUKybWp32uju/g= X-Google-Smtp-Source: AGHT+IGszUMHFAY8nQqRc7qWBrdOVwxqgaSpJbhboGAmezWe2V+nz5/IYJkGc34N3h/3F3gINvIIXA== X-Received: by 2002:a17:906:b893:b0:a45:5cd9:81ac with SMTP id hb19-20020a170906b89300b00a455cd981acmr3215788ejb.22.1709629189950; Tue, 05 Mar 2024 00:59:49 -0800 (PST) Received: from raven.blarg.de (p200300dc6f010900023064fffe740809.dip0.t-ipconnect.de. [2003:dc:6f01:900:230:64ff:fe74:809]) by smtp.gmail.com with ESMTPSA id gs4-20020a170906f18400b00a449d12cdc5sm4453005ejb.119.2024.03.05.00.59.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 00:59:49 -0800 (PST) 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, Max Kellermann Subject: [PATCH v3 13/14] linux/mm.h: move high_memory to mm/high_memory.h Date: Tue, 5 Mar 2024 09:59:18 +0100 Message-Id: <20240305085919.1601395-14-max.kellermann@ionos.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240305085919.1601395-1-max.kellermann@ionos.com> References: <20240305085919.1601395-1-max.kellermann@ionos.com> MIME-Version: 1.0 X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 5289740005 X-Stat-Signature: 7yto6h7hcgmcobuetft3xh54bs7e6kbm X-Rspam-User: X-HE-Tag: 1709629191-250441 X-HE-Meta: U2FsdGVkX1/cWQSBMYfzfBoRey8Ux2FwuMp9Gdw5YHoEffUqC34lTxsTy5iQYLOaE9oVllPagOi8gY2S118j8RONh1TppheZVKTHcK/NCnpS7LLXboMVWNGOv4n0LXM/666q051/UJsDFiaV5AZd0yMU1/ADDWBpSnJKWncFCdxO1U8NUJbD0DLrldquC7vl7stnOnXdiIg4eZQIcU59iSxMmL6m11cHJu0B2Bf8+FBSBNxT0uJRKLrQyVrmTY9KB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9w608/3XaKczFOjoHNkqHKW6BiPLplsAQs13mAUsevLDU52NFtH9KANtUJWDMc= 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 80fc7df2856a..1d7b4c781995 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -82,7 +83,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 */