From nobody Tue Apr 7 19:54:16 2026 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AC658364023; Fri, 27 Feb 2026 17:56:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772214996; cv=none; b=svXT5IFkygowEg+B2+TyiTRWoZtvI9/TDjvQPz75VGmC15JyEIqaR9uL8Et0fyhzHIPECiMkA86lQYVcllAW+k2d9D+sWtWJmdMYZqUCuNbb8tKnJmjZokYWD7ha7bndFgnS2uFpCkJdzQ94iXr1JCq77jaKSUrZFXzhAiESKso= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772214996; c=relaxed/simple; bh=bI8Gl183Rin9rGfFGV1mgKQOfIESiX+tZE6Ejnm4OdM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=d1T9mBfGWgD2p7H/itHU0AP9+FGwFTY3tWFpA4XlEh/osdLU45Qx26uGnHEKMeQ14dLUOpMMtutILVlOCPDcXlRoUjuinYJwsrkbvKnUC3c6RW8qoYnmNtGHnUM3gWw/qt2w6LXv/6rg8IEBo1PLXtOVDxRxFF/0wYMldcuG8tk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D3DBC14BF; Fri, 27 Feb 2026 09:56:28 -0800 (PST) Received: from e123572-lin.arm.com (e123572-lin.cambridge.arm.com [10.1.194.54]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C17103F73B; Fri, 27 Feb 2026 09:56:30 -0800 (PST) From: Kevin Brodsky To: linux-hardening@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Kevin Brodsky , Andrew Morton , Andy Lutomirski , Catalin Marinas , Dave Hansen , David Hildenbrand , Ira Weiny , Jann Horn , Jeff Xu , Joey Gouly , Kees Cook , Linus Walleij , Lorenzo Stoakes , Marc Zyngier , Mark Brown , Matthew Wilcox , Maxwell Bland , "Mike Rapoport (IBM)" , Peter Zijlstra , Pierre Langlois , Quentin Perret , Rick Edgecombe , Ryan Roberts , Thomas Gleixner , Vlastimil Babka , Will Deacon , Yang Shi , Yeoreum Yun , linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, x86@kernel.org Subject: [PATCH v6 11/30] memblock: Move INIT_MEMBLOCK_* macros to header Date: Fri, 27 Feb 2026 17:54:59 +0000 Message-ID: <20260227175518.3728055-12-kevin.brodsky@arm.com> X-Mailer: git-send-email 2.51.2 In-Reply-To: <20260227175518.3728055-1-kevin.brodsky@arm.com> References: <20260227175518.3728055-1-kevin.brodsky@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The upcoming page table allocator for the kpkeys_hardened_pgtables feature will need to know the maximum number of memblock regions. Move the corresponding macros to to allow that. INIT_MEMBLOCK_{RESERVED,MEMORY}_REGIONS may be overridden, but this should be fine as only arm64 and loong currently do that and the relevant header is already (indirectly) included by . Signed-off-by: Kevin Brodsky --- include/linux/memblock.h | 11 +++++++++++ mm/memblock.c | 11 ----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/linux/memblock.h b/include/linux/memblock.h index 6ec5e9ac0699..79f3ca8ff268 100644 --- a/include/linux/memblock.h +++ b/include/linux/memblock.h @@ -24,6 +24,17 @@ extern unsigned long max_pfn; */ extern unsigned long long max_possible_pfn; =20 +#define INIT_MEMBLOCK_REGIONS 128 +#define INIT_PHYSMEM_REGIONS 4 + +#ifndef INIT_MEMBLOCK_RESERVED_REGIONS +#define INIT_MEMBLOCK_RESERVED_REGIONS INIT_MEMBLOCK_REGIONS +#endif + +#ifndef INIT_MEMBLOCK_MEMORY_REGIONS +#define INIT_MEMBLOCK_MEMORY_REGIONS INIT_MEMBLOCK_REGIONS +#endif + /** * enum memblock_flags - definition of memory region attributes * @MEMBLOCK_NONE: no special request diff --git a/mm/memblock.c b/mm/memblock.c index b3ddfdec7a80..954eb76aa0c2 100644 --- a/mm/memblock.c +++ b/mm/memblock.c @@ -29,17 +29,6 @@ =20 #include "internal.h" =20 -#define INIT_MEMBLOCK_REGIONS 128 -#define INIT_PHYSMEM_REGIONS 4 - -#ifndef INIT_MEMBLOCK_RESERVED_REGIONS -# define INIT_MEMBLOCK_RESERVED_REGIONS INIT_MEMBLOCK_REGIONS -#endif - -#ifndef INIT_MEMBLOCK_MEMORY_REGIONS -#define INIT_MEMBLOCK_MEMORY_REGIONS INIT_MEMBLOCK_REGIONS -#endif - /** * DOC: memblock overview * --=20 2.51.2