linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: chris.brandt@renesas.com (Chris Brandt)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: xip: Fix module loading
Date: Wed, 11 Nov 2015 09:31:09 -0500	[thread overview]
Message-ID: <1447252269-22864-1-git-send-email-chris.brandt@renesas.com> (raw)

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

                 reply	other threads:[~2015-11-11 14:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1447252269-22864-1-git-send-email-chris.brandt@renesas.com \
    --to=chris.brandt@renesas.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).