DORMANTno replies

[PATCH] ARM: xip: Fix module loading

From: chris.brandt@renesas.com (Chris Brandt)
Date: 2015-11-11 14:31:09
Also in: linux-sh
Subsystem: arm port, the rest · Maintainers: Russell King, Linus Torvalds

For an XIP kernel, RAM start at _sdata instead of _stext. This fixes an
issue where when you load a module, vmalloc would return virtual memory
that the MMU has incorrectly mapped to non-RAM physical addresses.
This fix is similar to what is already done in arm_memblock_init().

Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
---
 arch/arm/mm/mmu.c |    4 ++++
 1 file changed, 4 insertions(+)
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index dd5a56b..d60cb8c 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -1383,7 +1383,11 @@ static void __init kmap_init(void)
 static void __init map_lowmem(void)
 {
 	struct memblock_region *reg;
+#ifdef CONFIG_XIP_KERNEL
+	phys_addr_t kernel_x_start = round_down(__pa(_sdata), SECTION_SIZE);
+#else
 	phys_addr_t kernel_x_start = round_down(__pa(_stext), SECTION_SIZE);
+#endif
 	phys_addr_t kernel_x_end = round_up(__pa(__init_end), SECTION_SIZE);
 
 	/* Map all the lowmem memory banks. */
-- 
1.7.9.5
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help