From patchwork Thu Feb 15 14:56:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Kellermann X-Patchwork-Id: 201521 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp455000dyb; Thu, 15 Feb 2024 07:00:12 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVTidxPannX0ijuQWxLe9a9GjQeNHZKx7nYjAmotVaUWiaIjEN9G06gJZeELfvm6YlBZKXfApBovN1St/iaftvA9/ssTQ== X-Google-Smtp-Source: AGHT+IGz9Jy5uQqPLVrThG6cy/1+C9/XjwwT7HJGaqyTpWETKBNZZku+Vqy3FZhQmXsKiiitfA+1 X-Received: by 2002:a05:6512:138c:b0:511:5411:1144 with SMTP id fc12-20020a056512138c00b0051154111144mr1943998lfb.14.1708009212552; Thu, 15 Feb 2024 07:00:12 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708009212; cv=pass; d=google.com; s=arc-20160816; b=JE/5VFGuwCImitbxcLe19ZDDaaNC1jxf8GHXEm+1C2z6XAnkZOZVuIXgF9BUTV+ck4 vCSLogcLuLkSHhwMCVu0r7SiHx0lRgG/zhibkB6OQAIVHf6V82LNbX6DinEhvMtW7Lv7 CNYnOvn96wRV7ypfIuT0XbbzM4Ry1IbvQ0Y3niENHXjKMOfOb+LJG1axFdwBcnuX27yC NNzMtry9e5FQ+db0cveHchy7u8dGm0KxzXEBypeNoYD+bMIIYJRnSLmXoF7JPBqOGtuJ GxTPVYKu0C5IaWiLMAJOnd3DRzvrSePnG6onlwU8HrXApr6mxEGV+e1RopIraAauZVme ZMkQ== 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=UMOhGrGj8ZKb8QpbixTkN6L6ZFBU6wOv0Z5Y6TlRvLQ=; fh=sD35p224mE51LPy6t7x+1HVX2Ywd14J6BRhJfcxttmk=; b=p0vXhk0ielX+k3mozrx1h+D1+t8nFMhsPsr8VCUtM19ST+WhPonnS4OiNZ4HbH8m9D 1043JI4+F1G4W8I/LLAx3exZHrnM5Cm9jHTgRQa8n1x0sGWycoqnkAcsy3GCrTv2DGUj wOqoLfDU0CMuEQsXdbJASlY/ORkQ4ZqchVErhYdMbIY8n07DfNavWAyVd10VL95qzy+o Gj/5uHms4jyu/Kx8cSnUDbkhPvV8zq05TMIt4iyhIrEc06rOBDZUWQOEEBn11n+60qPT oMs1wKtjdmc8NTetw6MJAsiIcjJyaK1Cl2kclwtqPP5KKDrTk+sp0OOrvGu40K6HckAC DCCQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=KLj+s59V; 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-67124-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67124-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id lj11-20020a170906f9cb00b00a3db5f70c8csi144433ejb.510.2024.02.15.07.00.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 07:00:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67124-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=KLj+s59V; 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-67124-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67124-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 am.mirrors.kernel.org (Postfix) with ESMTPS id F37661F212C4 for ; Thu, 15 Feb 2024 15:00:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D10931353EC; Thu, 15 Feb 2024 14:56:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b="KLj+s59V" Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) (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 6491713473F for ; Thu, 15 Feb 2024 14:56:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708008987; cv=none; b=LwG1j05Ntk/p4WsB0wOrtpN7qpSJTATfwceRdyq6Wyu+gSTd+9Hmcq+KmP1ascFSN0GNIUW1nTf743CwDVyU2wirLnXQMs01WgPPydq+lKM+xzEPULLqf1mGNWPf7AXCzeERZ8mgDUGoei7jvmAskq0emSR5xqphTHp2z7ikhsQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708008987; c=relaxed/simple; bh=qL4DR4wz2fFAx8PAq9Sk1DQylS4SyIzfyxgi/LjNHjo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=NVYZR8Gx/g/NCGomGg9Jgg2MT8yUmm6DMPsstnunPZ45GYrhn3alq8CiUByWDurxE7ge7sKXnMR/Y/iDbnCw2ok+XlDBLXTh74u0RbRqMZPyS+K7GAF1NucsYepvwX5mjZFXWjzWey/odpmteBS17w1MO4zxNZWDRyEqeRGaVZA= 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=KLj+s59V; arc=none smtp.client-ip=209.85.208.174 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-lj1-f174.google.com with SMTP id 38308e7fff4ca-2d208d0b282so9304281fa.0 for ; Thu, 15 Feb 2024 06:56:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1708008983; x=1708613783; 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=UMOhGrGj8ZKb8QpbixTkN6L6ZFBU6wOv0Z5Y6TlRvLQ=; b=KLj+s59VYTi3pWx2M4pfO9dpOROkz6jIls83+fNZsVrE1WteEQNv7EX3lKI4587paD ug5t5wQzyZurrUpQ05CORjLEeG4iSWZrj5Qy2fcRHzdDMeRm7gLFeyYYW6jceaTQzcra hFrjVVqjB/IXvXyycHzg7IMKpik1W8/MZaX/DBftiodzHn+33Z0qlVob8JHt7XblKc41 nnbrObIJOpkzGZGwrsvxWXBkiJgadsnEBqW7G5nY1IrKS5XiITEGL6Ll/7yMv8KWxEvh BEWi4h8EnKTAdJcLf6qppE6dZ4qYAcij6xOSq7ZQhTxzgzpYayk4Byz+8+xEj7HHQIQD HTvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708008983; x=1708613783; 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=UMOhGrGj8ZKb8QpbixTkN6L6ZFBU6wOv0Z5Y6TlRvLQ=; b=GiV8hqu5mWwv7o3hIaPDkbTLo+n6XH8M6xl50HhtsJMRqwhQQzzqX84Shg0kivQPKI yxwRrK0qVL8gTa0LtGOW0zSVCM90v0i1zTmoc+nL7edhmQ1qO9kn6U80Bio9yNLGUN/0 GiyFKiRpsvfCQCgsf76BQRte2oBnfXvY6SJnwV0TqQjneuP+gzvrZjKuLFtXTLqkOZF/ N6XVFy053HCKh2lkvAz+G7MxhZC/NM7rJzNbseqTDWcraNsg5krqP4Ow7WVqdWc4ASjj u9Y7nO16PI3Fygc+9MvNKuawqBZlNAKJ3fvZpt8JFKxIp7g6Bu85HDIJcQRBlF5hc6Dy ZFaA== X-Forwarded-Encrypted: i=1; AJvYcCV6oB9M4t/7Akcfmo34ROU+ly5klWXMf1zxksgYHrpx7ALTEuTugeZ41EH6jgM7ZwGQHAbce003wSlp+7olFOxb51OtxXbARyAWbkRj X-Gm-Message-State: AOJu0YxKuYq89qRAgC9/W8eUHfEYfZ8cdVinMeWNmf+mstt/GS8dYIHQ eZOK1HUIzGP9/qAQhRxJ0QwXq73zxINtuk0zmSM1gMJ3qvaMleMpUaHM9RE1ymy5KJ2iTQeZyzl N X-Received: by 2002:a19:5e12:0:b0:511:7746:5687 with SMTP id s18-20020a195e12000000b0051177465687mr1519101lfb.24.1708008983414; Thu, 15 Feb 2024 06:56:23 -0800 (PST) Received: from raven.intern.cm-ag (p200300dc6f267100023064fffe740809.dip0.t-ipconnect.de. [2003:dc:6f26:7100:230:64ff:fe74:809]) by smtp.gmail.com with ESMTPSA id s18-20020a170906169200b00a3d1897ab68sm631175ejd.113.2024.02.15.06.56.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 06:56:23 -0800 (PST) From: Max Kellermann To: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Max Kellermann Subject: [PATCH v1 13/14] linux/mm.h: move high_memory to mm/high_memory.h Date: Thu, 15 Feb 2024 15:56:01 +0100 Message-Id: <20240215145602.1371274-14-max.kellermann@ionos.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240215145602.1371274-1-max.kellermann@ionos.com> References: <20240215145602.1371274-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: 1790977468316739722 X-GMAIL-MSGID: 1790977468316739722 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 ++++ include/linux/mm.h | 2 +- include/linux/mm/high_memory.h | 7 +++++++ 14 files changed, 33 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/include/linux/mm.h b/include/linux/mm.h index d4624940923f..75ab0144656c 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -3,6 +3,7 @@ #define _LINUX_MM_H #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 */