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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110118202907.13011.35108.stgit@localhost6.localdomain6>
Date:	Tue, 18 Jan 2011 13:29:07 -0700
From:	Grant Likely <grant.likely@...retlab.ca>
To:	linux-arm-kernel@...ts.infradead.org
Cc:	Nicolas Pitre <nicolas.pitre@...aro.org>,
	Russell King <linux@....linux.org.uk>,
	Catalin Marinas <catalin.marinas@....com>,
	devicetree-discuss@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
	Olof Johansson <olof@...om.net>,
	Jeremy Kerr <jeremy.kerr@...onical.com>,
	John Linn <John.Linn@...inx.com>,
	Lennert Buijtenhek <buytenh@...tstofly.org>
Subject: [PATCH 2/8] arm/dt: allow bootmem reservation for device tree blob
	and initrd

This patch adds a function, arm_reserve_devtree(), to allow the device
tree code to reserve the memory used by the FDT blob.  It also adds
early_init_dt_setup_initrd() which is the hook used by the flat device
tree code to register the region of memory occupied by an initrd.

[based on original patch written by Jeremy Kerr <jeremy.kerr@...onical.com>]
Signed-off-by: Grant Likely <grant.likely@...retlab.ca>
---
 arch/arm/include/asm/setup.h |    2 ++
 arch/arm/mm/init.c           |   23 +++++++++++++++++++++++
 2 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/arch/arm/include/asm/setup.h b/arch/arm/include/asm/setup.h
index f1e5a9b..0f3e0ac 100644
--- a/arch/arm/include/asm/setup.h
+++ b/arch/arm/include/asm/setup.h
@@ -221,6 +221,8 @@ extern struct meminfo meminfo;
 #define bank_phys_end(bank)	((bank)->start + (bank)->size)
 #define bank_phys_size(bank)	(bank)->size
 
+extern void arm_reserve_devtree(unsigned long start, unsigned long size);
+
 #endif  /*  __KERNEL__  */
 
 #endif
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 5164069..28ccb21 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -71,6 +71,25 @@ static int __init parse_tag_initrd2(const struct tag *tag)
 
 __tagtable(ATAG_INITRD2, parse_tag_initrd2);
 
+#ifdef CONFIG_OF_FLATTREE
+#include <linux/of_fdt.h>
+
+static unsigned long phys_devtree_start __initdata = 0;
+static unsigned long phys_devtree_size __initdata = 0;
+
+void __init early_init_dt_setup_initrd_arch(unsigned long start, unsigned long end)
+{
+	phys_initrd_start = start;
+	phys_initrd_size = end - start + 1;
+}
+
+void __init arm_reserve_devtree(unsigned long start, unsigned long size)
+{
+	phys_devtree_start = start;
+	phys_devtree_size = size;
+}
+#endif /* CONFIG_OF_FLATTREE */
+
 /*
  * This keeps memory configuration data used by a couple memory
  * initialization functions, as well as show_mem() for the skipping
@@ -305,6 +324,10 @@ void __init arm_memblock_init(struct meminfo *mi, struct machine_desc *mdesc)
 		initrd_end = initrd_start + phys_initrd_size;
 	}
 #endif
+#ifdef CONFIG_OF_FLATTREE
+	if (phys_devtree_size)
+		memblock_reserve(phys_devtree_start, phys_devtree_size);
+#endif
 
 	arm_mm_memblock_reserve();
 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ