mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/8] of: reserve: add xn flag mem entries
@ 2021-04-20  7:56 Rouven Czerwinski
  2021-04-20  7:56 ` [PATCH 2/8] of: export of_get_reserve_map Rouven Czerwinski
                   ` (7 more replies)
  0 siblings, 8 replies; 17+ messages in thread
From: Rouven Czerwinski @ 2021-04-20  7:56 UTC (permalink / raw)
  To: barebox; +Cc: Rouven Czerwinski

If the OF_RESERVE_ENTRY_FLAG_XN flag is passed while creating the
entry, a subsequent commit will use this information in the mmu to map
the area as non-executable.

Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
---
 arch/arm/cpu/sm.c              | 2 +-
 arch/arm/cpu/start.c           | 2 +-
 arch/arm/mach-layerscape/ppa.c | 2 +-
 common/bootm.c                 | 3 ++-
 drivers/of/fdt.c               | 6 +++++-
 drivers/video/fb.c             | 3 ++-
 drivers/video/simplefb-fixup.c | 2 +-
 fs/pstore/ram.c                | 3 ++-
 include/of.h                   | 7 +++++--
 9 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/arch/arm/cpu/sm.c b/arch/arm/cpu/sm.c
index f5a1edbd4f..ebd5f76e14 100644
--- a/arch/arm/cpu/sm.c
+++ b/arch/arm/cpu/sm.c
@@ -203,7 +203,7 @@ static int of_secure_monitor_fixup(struct device_node *root, void *unused)
 	res_start = (unsigned long)_stext;
 	res_end = (unsigned long)__bss_stop;
 
-	of_add_reserve_entry(res_start, res_end);
+	of_add_reserve_entry(res_start, res_end, 0);
 
 	pr_debug("Reserved memory range from 0x%08lx to 0x%08lx\n", res_start, res_end);
 
diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c
index c61db66865..10ac070fe3 100644
--- a/arch/arm/cpu/start.c
+++ b/arch/arm/cpu/start.c
@@ -227,7 +227,7 @@ __noreturn __no_sanitize_address void barebox_non_pbl_start(unsigned long membas
 	mem_malloc_init((void *)malloc_start, (void *)malloc_end - 1);
 
 	if (IS_ENABLED(CONFIG_BOOTM_OPTEE))
-		of_add_reserve_entry(endmem - OPTEE_SIZE, endmem - 1);
+		of_add_reserve_entry(endmem - OPTEE_SIZE, endmem - 1, OF_RESERVE_ENTRY_FLAG_XN);
 
 	pr_debug("starting barebox...\n");
 
diff --git a/arch/arm/mach-layerscape/ppa.c b/arch/arm/mach-layerscape/ppa.c
index d962fba751..6e61766e54 100644
--- a/arch/arm/mach-layerscape/ppa.c
+++ b/arch/arm/mach-layerscape/ppa.c
@@ -130,7 +130,7 @@ int ls1046a_ppa_init(resource_size_t ppa_start, resource_size_t ppa_size)
 	if (ret)
 		return ret;
 
-	of_add_reserve_entry(ppa_start, ppa_end);
+	of_add_reserve_entry(ppa_start, ppa_end, 0);
 
 	return 0;
 }
diff --git a/common/bootm.c b/common/bootm.c
index 092116beb9..5c2ad1ad3a 100644
--- a/common/bootm.c
+++ b/common/bootm.c
@@ -410,7 +410,8 @@ void *bootm_get_devicetree(struct image_data *data)
 	if (data->initrd_res) {
 		of_add_initrd(data->of_root_node, data->initrd_res->start,
 				data->initrd_res->end);
-		of_add_reserve_entry(data->initrd_res->start, data->initrd_res->end);
+		of_add_reserve_entry(data->initrd_res->start,
+				     data->initrd_res->end, 0);
 	}
 
 	oftree = of_get_fixed_tree(data->of_root_node);
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index d98913e54a..6aade13fa0 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -537,7 +537,8 @@ out_free:
 
 static struct of_reserve_map of_reserve_map;
 
-int of_add_reserve_entry(resource_size_t start, resource_size_t end)
+int of_add_reserve_entry(resource_size_t start, resource_size_t end,
+			 int flags)
 {
 	int e = of_reserve_map.num_entries;
 
@@ -548,6 +549,9 @@ int of_add_reserve_entry(resource_size_t start, resource_size_t end)
 	of_reserve_map.end[e] = end;
 	of_reserve_map.num_entries++;
 
+	if (flags & OF_RESERVE_ENTRY_FLAG_XN)
+		of_reserve_map.xn |= BIT(e);
+
 	return 0;
 }
 
diff --git a/drivers/video/fb.c b/drivers/video/fb.c
index 113c1419a1..8aa4a77ef3 100644
--- a/drivers/video/fb.c
+++ b/drivers/video/fb.c
@@ -202,7 +202,8 @@ static int fb_of_reserve_fixup(struct device_node *root, void *context)
 		return 0;
 
 	of_add_reserve_entry((unsigned long)info->screen_base,
-			(unsigned long)info->screen_base + info->screen_size);
+			(unsigned long)info->screen_base + info->screen_size,
+			0);
 
 	return 0;
 }
diff --git a/drivers/video/simplefb-fixup.c b/drivers/video/simplefb-fixup.c
index a2c59de364..af7554d10f 100644
--- a/drivers/video/simplefb-fixup.c
+++ b/drivers/video/simplefb-fixup.c
@@ -131,7 +131,7 @@ static int simplefb_create_node(struct device_node *root,
 		return ret;
 
 	of_add_reserve_entry((u32)fbi->screen_base,
-			(u32)fbi->screen_base + fbi->screen_size);
+			(u32)fbi->screen_base + fbi->screen_size, 0);
 
 	return of_property_write_string(node, "status", "okay");
 }
diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
index 958f46b0ea..e404187c83 100644
--- a/fs/pstore/ram.c
+++ b/fs/pstore/ram.c
@@ -639,7 +639,8 @@ static int ramoops_probe(struct device_d *dev)
 			  ramoops_ecc);
 		globalvar_add_simple("linux.bootargs.ramoops", kernelargs);
 	} else {
-		of_add_reserve_entry(cxt->phys_addr, cxt->phys_addr + mem_size);
+		of_add_reserve_entry(cxt->phys_addr, cxt->phys_addr + mem_size,
+				0);
 		of_register_fixup(ramoops_of_fixup, pdata);
 	}
 
diff --git a/include/of.h b/include/of.h
index 645f429bde..7c8640a1d6 100644
--- a/include/of.h
+++ b/include/of.h
@@ -54,10 +54,13 @@ struct of_reserve_map {
 	uint64_t start[OF_MAX_RESERVE_MAP];
 	uint64_t end[OF_MAX_RESERVE_MAP];
 	int num_entries;
+	u32 xn;
 };
 
-int of_add_reserve_entry(resource_size_t start, resource_size_t end);
-struct of_reserve_map *of_get_reserve_map(void);
+#define OF_RESERVE_ENTRY_FLAG_XN		BIT(0)
+
+int of_add_reserve_entry(resource_size_t start, resource_size_t end,
+		 int flags);
 void of_clean_reserve_map(void);
 void fdt_add_reserve_map(void *fdt);
 
-- 
2.31.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 2/8] of: export of_get_reserve_map
  2021-04-20  7:56 [PATCH 1/8] of: reserve: add xn flag mem entries Rouven Czerwinski
@ 2021-04-20  7:56 ` Rouven Czerwinski
  2021-04-20  8:47   ` Ahmad Fatoum
  2021-04-20  7:56 ` [PATCH 3/8] ARM: mmu: use reserve mem entries to modify maps Rouven Czerwinski
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 17+ messages in thread
From: Rouven Czerwinski @ 2021-04-20  7:56 UTC (permalink / raw)
  To: barebox; +Cc: Rouven Czerwinski

This allows the retrieval of the reserve map for usage in other
functions, in this case one of the next commits will use this
information to modify the MMU map.

Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
---
 include/of.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/of.h b/include/of.h
index 7c8640a1d6..088b088223 100644
--- a/include/of.h
+++ b/include/of.h
@@ -117,6 +117,7 @@ struct device_node *of_unflatten_dtb_const(const void *infdt);
 struct cdev;
 
 #ifdef CONFIG_OFTREE
+struct of_reserve_map *of_get_reserve_map(void);
 extern int of_bus_n_addr_cells(struct device_node *np);
 extern int of_n_addr_cells(struct device_node *np);
 extern int of_bus_n_size_cells(struct device_node *np);
@@ -774,6 +775,10 @@ static inline int of_autoenable_i2c_by_component(char *path)
 	return -ENODEV;
 }
 
+static inline struct of_reserve_map *of_get_reserve_map(void)
+{
+	return NULL;
+}
 
 #endif
 
-- 
2.31.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 3/8] ARM: mmu: use reserve mem entries to modify maps
  2021-04-20  7:56 [PATCH 1/8] of: reserve: add xn flag mem entries Rouven Czerwinski
  2021-04-20  7:56 ` [PATCH 2/8] of: export of_get_reserve_map Rouven Czerwinski
@ 2021-04-20  7:56 ` Rouven Czerwinski
  2021-04-20  9:09   ` Ahmad Fatoum
  2021-04-20  7:56 ` [PATCH 4/8] of: add flag to not create resmem DT entries Rouven Czerwinski
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 17+ messages in thread
From: Rouven Czerwinski @ 2021-04-20  7:56 UTC (permalink / raw)
  To: barebox; +Cc: Rouven Czerwinski

Use the information from the reserved memory entries to modify the
mapping of memory regions to mark them as uncachable and not-executable.
This also prevents the processor from speculating into these regions,
preventing hard to debug scenarios where boots fail for unknown reasons.

Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
---
 arch/arm/cpu/mmu.c | 60 ++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 58 insertions(+), 2 deletions(-)

diff --git a/arch/arm/cpu/mmu.c b/arch/arm/cpu/mmu.c
index 6af228505d..71d6cad1ef 100644
--- a/arch/arm/cpu/mmu.c
+++ b/arch/arm/cpu/mmu.c
@@ -17,6 +17,7 @@
 #include <memory.h>
 #include <asm/system_info.h>
 #include <asm/sections.h>
+#include <of.h>
 
 #include "mmu.h"
 
@@ -387,6 +388,57 @@ static void vectors_init(void)
 	create_vector_table(ARM_LOW_VECTORS);
 }
 
+static void create_sections_with_intersect(struct memory_bank *bank)
+{
+	int i;
+	unsigned flag;
+	struct of_reserve_map *res_map = of_get_reserve_map();
+	unsigned long j_end;
+	unsigned long end;
+	unsigned long j;
+
+	res_map = of_get_reserve_map();
+	if (!res_map)
+		return;
+
+	end = bank->start + bank->size - 1;
+	j = bank->start;
+
+	while(j < end) {
+		flag = PMD_SECT_DEF_CACHED;
+		j_end = j + PGDIR_SIZE - 1;
+
+		for (i = 0; i < res_map->num_entries; i++) {
+			if(BIT(i) & res_map->xn && (j_end >= res_map->start[i] &&
+						    j_end <= res_map->end[i]))
+				flag = PMD_SECT_DEF_UNCACHED | PMD_SECT_XN;
+		}
+
+		create_sections(ttb, j, j_end, flag);
+		j += PGDIR_SIZE;
+	}
+}
+
+static bool intersects_reserved_map_xn(struct memory_bank *bank)
+{
+	struct of_reserve_map *res_map;
+	unsigned long bank_end;
+	int i;
+
+	res_map = of_get_reserve_map();
+
+	if (!res_map)
+		return false;
+
+	bank_end = bank->start + bank->size;
+	for (i = 0; i < res_map->num_entries; i++) {
+		if(res_map->start[i] >= bank->start || res_map->end[i] <= bank_end)
+			return true;
+	}
+	return false;
+}
+
+
 /*
  * Prepare MMU for usage enable it.
  */
@@ -448,8 +500,12 @@ void __mmu_init(bool mmu_on)
 	vectors_init();
 
 	for_each_memory_bank(bank) {
-		create_sections(ttb, bank->start, bank->start + bank->size - 1,
-				PMD_SECT_DEF_CACHED);
+		if (intersects_reserved_map_xn(bank)) {
+			create_sections_with_intersect(bank);
+		} else {
+			create_sections(ttb, bank->start, bank->start + bank->size - 1,
+					PMD_SECT_DEF_CACHED);
+		}
 		__mmu_cache_flush();
 	}
 
-- 
2.31.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 4/8] of: add flag to not create resmem DT entries
  2021-04-20  7:56 [PATCH 1/8] of: reserve: add xn flag mem entries Rouven Czerwinski
  2021-04-20  7:56 ` [PATCH 2/8] of: export of_get_reserve_map Rouven Czerwinski
  2021-04-20  7:56 ` [PATCH 3/8] ARM: mmu: use reserve mem entries to modify maps Rouven Czerwinski
@ 2021-04-20  7:56 ` Rouven Czerwinski
  2021-04-20  9:22   ` Ahmad Fatoum
  2021-04-20  7:56 ` [PATCH 5/8] of: add reserved_mem_read initcall Rouven Czerwinski
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 17+ messages in thread
From: Rouven Czerwinski @ 2021-04-20  7:56 UTC (permalink / raw)
  To: barebox; +Cc: Rouven Czerwinski

If we are parsing entries from the /reserved-memory device tree path we
don't want to add them again as resmem blocks at the beginning of the
device tree. Therefore add another flag to indicate this.

Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
---
 drivers/of/fdt.c | 10 +++++++---
 include/of.h     |  2 ++
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 6aade13fa0..da36739713 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -552,6 +552,9 @@ int of_add_reserve_entry(resource_size_t start, resource_size_t end,
 	if (flags & OF_RESERVE_ENTRY_FLAG_XN)
 		of_reserve_map.xn |= BIT(e);
 
+	if (flags & OF_RESERVE_ENTRY_FLAG_NO_RESERVE)
+		of_reserve_map.noentry |= BIT(e);
+
 	return 0;
 }
 
@@ -594,9 +597,10 @@ void fdt_add_reserve_map(void *__fdt)
 	fdt_res += n;
 
 	for (i = 0; i < res->num_entries; i++) {
-		of_write_number(&fdt_res->address, res->start[i], 2);
-		of_write_number(&fdt_res->size, res->end[i] - res->start[i] + 1,
-				2);
+		if (!(res->noentry & BIT(i))) {
+			of_write_number(&fdt_res->address, res->start[i], 2);
+			of_write_number(&fdt_res->size, res->end[i] - res->start[i] + 1, 2);
+		}
 		fdt_res++;
 	}
 
diff --git a/include/of.h b/include/of.h
index 088b088223..c6d3836db1 100644
--- a/include/of.h
+++ b/include/of.h
@@ -55,9 +55,11 @@ struct of_reserve_map {
 	uint64_t end[OF_MAX_RESERVE_MAP];
 	int num_entries;
 	u32 xn;
+	u32 noentry;
 };
 
 #define OF_RESERVE_ENTRY_FLAG_XN		BIT(0)
+#define OF_RESERVE_ENTRY_FLAG_NO_RESERVE	BIT(1)
 
 int of_add_reserve_entry(resource_size_t start, resource_size_t end,
 		 int flags);
-- 
2.31.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 5/8] of: add reserved_mem_read initcall
  2021-04-20  7:56 [PATCH 1/8] of: reserve: add xn flag mem entries Rouven Czerwinski
                   ` (2 preceding siblings ...)
  2021-04-20  7:56 ` [PATCH 4/8] of: add flag to not create resmem DT entries Rouven Czerwinski
@ 2021-04-20  7:56 ` Rouven Czerwinski
  2021-04-20  9:23   ` Ahmad Fatoum
  2021-04-20 10:36   ` Ahmad Fatoum
  2021-04-20  7:56 ` [PATCH 6/8] pbl: fdt: add support to parse reserved mem Rouven Czerwinski
                   ` (3 subsequent siblings)
  7 siblings, 2 replies; 17+ messages in thread
From: Rouven Czerwinski @ 2021-04-20  7:56 UTC (permalink / raw)
  To: barebox; +Cc: Rouven Czerwinski

Add a reserved_mem_read initcall which parses the reserved-memory
entries and adds barebox of reserve entries. Also remove the OP-TEE size
of reserve entry, since this is now parsed from the DT and does not need
to be statically configured any longer.

Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
---
 arch/arm/cpu/start.c      |  3 ---
 drivers/of/Makefile       |  1 +
 drivers/of/reserved-mem.c | 41 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 42 insertions(+), 3 deletions(-)
 create mode 100644 drivers/of/reserved-mem.c

diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c
index 10ac070fe3..811de056c0 100644
--- a/arch/arm/cpu/start.c
+++ b/arch/arm/cpu/start.c
@@ -226,9 +226,6 @@ __noreturn __no_sanitize_address void barebox_non_pbl_start(unsigned long membas
 
 	mem_malloc_init((void *)malloc_start, (void *)malloc_end - 1);
 
-	if (IS_ENABLED(CONFIG_BOOTM_OPTEE))
-		of_add_reserve_entry(endmem - OPTEE_SIZE, endmem - 1, OF_RESERVE_ENTRY_FLAG_XN);
-
 	pr_debug("starting barebox...\n");
 
 	start_barebox();
diff --git a/drivers/of/Makefile b/drivers/of/Makefile
index b6847752d2..749fe16a2a 100644
--- a/drivers/of/Makefile
+++ b/drivers/of/Makefile
@@ -4,6 +4,7 @@ obj-$(CONFIG_OF_GPIO) += of_gpio.o
 obj-$(CONFIG_OF_PCI) += of_pci.o
 obj-y += partition.o
 obj-y += of_net.o
+obj-y += reserved-mem.o
 obj-$(CONFIG_MTD) += of_mtd.o
 obj-$(CONFIG_OF_BAREBOX_DRIVERS) += barebox.o
 obj-$(CONFIG_OF_OVERLAY) += overlay.o resolver.o of_firmware.o
diff --git a/drivers/of/reserved-mem.c b/drivers/of/reserved-mem.c
new file mode 100644
index 0000000000..ee15ae880c
--- /dev/null
+++ b/drivers/of/reserved-mem.c
@@ -0,0 +1,41 @@
+#include <common.h>
+#include <init.h>
+#include <io.h>
+#include <of.h>
+#include <of_address.h>
+#include <malloc.h>
+#include <partition.h>
+
+static int reserved_mem_read(void)
+{
+	struct device_node *node, *child;
+	struct resource resource;
+	int flag;
+
+	node = of_get_root_node();
+	if (!node)
+		return 0;
+
+	node = of_find_node_by_path("/reserved-memory");
+	if (!node)
+		return 0;
+
+	for_each_child_of_node(node, child) {
+		flag = OF_RESERVE_ENTRY_FLAG_NO_RESERVE;
+
+		of_address_to_resource(child, 0, &resource);
+
+		pr_err("Res-Mem start: 0x%08x\n", resource.start);
+		pr_err("Res-Mem end: 0x%08x\n", resource.end);
+
+		if(of_find_property(child, "no-map", 0)) {
+			pr_err("Res-Mem: no-map\n");
+			flag |= OF_RESERVE_ENTRY_FLAG_XN;
+		}
+
+		of_add_reserve_entry(resource.start, resource.end, flag);
+	}
+
+	return 0;
+}
+postconsole_initcall(reserved_mem_read);
-- 
2.31.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 6/8] pbl: fdt: add support to parse reserved mem
  2021-04-20  7:56 [PATCH 1/8] of: reserve: add xn flag mem entries Rouven Czerwinski
                   ` (3 preceding siblings ...)
  2021-04-20  7:56 ` [PATCH 5/8] of: add reserved_mem_read initcall Rouven Czerwinski
@ 2021-04-20  7:56 ` Rouven Czerwinski
  2021-04-20 10:29   ` Ahmad Fatoum
  2021-04-20  7:57 ` [PATCH 7/8] ARM: mmu-early: map no-map entries XN & uncached Rouven Czerwinski
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 17+ messages in thread
From: Rouven Czerwinski @ 2021-04-20  7:56 UTC (permalink / raw)
  To: barebox; +Cc: Rouven Czerwinski

This allows the PBL to fill a reserved memory map which a subsequent
commit will use modify the early MMU mapping.

Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
---
 include/pbl.h | 15 ++++++++++
 pbl/fdt.c     | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 95 insertions(+)

diff --git a/include/pbl.h b/include/pbl.h
index 194d5e7508..df0f41ac5b 100644
--- a/include/pbl.h
+++ b/include/pbl.h
@@ -34,4 +34,19 @@ ssize_t pbl_fat_load(struct pbl_bio *, const char *filename, void *dest, size_t
 
 void fdt_find_mem(const void *fdt, unsigned long *membase, unsigned long *memsize);
 
+struct pbl_reserved_memory {
+	phys_addr_t			base;
+	phys_addr_t			size;
+	unsigned int			flag;
+};
+
+#define MAX_RESERVED_REGIONS	8
+
+#define FDT_RES_MEM_FLAG_NOMAP		BIT(0)
+
+void fdt_fill_reserve_mem(const void *fdt);
+
+struct pbl_reserved_memory* get_pbl_reserved_memory(void);
+int get_pbl_reserved_memory_num(void);
+
 #endif /* __PBL_H__ */
diff --git a/pbl/fdt.c b/pbl/fdt.c
index b4a40a514b..f8e301843f 100644
--- a/pbl/fdt.c
+++ b/pbl/fdt.c
@@ -68,3 +68,83 @@ err:
 	pr_err("No memory, cannot continue\n");
 	while (1);
 }
+
+struct pbl_reserved_memory reserved_mem[MAX_RESERVED_REGIONS];
+int reserved_mem_count;
+
+void fdt_fill_reserve_mem(const void *fdt)
+{
+	const __be32 *nap, *nsp, *reg;
+	uint32_t na, ns;
+	int node, size, i, parent;
+	const void * prop;
+	uint64_t memsize64, membase64;
+	bool nomap;
+
+	/* Make sure FDT blob is sane */
+	if (fdt_check_header(fdt) != 0) {
+		pr_err("Invalid device tree blob\n");
+		return;
+	}
+
+	parent = fdt_path_offset(fdt, "/reserved-memory");
+	if (parent < 0) {
+		pr_info("Cannot find reserved-memory node\n");
+		return;
+	}
+
+	nap = fdt_getprop(fdt, parent, "#address-cells", &size);
+	if (!nap || (size != 4)) {
+		pr_err("Cannot find #address-cells property");
+		return;
+	}
+	na = fdt32_to_cpu(*nap);
+
+	nsp = fdt_getprop(fdt, parent, "#size-cells", &size);
+	if (!nsp || (size != 4)) {
+		pr_err("Cannot find #size-cells property");
+		return;
+	}
+	ns = fdt32_to_cpu(*nap);
+
+	fdt_for_each_subnode(node, fdt, parent) {
+		nomap = true;
+		reg = fdt_getprop(fdt, node, "reg", &size);
+		if (size < (na + ns) * sizeof(u32)) {
+			pr_err("cannot get memory range\n");
+			return;
+		}
+
+		membase64 = 0;
+		for (i = 0; i < na; i++)
+			membase64 = (membase64 << 32) | fdt32_to_cpu(*reg++);
+
+		/* get the memsize and truncate it to under 4G on 32 bit machines */
+		memsize64 = 0;
+		for (i = 0; i < ns; i++)
+			memsize64 = (memsize64 << 32) | fdt32_to_cpu(*reg++);
+
+		prop = fdt_getprop(fdt, node, "nomap", NULL);
+		if (!prop)
+			nomap = false;
+
+		reserved_mem[reserved_mem_count].base = membase64;
+		reserved_mem[reserved_mem_count].size = memsize64;
+		if (nomap)
+			reserved_mem[reserved_mem_count].flag |= FDT_RES_MEM_FLAG_NOMAP;
+		reserved_mem_count++;
+	}
+
+	if ((node < 0) && (node != -FDT_ERR_NOTFOUND)) {
+		pr_err("Error while parsing reserved-memory nodes: %d\n", node);
+		return;
+	}
+}
+
+struct pbl_reserved_memory* get_pbl_reserved_memory(void) {
+	return (struct pbl_reserved_memory*)&reserved_mem;
+}
+
+int get_pbl_reserved_memory_num(void) {
+	return reserved_mem_count;
+}
-- 
2.31.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 7/8] ARM: mmu-early: map no-map entries XN & uncached
  2021-04-20  7:56 [PATCH 1/8] of: reserve: add xn flag mem entries Rouven Czerwinski
                   ` (4 preceding siblings ...)
  2021-04-20  7:56 ` [PATCH 6/8] pbl: fdt: add support to parse reserved mem Rouven Czerwinski
@ 2021-04-20  7:57 ` Rouven Czerwinski
  2021-04-20  9:00   ` Lucas Stach
  2021-04-20  7:57 ` [PATCH 8/8] PBL: enable LIBFDT for OP-TEE early loading Rouven Czerwinski
  2021-04-20  8:45 ` [PATCH 1/8] of: reserve: add xn flag mem entries Ahmad Fatoum
  7 siblings, 1 reply; 17+ messages in thread
From: Rouven Czerwinski @ 2021-04-20  7:57 UTC (permalink / raw)
  To: barebox; +Cc: Rouven Czerwinski

Ensure that reserved map entries with the no-map flag are marked as
uncached and non-execute during the early MMU initialization.

Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
---
 arch/arm/cpu/mmu-early.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm/cpu/mmu-early.c b/arch/arm/cpu/mmu-early.c
index b985aa455f..63cf61b2aa 100644
--- a/arch/arm/cpu/mmu-early.c
+++ b/arch/arm/cpu/mmu-early.c
@@ -3,9 +3,11 @@
 #include <errno.h>
 #include <linux/sizes.h>
 #include <asm/memory.h>
+#include <asm-generic/memory_layout.h>
 #include <asm/system.h>
 #include <asm/cache.h>
 #include <asm-generic/sections.h>
+#include <pbl.h>
 
 #include "mmu.h"
 
@@ -24,6 +26,8 @@ static inline void map_region(unsigned long start, unsigned long size,
 void mmu_early_enable(unsigned long membase, unsigned long memsize,
 		      unsigned long _ttb)
 {
+	struct pbl_reserved_memory* res_mem = get_pbl_reserved_memory();
+	int i;
 	ttb = (uint32_t *)_ttb;
 
 	arm_set_cache_functions();
@@ -58,6 +62,14 @@ void mmu_early_enable(unsigned long membase, unsigned long memsize,
 	/* maps main memory as cachable */
 	map_region(membase, memsize, PMD_SECT_DEF_CACHED);
 
+	for(i=0; i < get_pbl_reserved_memory_num(); i++) {
+		if(res_mem->flag & FDT_RES_MEM_FLAG_NOMAP)
+			map_region(res_mem->base, res_mem->size,
+				   PMD_SECT_DEF_UNCACHED | PMD_SECT_XN);
+		res_mem++;
+	}
+
+
 	/*
 	 * With HAB enabled we call into the ROM code later in imx6_hab_get_status().
 	 * Map the ROM cached which has the effect that the XN bit is not set.
-- 
2.31.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 8/8] PBL: enable LIBFDT for OP-TEE early loading
  2021-04-20  7:56 [PATCH 1/8] of: reserve: add xn flag mem entries Rouven Czerwinski
                   ` (5 preceding siblings ...)
  2021-04-20  7:57 ` [PATCH 7/8] ARM: mmu-early: map no-map entries XN & uncached Rouven Czerwinski
@ 2021-04-20  7:57 ` Rouven Czerwinski
  2021-04-20 10:33   ` Ahmad Fatoum
  2021-04-20  8:45 ` [PATCH 1/8] of: reserve: add xn flag mem entries Ahmad Fatoum
  7 siblings, 1 reply; 17+ messages in thread
From: Rouven Czerwinski @ 2021-04-20  7:57 UTC (permalink / raw)
  To: barebox; +Cc: Rouven Czerwinski

This allows the OP-TEE early loaded board to add the reserved memory
entries for the correct MMU setup. This is done by including pbl/fdt.h
and using fdt_fill_reserve_mem().

Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
---
 common/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/Kconfig b/common/Kconfig
index bddf802d3b..469cc3e06a 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -1088,6 +1088,7 @@ config BOOTM_OPTEE
 
 config PBL_OPTEE
 	bool "Enable OP-TEE early start"
+	select LIBFDT
 	depends on ARM
 	depends on !THUMB2_BAREBOX
 	help
-- 
2.31.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 1/8] of: reserve: add xn flag mem entries
  2021-04-20  7:56 [PATCH 1/8] of: reserve: add xn flag mem entries Rouven Czerwinski
                   ` (6 preceding siblings ...)
  2021-04-20  7:57 ` [PATCH 8/8] PBL: enable LIBFDT for OP-TEE early loading Rouven Czerwinski
@ 2021-04-20  8:45 ` Ahmad Fatoum
  7 siblings, 0 replies; 17+ messages in thread
From: Ahmad Fatoum @ 2021-04-20  8:45 UTC (permalink / raw)
  To: Rouven Czerwinski, barebox, Sascha Hauer, Steffen Trumtrar

Hello,

On 20.04.21 09:56, Rouven Czerwinski wrote:
> If the OF_RESERVE_ENTRY_FLAG_XN flag is passed while creating the
> entry, a subsequent commit will use this information in the mmu to map
> the area as non-executable.
> 
> Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
> ---
>  arch/arm/cpu/sm.c              | 2 +-
>  arch/arm/cpu/start.c           | 2 +-
>  arch/arm/mach-layerscape/ppa.c | 2 +-
>  common/bootm.c                 | 3 ++-
>  drivers/of/fdt.c               | 6 +++++-
>  drivers/video/fb.c             | 3 ++-
>  drivers/video/simplefb-fixup.c | 2 +-
>  fs/pstore/ram.c                | 3 ++-
>  include/of.h                   | 7 +++++--
>  9 files changed, 20 insertions(+), 10 deletions(-)
> 
> diff --git a/arch/arm/cpu/sm.c b/arch/arm/cpu/sm.c
> index f5a1edbd4f..ebd5f76e14 100644
> --- a/arch/arm/cpu/sm.c
> +++ b/arch/arm/cpu/sm.c
> @@ -203,7 +203,7 @@ static int of_secure_monitor_fixup(struct device_node *root, void *unused)
>  	res_start = (unsigned long)_stext;
>  	res_end = (unsigned long)__bss_stop;
>  
> -	of_add_reserve_entry(res_start, res_end);
> +	of_add_reserve_entry(res_start, res_end, 0);
>  
>  	pr_debug("Reserved memory range from 0x%08lx to 0x%08lx\n", res_start, res_end);
>  
> diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c
> index c61db66865..10ac070fe3 100644
> --- a/arch/arm/cpu/start.c
> +++ b/arch/arm/cpu/start.c
> @@ -227,7 +227,7 @@ __noreturn __no_sanitize_address void barebox_non_pbl_start(unsigned long membas
>  	mem_malloc_init((void *)malloc_start, (void *)malloc_end - 1);
>  
>  	if (IS_ENABLED(CONFIG_BOOTM_OPTEE))
> -		of_add_reserve_entry(endmem - OPTEE_SIZE, endmem - 1);
> +		of_add_reserve_entry(endmem - OPTEE_SIZE, endmem - 1, OF_RESERVE_ENTRY_FLAG_XN);
>  
>  	pr_debug("starting barebox...\n");
>  
> diff --git a/arch/arm/mach-layerscape/ppa.c b/arch/arm/mach-layerscape/ppa.c
> index d962fba751..6e61766e54 100644
> --- a/arch/arm/mach-layerscape/ppa.c
> +++ b/arch/arm/mach-layerscape/ppa.c
> @@ -130,7 +130,7 @@ int ls1046a_ppa_init(resource_size_t ppa_start, resource_size_t ppa_size)
>  	if (ret)
>  		return ret;
>  
> -	of_add_reserve_entry(ppa_start, ppa_end);
> +	of_add_reserve_entry(ppa_start, ppa_end, 0);

IMO this should be mapped _XN too. Sascha, Steffen could you check
and send a patch for this?

>  
>  	return 0;
>  }
> diff --git a/common/bootm.c b/common/bootm.c
> index 092116beb9..5c2ad1ad3a 100644
> --- a/common/bootm.c
> +++ b/common/bootm.c
> @@ -410,7 +410,8 @@ void *bootm_get_devicetree(struct image_data *data)
>  	if (data->initrd_res) {
>  		of_add_initrd(data->of_root_node, data->initrd_res->start,
>  				data->initrd_res->end);
> -		of_add_reserve_entry(data->initrd_res->start, data->initrd_res->end);
> +		of_add_reserve_entry(data->initrd_res->start,
> +				     data->initrd_res->end, 0);
>  	}
>  
>  	oftree = of_get_fixed_tree(data->of_root_node);
> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
> index d98913e54a..6aade13fa0 100644
> --- a/drivers/of/fdt.c
> +++ b/drivers/of/fdt.c
> @@ -537,7 +537,8 @@ out_free:
>  
>  static struct of_reserve_map of_reserve_map;
>  
> -int of_add_reserve_entry(resource_size_t start, resource_size_t end)
> +int of_add_reserve_entry(resource_size_t start, resource_size_t end,
> +			 int flags)
>  {
>  	int e = of_reserve_map.num_entries;
>  
> @@ -548,6 +549,9 @@ int of_add_reserve_entry(resource_size_t start, resource_size_t end)
>  	of_reserve_map.end[e] = end;
>  	of_reserve_map.num_entries++;
>  
> +	if (flags & OF_RESERVE_ENTRY_FLAG_XN)
> +		of_reserve_map.xn |= BIT(e);
> +
>  	return 0;
>  }
>  
> diff --git a/drivers/video/fb.c b/drivers/video/fb.c
> index 113c1419a1..8aa4a77ef3 100644
> --- a/drivers/video/fb.c
> +++ b/drivers/video/fb.c
> @@ -202,7 +202,8 @@ static int fb_of_reserve_fixup(struct device_node *root, void *context)
>  		return 0;
>  
>  	of_add_reserve_entry((unsigned long)info->screen_base,
> -			(unsigned long)info->screen_base + info->screen_size);
> +			(unsigned long)info->screen_base + info->screen_size,
> +			0);
>  
>  	return 0;
>  }
> diff --git a/drivers/video/simplefb-fixup.c b/drivers/video/simplefb-fixup.c
> index a2c59de364..af7554d10f 100644
> --- a/drivers/video/simplefb-fixup.c
> +++ b/drivers/video/simplefb-fixup.c
> @@ -131,7 +131,7 @@ static int simplefb_create_node(struct device_node *root,
>  		return ret;
>  
>  	of_add_reserve_entry((u32)fbi->screen_base,
> -			(u32)fbi->screen_base + fbi->screen_size);
> +			(u32)fbi->screen_base + fbi->screen_size, 0);
>  
>  	return of_property_write_string(node, "status", "okay");
>  }
> diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
> index 958f46b0ea..e404187c83 100644
> --- a/fs/pstore/ram.c
> +++ b/fs/pstore/ram.c
> @@ -639,7 +639,8 @@ static int ramoops_probe(struct device_d *dev)
>  			  ramoops_ecc);
>  		globalvar_add_simple("linux.bootargs.ramoops", kernelargs);
>  	} else {
> -		of_add_reserve_entry(cxt->phys_addr, cxt->phys_addr + mem_size);
> +		of_add_reserve_entry(cxt->phys_addr, cxt->phys_addr + mem_size,
> +				0);
>  		of_register_fixup(ramoops_of_fixup, pdata);
>  	}
>  
> diff --git a/include/of.h b/include/of.h
> index 645f429bde..7c8640a1d6 100644
> --- a/include/of.h
> +++ b/include/of.h
> @@ -54,10 +54,13 @@ struct of_reserve_map {
>  	uint64_t start[OF_MAX_RESERVE_MAP];
>  	uint64_t end[OF_MAX_RESERVE_MAP];
>  	int num_entries;
> +	u32 xn;

I'd prefer a u16 xn : OF_MAX_RESERVE_MAP. That way the relation
is clearly documented and less likely to be overlooked should
OF_MAX_RESERVE_MAP be increased in future.

>  };
>  
> -int of_add_reserve_entry(resource_size_t start, resource_size_t end);
> -struct of_reserve_map *of_get_reserve_map(void);

Why is of_get_reserve_map being deleted?

> +#define OF_RESERVE_ENTRY_FLAG_XN		BIT(0)
> +
> +int of_add_reserve_entry(resource_size_t start, resource_size_t end,
> +		 int flags);
>  void of_clean_reserve_map(void);
>  void fdt_add_reserve_map(void *fdt);
>  
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 2/8] of: export of_get_reserve_map
  2021-04-20  7:56 ` [PATCH 2/8] of: export of_get_reserve_map Rouven Czerwinski
@ 2021-04-20  8:47   ` Ahmad Fatoum
  0 siblings, 0 replies; 17+ messages in thread
From: Ahmad Fatoum @ 2021-04-20  8:47 UTC (permalink / raw)
  To: Rouven Czerwinski, barebox



On 20.04.21 09:56, Rouven Czerwinski wrote:
> This allows the retrieval of the reserve map for usage in other
> functions, in this case one of the next commits will use this
> information to modify the MMU map.
> 
> Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>

Function existed before. Please adjust commit message to note what
actually changes: A new stub is introduced for !CONFIG_OFTREE.

With this comment addressed:

Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>

> ---
>  include/of.h | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/include/of.h b/include/of.h
> index 7c8640a1d6..088b088223 100644
> --- a/include/of.h
> +++ b/include/of.h
> @@ -117,6 +117,7 @@ struct device_node *of_unflatten_dtb_const(const void *infdt);
>  struct cdev;
>  
>  #ifdef CONFIG_OFTREE
> +struct of_reserve_map *of_get_reserve_map(void);
>  extern int of_bus_n_addr_cells(struct device_node *np);
>  extern int of_n_addr_cells(struct device_node *np);
>  extern int of_bus_n_size_cells(struct device_node *np);
> @@ -774,6 +775,10 @@ static inline int of_autoenable_i2c_by_component(char *path)
>  	return -ENODEV;
>  }
>  
> +static inline struct of_reserve_map *of_get_reserve_map(void)
> +{
> +	return NULL;
> +}
>  
>  #endif

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 7/8] ARM: mmu-early: map no-map entries XN & uncached
  2021-04-20  7:57 ` [PATCH 7/8] ARM: mmu-early: map no-map entries XN & uncached Rouven Czerwinski
@ 2021-04-20  9:00   ` Lucas Stach
  0 siblings, 0 replies; 17+ messages in thread
From: Lucas Stach @ 2021-04-20  9:00 UTC (permalink / raw)
  To: Rouven Czerwinski, barebox

Am Dienstag, dem 20.04.2021 um 09:57 +0200 schrieb Rouven Czerwinski:
> Ensure that reserved map entries with the no-map flag are marked as
> uncached and non-execute during the early MMU initialization.
> 
> Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
> ---
>  arch/arm/cpu/mmu-early.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/arch/arm/cpu/mmu-early.c b/arch/arm/cpu/mmu-early.c
> index b985aa455f..63cf61b2aa 100644
> --- a/arch/arm/cpu/mmu-early.c
> +++ b/arch/arm/cpu/mmu-early.c
> @@ -3,9 +3,11 @@
>  #include <errno.h>
>  #include <linux/sizes.h>
>  #include <asm/memory.h>
> +#include <asm-generic/memory_layout.h>
>  #include <asm/system.h>
>  #include <asm/cache.h>
>  #include <asm-generic/sections.h>
> +#include <pbl.h>
>  
> 
> 
> 
>  #include "mmu.h"
>  
> 
> 
> 
> @@ -24,6 +26,8 @@ static inline void map_region(unsigned long start, unsigned long size,
>  void mmu_early_enable(unsigned long membase, unsigned long memsize,
>  		      unsigned long _ttb)
>  {
> +	struct pbl_reserved_memory* res_mem = get_pbl_reserved_memory();
> +	int i;
>  	ttb = (uint32_t *)_ttb;
>  
> 
> 
> 
>  	arm_set_cache_functions();
> @@ -58,6 +62,14 @@ void mmu_early_enable(unsigned long membase, unsigned long memsize,
>  	/* maps main memory as cachable */
>  	map_region(membase, memsize, PMD_SECT_DEF_CACHED);
>  
> 
> 
> 
> +	for(i=0; i < get_pbl_reserved_memory_num(); i++) {
> +		if(res_mem->flag & FDT_RES_MEM_FLAG_NOMAP)

Quite a bit of missing whitespace in the two lines above.

Also the variables at the top of the function don't form a reverse
christmas tree, but that isn't part of the coding style, so I don't
complain about that. ;)

Regards,
Lucas

> +			map_region(res_mem->base, res_mem->size,
> +				   PMD_SECT_DEF_UNCACHED | PMD_SECT_XN);
> +		res_mem++;
> +	}
> +
> +
>  	/*
>  	 * With HAB enabled we call into the ROM code later in imx6_hab_get_status().
>  	 * Map the ROM cached which has the effect that the XN bit is not set.



_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 3/8] ARM: mmu: use reserve mem entries to modify maps
  2021-04-20  7:56 ` [PATCH 3/8] ARM: mmu: use reserve mem entries to modify maps Rouven Czerwinski
@ 2021-04-20  9:09   ` Ahmad Fatoum
  0 siblings, 0 replies; 17+ messages in thread
From: Ahmad Fatoum @ 2021-04-20  9:09 UTC (permalink / raw)
  To: Rouven Czerwinski, barebox

On 20.04.21 09:56, Rouven Czerwinski wrote:
> Use the information from the reserved memory entries to modify the
> mapping of memory regions to mark them as uncachable and not-executable.
> This also prevents the processor from speculating into these regions,
> preventing hard to debug scenarios where boots fail for unknown reasons.
> 
> Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
> ---
>  arch/arm/cpu/mmu.c | 60 ++++++++++++++++++++++++++++++++++++++++++++--
>  1 file changed, 58 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/cpu/mmu.c b/arch/arm/cpu/mmu.c
> index 6af228505d..71d6cad1ef 100644
> --- a/arch/arm/cpu/mmu.c
> +++ b/arch/arm/cpu/mmu.c
> @@ -17,6 +17,7 @@
>  #include <memory.h>
>  #include <asm/system_info.h>
>  #include <asm/sections.h>
> +#include <of.h>
>  
>  #include "mmu.h"
>  
> @@ -387,6 +388,57 @@ static void vectors_init(void)
>  	create_vector_table(ARM_LOW_VECTORS);
>  }
>  
> +static void create_sections_with_intersect(struct memory_bank *bank)
> +{
> +	int i;
> +	unsigned flag;

u32 pmd_flags fits the intent better.

> +	struct of_reserve_map *res_map = of_get_reserve_map();

Drop this call. It's overwritten later.

> +	unsigned long j_end;
> +	unsigned long end;
> +	unsigned long j;
> +
> +	res_map = of_get_reserve_map();
> +	if (!res_map)

Check unneeded, you never enter here if !of_get_reserve_map() anyway.

> +		return;
> +
> +	end = bank->start + bank->size - 1;
> +	j = bank->start;
> +
> +	while(j < end) {

Missing space after while. Same for if() a few lines down.
IMO a for loop would be clearer here.

> +		flag = PMD_SECT_DEF_CACHED;
> +		j_end = j + PGDIR_SIZE - 1;
> +
> +		for (i = 0; i < res_map->num_entries; i++) {
> +			if(BIT(i) & res_map->xn && (j_end >= res_map->start[i] &&

Always wrap bitwise comparisons in parenthesis. Doesn't matter for code
correctness here however. The parens for the && stuff can be dropped.

> +						    j_end <= res_map->end[i]))

What about a section that starts in a reserved region, but doesn't end in one?
This wouldn't be considered here, would it?

> +				flag = PMD_SECT_DEF_UNCACHED | PMD_SECT_XN;
> +		}
> +
> +		create_sections(ttb, j, j_end, flag);
> +		j += PGDIR_SIZE;
> +	}
> +}
> +
> +static bool intersects_reserved_map_xn(struct memory_bank *bank)
> +{
> +	struct of_reserve_map *res_map;
> +	unsigned long bank_end;
> +	int i;
> +
> +	res_map = of_get_reserve_map();
> +
> +	if (!res_map)

Also early-exit if !res_map->xn.

> +		return false;
> +
> +	bank_end = bank->start + bank->size;

band_end is one past the end here...

> +	for (i = 0; i < res_map->num_entries; i++) {
> +		if(res_map->start[i] >= bank->start || res_map->end[i] <= bank_end)

So this should read < bank_end.

> +			return true;
> +	}
> +	return false;
> +}
> +
> +
>  /*
>   * Prepare MMU for usage enable it.
>   */
> @@ -448,8 +500,12 @@ void __mmu_init(bool mmu_on)
>  	vectors_init();
>  
>  	for_each_memory_bank(bank) {
> -		create_sections(ttb, bank->start, bank->start + bank->size - 1,
> -				PMD_SECT_DEF_CACHED);
> +		if (intersects_reserved_map_xn(bank)) {

I think it would be cleaner to remove this check here and just have one section
creation function. You can check whether there are any XN sections and if any
XN sections are intersecting at the start and then just have a flag you check
in the loop to skip the section search


> +			create_sections_with_intersect(bank);
> +		} else {
> +			create_sections(ttb, bank->start, bank->start + bank->size - 1,
> +					PMD_SECT_DEF_CACHED);
> +		}
>  		__mmu_cache_flush();
>  	}
>  
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 4/8] of: add flag to not create resmem DT entries
  2021-04-20  7:56 ` [PATCH 4/8] of: add flag to not create resmem DT entries Rouven Czerwinski
@ 2021-04-20  9:22   ` Ahmad Fatoum
  0 siblings, 0 replies; 17+ messages in thread
From: Ahmad Fatoum @ 2021-04-20  9:22 UTC (permalink / raw)
  To: Rouven Czerwinski, barebox

On 20.04.21 09:56, Rouven Czerwinski wrote:
> If we are parsing entries from the /reserved-memory device tree path we
> don't want to add them again as resmem blocks at the beginning of the
> device tree. Therefore add another flag to indicate this.

This has the assumption that the /reserved-memory device tree node is
identical between barebox and kernel. Prior to your next commit, this
assumption wasn't there because barebox just copied over fix ups it
knows about into the kernel device tree.

I think what you rather do here is to mark device tree reserved entries
by origin. You have a bit that says whether it's a /memreserve/
or /reserved-memory and fix it up the same way into the kernel device
tree.

> 
> Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
> ---
>  drivers/of/fdt.c | 10 +++++++---
>  include/of.h     |  2 ++
>  2 files changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
> index 6aade13fa0..da36739713 100644
> --- a/drivers/of/fdt.c
> +++ b/drivers/of/fdt.c
> @@ -552,6 +552,9 @@ int of_add_reserve_entry(resource_size_t start, resource_size_t end,
>  	if (flags & OF_RESERVE_ENTRY_FLAG_XN)
>  		of_reserve_map.xn |= BIT(e);
>  
> +	if (flags & OF_RESERVE_ENTRY_FLAG_NO_RESERVE)
> +		of_reserve_map.noentry |= BIT(e);
> +
>  	return 0;
>  }
>  
> @@ -594,9 +597,10 @@ void fdt_add_reserve_map(void *__fdt)
>  	fdt_res += n;
>  
>  	for (i = 0; i < res->num_entries; i++) {
> -		of_write_number(&fdt_res->address, res->start[i], 2);
> -		of_write_number(&fdt_res->size, res->end[i] - res->start[i] + 1,
> -				2);
> +		if (!(res->noentry & BIT(i))) {
> +			of_write_number(&fdt_res->address, res->start[i], 2);
> +			of_write_number(&fdt_res->size, res->end[i] - res->start[i] + 1, 2);
> +		}
>  		fdt_res++;
>  	}
>  
> diff --git a/include/of.h b/include/of.h
> index 088b088223..c6d3836db1 100644
> --- a/include/of.h
> +++ b/include/of.h
> @@ -55,9 +55,11 @@ struct of_reserve_map {
>  	uint64_t end[OF_MAX_RESERVE_MAP];
>  	int num_entries;
>  	u32 xn;
> +	u32 noentry;

u16 : OF_MAX_RESERVE_MAP would fit nicely in here. See comment on first patch. 

>  };
>  
>  #define OF_RESERVE_ENTRY_FLAG_XN		BIT(0)
> +#define OF_RESERVE_ENTRY_FLAG_NO_RESERVE	BIT(1)

Sorry for bikeshedding. But OF_RESERVE.*_NO_RESERVE needs a rename
even if the commit stays mostly as it is..

>  
>  int of_add_reserve_entry(resource_size_t start, resource_size_t end,
>  		 int flags);
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 5/8] of: add reserved_mem_read initcall
  2021-04-20  7:56 ` [PATCH 5/8] of: add reserved_mem_read initcall Rouven Czerwinski
@ 2021-04-20  9:23   ` Ahmad Fatoum
  2021-04-20 10:36   ` Ahmad Fatoum
  1 sibling, 0 replies; 17+ messages in thread
From: Ahmad Fatoum @ 2021-04-20  9:23 UTC (permalink / raw)
  To: Rouven Czerwinski, barebox

Hi,

On 20.04.21 09:56, Rouven Czerwinski wrote:
> Add a reserved_mem_read initcall which parses the reserved-memory
> entries and adds barebox of reserve entries. Also remove the OP-TEE size
> of reserve entry, since this is now parsed from the DT and does not need
> to be statically configured any longer.
> 
> Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
> ---
>  arch/arm/cpu/start.c      |  3 ---
>  drivers/of/Makefile       |  1 +
>  drivers/of/reserved-mem.c | 41 +++++++++++++++++++++++++++++++++++++++
>  3 files changed, 42 insertions(+), 3 deletions(-)
>  create mode 100644 drivers/of/reserved-mem.c
> 
> diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c
> index 10ac070fe3..811de056c0 100644
> --- a/arch/arm/cpu/start.c
> +++ b/arch/arm/cpu/start.c
> @@ -226,9 +226,6 @@ __noreturn __no_sanitize_address void barebox_non_pbl_start(unsigned long membas
>  
>  	mem_malloc_init((void *)malloc_start, (void *)malloc_end - 1);
>  
> -	if (IS_ENABLED(CONFIG_BOOTM_OPTEE))
> -		of_add_reserve_entry(endmem - OPTEE_SIZE, endmem - 1, OF_RESERVE_ENTRY_FLAG_XN);
> -
>  	pr_debug("starting barebox...\n");
>  
>  	start_barebox();
> diff --git a/drivers/of/Makefile b/drivers/of/Makefile
> index b6847752d2..749fe16a2a 100644
> --- a/drivers/of/Makefile
> +++ b/drivers/of/Makefile
> @@ -4,6 +4,7 @@ obj-$(CONFIG_OF_GPIO) += of_gpio.o
>  obj-$(CONFIG_OF_PCI) += of_pci.o
>  obj-y += partition.o
>  obj-y += of_net.o
> +obj-y += reserved-mem.o

obj-$(CONFIG_OFDEVICE)

>  obj-$(CONFIG_MTD) += of_mtd.o
>  obj-$(CONFIG_OF_BAREBOX_DRIVERS) += barebox.o
>  obj-$(CONFIG_OF_OVERLAY) += overlay.o resolver.o of_firmware.o
> diff --git a/drivers/of/reserved-mem.c b/drivers/of/reserved-mem.c
> new file mode 100644
> index 0000000000..ee15ae880c
> --- /dev/null
> +++ b/drivers/of/reserved-mem.c
> @@ -0,0 +1,41 @@
> +#include <common.h>
> +#include <init.h>
> +#include <io.h>

Is this header used here?

> +#include <of.h>
> +#include <of_address.h>
> +#include <malloc.h>
> +#include <partition.h>
> +
> +static int reserved_mem_read(void)
> +{
> +	struct device_node *node, *child;
> +	struct resource resource;
> +	int flag;
> +
> +	node = of_get_root_node();
> +	if (!node)
> +		return 0;

Unneeded check. of_find_node_by_path takes care of this.

> +
> +	node = of_find_node_by_path("/reserved-memory");
> +	if (!node)
> +		return 0;
> +
> +	for_each_child_of_node(node, child) {
> +		flag = OF_RESERVE_ENTRY_FLAG_NO_RESERVE;
> +
> +		of_address_to_resource(child, 0, &resource);
> +
> +		pr_err("Res-Mem start: 0x%08x\n", resource.start);
> +		pr_err("Res-Mem end: 0x%08x\n", resource.end);

pr_debug?

> +
> +		if(of_find_property(child, "no-map", 0)) {

Whitespace ;)

> +			pr_err("Res-Mem: no-map\n");
> +			flag |= OF_RESERVE_ENTRY_FLAG_XN;
> +		}
> +
> +		of_add_reserve_entry(resource.start, resource.end, flag);
> +	}
> +
> +	return 0;
> +}
> +postconsole_initcall(reserved_mem_read);

I think this should be postcore_initcall

> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 6/8] pbl: fdt: add support to parse reserved mem
  2021-04-20  7:56 ` [PATCH 6/8] pbl: fdt: add support to parse reserved mem Rouven Czerwinski
@ 2021-04-20 10:29   ` Ahmad Fatoum
  0 siblings, 0 replies; 17+ messages in thread
From: Ahmad Fatoum @ 2021-04-20 10:29 UTC (permalink / raw)
  To: Rouven Czerwinski, barebox

On 20.04.21 09:56, Rouven Czerwinski wrote:
> This allows the PBL to fill a reserved memory map which a subsequent
> commit will use modify the early MMU mapping.
> 
> Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
> ---
>  include/pbl.h | 15 ++++++++++
>  pbl/fdt.c     | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 95 insertions(+)
> 
> diff --git a/include/pbl.h b/include/pbl.h
> index 194d5e7508..df0f41ac5b 100644
> --- a/include/pbl.h
> +++ b/include/pbl.h
> @@ -34,4 +34,19 @@ ssize_t pbl_fat_load(struct pbl_bio *, const char *filename, void *dest, size_t
>  
>  void fdt_find_mem(const void *fdt, unsigned long *membase, unsigned long *memsize);
>  
> +struct pbl_reserved_memory {
> +	phys_addr_t			base;
> +	phys_addr_t			size;
> +	unsigned int			flag;

flags

> +};
> +
> +#define MAX_RESERVED_REGIONS	8
> +
> +#define FDT_RES_MEM_FLAG_NOMAP		BIT(0)
> +
> +void fdt_fill_reserve_mem(const void *fdt);
> +
> +struct pbl_reserved_memory* get_pbl_reserved_memory(void);
> +int get_pbl_reserved_memory_num(void);
> +
>  #endif /* __PBL_H__ */
> diff --git a/pbl/fdt.c b/pbl/fdt.c
> index b4a40a514b..f8e301843f 100644
> --- a/pbl/fdt.c
> +++ b/pbl/fdt.c
> @@ -68,3 +68,83 @@ err:
>  	pr_err("No memory, cannot continue\n");
>  	while (1);
>  }
> +
> +struct pbl_reserved_memory reserved_mem[MAX_RESERVED_REGIONS];
> +int reserved_mem_count;

Both can be made static.

> +
> +void fdt_fill_reserve_mem(const void *fdt)
> +{
> +	const __be32 *nap, *nsp, *reg;
> +	uint32_t na, ns;
> +	int node, size, i, parent;
> +	const void * prop;
> +	uint64_t memsize64, membase64;
> +	bool nomap;
> +
> +	/* Make sure FDT blob is sane */
> +	if (fdt_check_header(fdt) != 0) {
> +		pr_err("Invalid device tree blob\n");
> +		return;
> +	}
> +
> +	parent = fdt_path_offset(fdt, "/reserved-memory");
> +	if (parent < 0) {
> +		pr_info("Cannot find reserved-memory node\n");
> +		return;
> +	}
> +
> +	nap = fdt_getprop(fdt, parent, "#address-cells", &size);
> +	if (!nap || (size != 4)) {
> +		pr_err("Cannot find #address-cells property");
> +		return;
> +	}
> +	na = fdt32_to_cpu(*nap);

fdt_address_cells?

> +
> +	nsp = fdt_getprop(fdt, parent, "#size-cells", &size);
> +	if (!nsp || (size != 4)) {
> +		pr_err("Cannot find #size-cells property");
> +		return;
> +	}
> +	ns = fdt32_to_cpu(*nap);

fdt_size_cells?

> +
> +	fdt_for_each_subnode(node, fdt, parent) {
> +		nomap = true;
> +		reg = fdt_getprop(fdt, node, "reg", &size);
> +		if (size < (na + ns) * sizeof(u32)) {
> +			pr_err("cannot get memory range\n");
> +			return;
> +		}
> +
> +		membase64 = 0;
> +		for (i = 0; i < na; i++)
> +			membase64 = (membase64 << 32) | fdt32_to_cpu(*reg++);

I wondered whether there's a helper for that, but couldn't find anything.

> +
> +		/* get the memsize and truncate it to under 4G on 32 bit machines */
> +		memsize64 = 0;
> +		for (i = 0; i < ns; i++)
> +			memsize64 = (memsize64 << 32) | fdt32_to_cpu(*reg++);
> +
> +		prop = fdt_getprop(fdt, node, "nomap", NULL);
> +		if (!prop)
> +			nomap = false;
> +
> +		reserved_mem[reserved_mem_count].base = membase64;
> +		reserved_mem[reserved_mem_count].size = memsize64;
> +		if (nomap)
> +			reserved_mem[reserved_mem_count].flag |= FDT_RES_MEM_FLAG_NOMAP;
> +		reserved_mem_count++;
> +	}
> +
> +	if ((node < 0) && (node != -FDT_ERR_NOTFOUND)) {
> +		pr_err("Error while parsing reserved-memory nodes: %d\n", node);
> +		return;
> +	}
> +}
> +
> +struct pbl_reserved_memory* get_pbl_reserved_memory(void) {

{ on separate line, make it const.

> +	return (struct pbl_reserved_memory*)&reserved_mem;

just return reserved_mem; should work

> +}
> +
> +int get_pbl_reserved_memory_num(void) {

Ditto

> +	return reserved_mem_count;
> +}
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 8/8] PBL: enable LIBFDT for OP-TEE early loading
  2021-04-20  7:57 ` [PATCH 8/8] PBL: enable LIBFDT for OP-TEE early loading Rouven Czerwinski
@ 2021-04-20 10:33   ` Ahmad Fatoum
  0 siblings, 0 replies; 17+ messages in thread
From: Ahmad Fatoum @ 2021-04-20 10:33 UTC (permalink / raw)
  To: Rouven Czerwinski, barebox



On 20.04.21 09:57, Rouven Czerwinski wrote:
> This allows the OP-TEE early loaded board to add the reserved memory
> entries for the correct MMU setup. This is done by including pbl/fdt.h
> and using fdt_fill_reserve_mem().
> 
> Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
> ---
>  common/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/common/Kconfig b/common/Kconfig
> index bddf802d3b..469cc3e06a 100644
> --- a/common/Kconfig
> +++ b/common/Kconfig
> @@ -1088,6 +1088,7 @@ config BOOTM_OPTEE
>  
>  config PBL_OPTEE
>  	bool "Enable OP-TEE early start"
> +	select LIBFDT
>  	depends on ARM
>  	depends on !THUMB2_BAREBOX

Should this

depends on !CONFIG_OPTEE_SIZE

?

>  	help
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 5/8] of: add reserved_mem_read initcall
  2021-04-20  7:56 ` [PATCH 5/8] of: add reserved_mem_read initcall Rouven Czerwinski
  2021-04-20  9:23   ` Ahmad Fatoum
@ 2021-04-20 10:36   ` Ahmad Fatoum
  1 sibling, 0 replies; 17+ messages in thread
From: Ahmad Fatoum @ 2021-04-20 10:36 UTC (permalink / raw)
  To: Rouven Czerwinski, barebox

Hello Rouven,

On 20.04.21 09:56, Rouven Czerwinski wrote:
> Add a reserved_mem_read initcall which parses the reserved-memory
> entries and adds barebox of reserve entries. Also remove the OP-TEE size
> of reserve entry, since this is now parsed from the DT and does not need
> to be statically configured any longer.
> 
> Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
> ---
>  arch/arm/cpu/start.c      |  3 ---
>  drivers/of/Makefile       |  1 +
>  drivers/of/reserved-mem.c | 41 +++++++++++++++++++++++++++++++++++++++
>  3 files changed, 42 insertions(+), 3 deletions(-)
>  create mode 100644 drivers/of/reserved-mem.c
> 
> diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c
> index 10ac070fe3..811de056c0 100644
> --- a/arch/arm/cpu/start.c
> +++ b/arch/arm/cpu/start.c
> @@ -226,9 +226,6 @@ __noreturn __no_sanitize_address void barebox_non_pbl_start(unsigned long membas
>  
>  	mem_malloc_init((void *)malloc_start, (void *)malloc_end - 1);
>  
> -	if (IS_ENABLED(CONFIG_BOOTM_OPTEE))
> -		of_add_reserve_entry(endmem - OPTEE_SIZE, endmem - 1, OF_RESERVE_ENTRY_FLAG_XN);
> -

That silently breaks BOOTM_OPTEE, doesn't it? Either this should remain
or CONFIG_OPTEE_SIZE != 0 should loudly complain that people need to put
this into the device tree..

>  	pr_debug("starting barebox...\n");
>  
>  	start_barebox();
> diff --git a/drivers/of/Makefile b/drivers/of/Makefile
> index b6847752d2..749fe16a2a 100644
> --- a/drivers/of/Makefile
> +++ b/drivers/of/Makefile
> @@ -4,6 +4,7 @@ obj-$(CONFIG_OF_GPIO) += of_gpio.o
>  obj-$(CONFIG_OF_PCI) += of_pci.o
>  obj-y += partition.o
>  obj-y += of_net.o
> +obj-y += reserved-mem.o
>  obj-$(CONFIG_MTD) += of_mtd.o
>  obj-$(CONFIG_OF_BAREBOX_DRIVERS) += barebox.o
>  obj-$(CONFIG_OF_OVERLAY) += overlay.o resolver.o of_firmware.o
> diff --git a/drivers/of/reserved-mem.c b/drivers/of/reserved-mem.c
> new file mode 100644
> index 0000000000..ee15ae880c
> --- /dev/null
> +++ b/drivers/of/reserved-mem.c
> @@ -0,0 +1,41 @@
> +#include <common.h>
> +#include <init.h>
> +#include <io.h>
> +#include <of.h>
> +#include <of_address.h>
> +#include <malloc.h>
> +#include <partition.h>
> +
> +static int reserved_mem_read(void)
> +{
> +	struct device_node *node, *child;
> +	struct resource resource;
> +	int flag;
> +
> +	node = of_get_root_node();
> +	if (!node)
> +		return 0;
> +
> +	node = of_find_node_by_path("/reserved-memory");
> +	if (!node)
> +		return 0;
> +
> +	for_each_child_of_node(node, child) {
> +		flag = OF_RESERVE_ENTRY_FLAG_NO_RESERVE;
> +
> +		of_address_to_resource(child, 0, &resource);
> +
> +		pr_err("Res-Mem start: 0x%08x\n", resource.start);
> +		pr_err("Res-Mem end: 0x%08x\n", resource.end);
> +
> +		if(of_find_property(child, "no-map", 0)) {
> +			pr_err("Res-Mem: no-map\n");
> +			flag |= OF_RESERVE_ENTRY_FLAG_XN;
> +		}
> +
> +		of_add_reserve_entry(resource.start, resource.end, flag);
> +	}
> +
> +	return 0;
> +}
> +postconsole_initcall(reserved_mem_read);
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2021-04-20 10:37 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-20  7:56 [PATCH 1/8] of: reserve: add xn flag mem entries Rouven Czerwinski
2021-04-20  7:56 ` [PATCH 2/8] of: export of_get_reserve_map Rouven Czerwinski
2021-04-20  8:47   ` Ahmad Fatoum
2021-04-20  7:56 ` [PATCH 3/8] ARM: mmu: use reserve mem entries to modify maps Rouven Czerwinski
2021-04-20  9:09   ` Ahmad Fatoum
2021-04-20  7:56 ` [PATCH 4/8] of: add flag to not create resmem DT entries Rouven Czerwinski
2021-04-20  9:22   ` Ahmad Fatoum
2021-04-20  7:56 ` [PATCH 5/8] of: add reserved_mem_read initcall Rouven Czerwinski
2021-04-20  9:23   ` Ahmad Fatoum
2021-04-20 10:36   ` Ahmad Fatoum
2021-04-20  7:56 ` [PATCH 6/8] pbl: fdt: add support to parse reserved mem Rouven Czerwinski
2021-04-20 10:29   ` Ahmad Fatoum
2021-04-20  7:57 ` [PATCH 7/8] ARM: mmu-early: map no-map entries XN & uncached Rouven Czerwinski
2021-04-20  9:00   ` Lucas Stach
2021-04-20  7:57 ` [PATCH 8/8] PBL: enable LIBFDT for OP-TEE early loading Rouven Czerwinski
2021-04-20 10:33   ` Ahmad Fatoum
2021-04-20  8:45 ` [PATCH 1/8] of: reserve: add xn flag mem entries Ahmad Fatoum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox