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: 204729 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:aa16:b0:108:e6aa:91d0 with SMTP id by22csp200130dyb; Thu, 22 Feb 2024 04:00:09 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV/vhXRXVQMsnUMSwq72Siq6rJjo6vukkZUzg2ETNFAKM6uMPyYaIXG3+IGpGrBn63OVME5fWH1nRT1W35TrajJx+gK2w== X-Google-Smtp-Source: AGHT+IHB2lYoh5PH5JH/57AA8LAA/qH3bVGxh+G+vHji4QxfH822g1avZFNDvRnn07FipvC1NCt6 X-Received: by 2002:a05:6a21:1583:b0:19e:cae4:7c07 with SMTP id nr3-20020a056a21158300b0019ecae47c07mr20067263pzb.45.1708603209323; Thu, 22 Feb 2024 04:00:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708603209; cv=pass; d=google.com; s=arc-20160816; b=k01diXV0pSna5MU29IckkLprs9d2PxTaFJIgvMqbP44yhS63vVG7RUoUj48ElUJeLw aXlh+F7J2EP4UxNqnZ00vpCMPdxc8O4wo8OmbLx6J+7USp7sqnhTyCvXm7jedga2i9De tWQKVaB5Ps/oL/fU4QAfu9oGsN0M+UT+j1uBgCnK/3xYKo4IX0m1Gk/Sv1U64yIPRWYX bLQXbBIVq/9mwfxUHKjzsQjYM3i0RnmribKmAYkOhVD67/fo+nto4UHihwgnbPB+MAMn FWQ/Ts+rAdxDjHwZ2Icmm5ZdoHGF1a6uKKGPYpUck9uUKRZip7OAsPMp64b36zi7Eb5F Rqwg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=rnyD5PxkKV5o19zNsO0L5tf/fTdRWviw2NTc0WpmPto=; fh=8IRiN35HfrJ5VnEzzJDxq94yq2BPgrE6fDd5PLxvq5U=; b=BRnPxTlIcfL3feGoFNT8bc/TVXwAkleOpOH7ylP6e4T29LL9n+VsLxM65CIfKyueb6 b0twotMwZ3lQNy6cim23ylbgE7pnUunWY4speTmGEOow9j+k9L5+eED8nWsXwuXFmCrV gGr1GJY3rZO/AUU9rH4deGaao3Bsio4p0HGEaX43+NcBPKr3+D1Zb5PcYCzFzDn2lWDX UokP2ULJTMO8VORQObkJ82JNjiPqDAA4F/Mc119fq0YTcL7AZ5nB6UtpZG5AcYFRjX8Q x4FDV6Aba8UNllKsanDJxS+eyxkas7SAHi2HrdMYATQ4DoeQ8H49o1yFf/U6LgvVghn+ E6gw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b="IANuR/ae"; arc=pass (i=1 spf=pass spfdomain=ionos.com dkim=pass dkdomain=ionos.com dmarc=pass fromdomain=ionos.com); spf=pass (google.com: domain of linux-kernel+bounces-76461-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76461-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id a28-20020a056a001d1c00b006e464e0bcf2si7085081pfx.34.2024.02.22.04.00.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 04:00:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-76461-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b="IANuR/ae"; arc=pass (i=1 spf=pass spfdomain=ionos.com dkim=pass dkdomain=ionos.com dmarc=pass fromdomain=ionos.com); spf=pass (google.com: domain of linux-kernel+bounces-76461-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76461-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 328EFB2192F for ; Thu, 22 Feb 2024 11:54:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 486B2524BE; Thu, 22 Feb 2024 11:51:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b="IANuR/ae" Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AEE3B40BEE for ; Thu, 22 Feb 2024 11:51:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708602678; cv=none; b=mLIKyKoEsLFsUUDE2LK+ihRB+6vwSqJx6axkALsFL5vw5fmZeBY7fV+FRDdg1X0HN+ellfqMiq6MuuOaVQOfmjtD9Yi55wKEMmhSOY68h+Scoo2B+b5Ym7XI63z4iGTyvM/8xbej7h+5on9RuNWmFhhqRcneRl+NNclzjU4DO3M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708602678; c=relaxed/simple; bh=daz2rq6rFV2eHut/CqMGAgO7JV6tA0j6PgEXIH1uJ3w=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=V15Rc4C5llrlYgvbLhfIceypUkCb6YizYTGc04w8DofNTnHqeigcjVcxGp+xyBvD1N2SCVWanHG3WiPxXp8laG+VDOGrVnSljwpF7LQTXOKcbYjIt4pwV/I7NrNxqwq3EVXmWZbX5mBDQWsCoRQnEEPIh89daGQnkMM1/uwVLg4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ionos.com; spf=pass smtp.mailfrom=ionos.com; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b=IANuR/ae; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ionos.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ionos.com Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-4128cfb6c1aso1724245e9.0 for ; Thu, 22 Feb 2024 03:51:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1708602674; x=1709207474; darn=vger.kernel.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=IANuR/aehwOTPGBYD5nwExGsqLGHpEIuy8W0edvY50gfmS+4q2wDuvj6CnW80IlW1n VLiaJCUqD1DR47sHqDjCmss+/xfbdgPmUnmjACIa9kybjvYSVKe7Ftv4CjYXaVH5KjSg bz8O+mbykdeZDfE+urerkO2v5yBOZaiG/Bx+R9PQcj989RnL/nFHEerZS/LLGZBKmewH ey0n+Zvsydq7RASkqmzardIi4KgfyXTxFfSZbs7DrT4taAFdJnYaKSrDrnPKMLwkS7LA FEVREuOH34xSf4mzp2h7HvUxQrZdiy70+Eha49dV1sOIUBhj7WsSmKrPVAgwGrDS8sQb re7Q== 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=D1PE2BHbgiKcu3M/GunzYBm09IZ/P+Jb6bYtEiL8dzZ+7Uw6EucyTn1Ey8VcJu6Mkb Km2G7RQaQUaLn/9Sqqv+A8wcyQ59PDWAA5Lnh2Tzd/Cly+z86B4vWDECzS6Fguvh/2i7 Um9Fz/qf+IRdy6EjzLMkBhzEwQfXI/+PfRdqtdeXQdxbpXjCVR6jiEWNQ6lnxe4eKara JhQtppYY+QBdg5drDvbGbrx7Sl18M5J06+rR0nxIcdZZxAlcaY7BRTK4RLr9Qh+I/89B 1AqASsDjytN+OvUE+0g26xhis6Q/ed6PsxvuE0udJW2uN4uQTjlxnecn9HJhMUXfa0jH uh0g== X-Forwarded-Encrypted: i=1; AJvYcCVastPb5EFGbFqvwaqdtdV8OTq8DIktheWeKD/f2kpUKLS2dQsT8AGWeoAZU2vfb4He6pNZOCIRJK52v4Y61Ilo+Vl70QDoDX+45Y64 X-Gm-Message-State: AOJu0YztuUr98ItC31w6KdjpdaEpIlNg5wy9rE7M5UXf8WDmlC9Ylzw8 /KdtE9rJ97QwTV5DiBbIUYQa5RJSvp6NTURPezUgwTdEKlv3DuN+qPZjyh/i1yFYUTZptH6ka+M 1 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791600319101713351 X-GMAIL-MSGID: 1791600319101713351 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 */