lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20251023-of-max-reserved-mem-v1-1-cfecc7a2150f@kernel.org>
Date: Thu, 23 Oct 2025 17:35:13 +0200
From: Maxime Ripard <mripard@...nel.org>
To: Rob Herring <robh@...nel.org>, Saravana Kannan <saravanak@...gle.com>
Cc: Eric Chanudet <echanude@...hat.com>, Radu Rendec <rrendec@...hat.com>, 
 devicetree@...r.kernel.org, linux-kernel@...r.kernel.org, 
 Maxime Ripard <mripard@...nel.org>
Subject: [PATCH] of: Make the number of reserved memory regions
 configurable

Some platforms register more reserved memory regions than the current
hardcoded limit of 64.

Let's turn into a Kconfig option so we can easily tune it according to a
platform needs, while keeping the current value as a default.

Signed-off-by: Maxime Ripard <mripard@...nel.org>
---
 drivers/of/Kconfig      | 12 ++++++++++++
 drivers/of/of_private.h |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig
index 50697cc3b07ebeb24283e22299797ce4612db89c..721221ae73cef118f8bde8c64c6298aa5f1d106e 100644
--- a/drivers/of/Kconfig
+++ b/drivers/of/Kconfig
@@ -97,10 +97,22 @@ config OF_IRQ
 	depends on !SPARC && IRQ_DOMAIN
 
 config OF_RESERVED_MEM
 	def_bool OF_EARLY_FLATTREE
 
+config OF_RESERVED_MEM_AREAS
+	int "Maximum count of reserved memory areas"
+	depends on OF_RESERVED_MEM
+	default 64
+	help
+	  Platforms can create a number of reserved memory region
+	  to accomodate their firmware,	describe driver-specific
+	  memory regions, etc. This parameters sets the maximum
+	  number of reserved memory areas in the system.
+
+	  If unsure, leave to its default value 64.
+
 config OF_RESOLVE
 	bool
 
 config OF_OVERLAY
 	bool "Device Tree overlays"
diff --git a/drivers/of/of_private.h b/drivers/of/of_private.h
index df0bb00349e01145930fa85c195aefc0a7c32a06..af424ca876b4481c21563bfbac8691a74a42970b 100644
--- a/drivers/of/of_private.h
+++ b/drivers/of/of_private.h
@@ -7,11 +7,11 @@
  * Paul Mackerras	August 1996.
  * Copyright (C) 1996-2005 Paul Mackerras.
  */
 
 #define FDT_ALIGN_SIZE 8
-#define MAX_RESERVED_REGIONS    64
+#define MAX_RESERVED_REGIONS    CONFIG_OF_RESERVED_MEM_AREAS
 
 /**
  * struct alias_prop - Alias property in 'aliases' node
  * @link:	List node to link the structure in aliases_lookup list
  * @alias:	Alias property name

---
base-commit: efb26a23ed5f5dc3554886ab398f559dcb1de96b
change-id: 20251023-of-max-reserved-mem-a8e8d7db3afe

Best regards,
-- 
Maxime Ripard <mripard@...nel.org>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ