Linux-RISC-V Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] Revert "riscv: Fixup static_obj() fail"
@ 2020-10-05 19:39 Palmer Dabbelt
  0 siblings, 0 replies; only message in thread
From: Palmer Dabbelt @ 2020-10-05 19:39 UTC (permalink / raw)
  To: linux-riscv; +Cc: Palmer Dabbelt, kernel-team

6184358da000 ("riscv: Fixup static_obj() fail") attempted to elide a lockdep
failure by rearranging our kernel memory map to place all initdata within
[_stext, _end], thus triggering lockdep to treat these as static objects.
These objects are released and eventually reallocated, causing
check_kernel_text_object() to trigger a BUG().

This reverts commit 6184358da0004c8fd940afda6c0a0fa4027dc911.

Fixes: 6184358da000 ("riscv: Fixup static_obj() fail")
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>

---

It's pretty late in the process so while I'd prefer to fix both bugs (ie, fix
lockdep without breaking hardened usercopy) I don't think there's time to do so
for 5.9 (or even 5.10).  I'll try to find some time to look in to a more
focused fix to the lockdep issue, but finding some time to actually think about
our memory map has been on my TODO list for a while now.
---
 arch/riscv/kernel/vmlinux.lds.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/riscv/kernel/vmlinux.lds.S b/arch/riscv/kernel/vmlinux.lds.S
index f3586e31ed1e..e6f8016b366a 100644
--- a/arch/riscv/kernel/vmlinux.lds.S
+++ b/arch/riscv/kernel/vmlinux.lds.S
@@ -22,7 +22,6 @@ SECTIONS
 	/* Beginning of code and text segment */
 	. = LOAD_OFFSET;
 	_start = .;
-	_stext = .;
 	HEAD_TEXT_SECTION
 	. = ALIGN(PAGE_SIZE);
 
@@ -55,6 +54,7 @@ SECTIONS
 	. = ALIGN(SECTION_ALIGN);
 	.text : {
 		_text = .;
+		_stext = .;
 		TEXT_TEXT
 		SCHED_TEXT
 		CPUIDLE_TEXT
-- 
2.28.0.806.g8561365e88-goog


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-05 19:39 [PATCH] Revert "riscv: Fixup static_obj() fail" Palmer Dabbelt

Linux-RISC-V Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-riscv/0 linux-riscv/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-riscv linux-riscv/ https://lore.kernel.org/linux-riscv \
		linux-riscv@lists.infradead.org
	public-inbox-index linux-riscv

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-riscv


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git