* [PATCH AUTOSEL 5.4 38/42] riscv: Set text_offset correctly for M-Mode
[not found] <20201110035440.424258-1-sashal@kernel.org>
@ 2020-11-10 3:54 ` Sasha Levin
0 siblings, 0 replies; only message in thread
From: Sasha Levin @ 2020-11-10 3:54 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Sasha Levin, linux-riscv, Palmer Dabbelt, Sean Anderson
From: Sean Anderson <seanga2@gmail.com>
[ Upstream commit 79605f1394261995c2b955c906a5a20fb27cdc84 ]
M-Mode Linux is loaded at the start of RAM, not 2MB later. Perhaps this
should be calculated based on PAGE_OFFSET somehow? Even better would be to
deprecate text_offset and instead introduce something absolute.
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/riscv/kernel/head.S | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/riscv/kernel/head.S b/arch/riscv/kernel/head.S
index 72f89b7590dd6..344793159b97d 100644
--- a/arch/riscv/kernel/head.S
+++ b/arch/riscv/kernel/head.S
@@ -26,12 +26,17 @@ ENTRY(_start)
/* reserved */
.word 0
.balign 8
+#ifdef CONFIG_RISCV_M_MODE
+ /* Image load offset (0MB) from start of RAM for M-mode */
+ .dword 0
+#else
#if __riscv_xlen == 64
/* Image load offset(2MB) from start of RAM */
.dword 0x200000
#else
/* Image load offset(4MB) from start of RAM */
.dword 0x400000
+#endif
#endif
/* Effective size of kernel image */
.dword _end - _start
--
2.27.0
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2020-11-10 3:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20201110035440.424258-1-sashal@kernel.org>
2020-11-10 3:54 ` [PATCH AUTOSEL 5.4 38/42] riscv: Set text_offset correctly for M-Mode Sasha Levin
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).