linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] powerpc/strict_rwx: quirks for STRICT_RWX patches
@ 2017-09-27  9:51 Balbir Singh
  2017-09-27  9:51 ` [PATCH 2/2] powerpc/strict_rwx: fixup region splitting Balbir Singh
  2017-10-04  9:04 ` [PATCH 1/2] powerpc/strict_rwx: quirks for STRICT_RWX patches Michael Ellerman
  0 siblings, 2 replies; 6+ messages in thread
From: Balbir Singh @ 2017-09-27  9:51 UTC (permalink / raw)
  To: mpe; +Cc: linuxppc-dev, Balbir Singh

This patch disables STRICT_RWX for power9 DD1 machines
where due to some limitations with the way we do tlb
updates, we clear the TLB entry of the text that's doing
the update to kernel text and that does lead to a
crash.

Fixes: 7614ff3 ("powerpc/mm/radix: Implement STRICT_RWX/mark_rodata_ro() for Radix")

Cc: stable@vger.kernel.org

Reported-by: Andrew Jeffery <andrew@aj.id.au>
Signed-off-by: Balbir Singh <bsingharora@gmail.com>
---
 arch/powerpc/mm/pgtable-radix.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/powerpc/mm/pgtable-radix.c b/arch/powerpc/mm/pgtable-radix.c
index 39c252b..c2a2b46 100644
--- a/arch/powerpc/mm/pgtable-radix.c
+++ b/arch/powerpc/mm/pgtable-radix.c
@@ -169,6 +169,18 @@ void radix__mark_rodata_ro(void)
 {
 	unsigned long start, end;
 
+	/*
+	 * mark_rodata_ro() will mark itself as !writable at some point
+	 * due to workaround in radix__pte_update(), we'll end up with
+	 * an invalid pte and the system will crash quite severly.
+	 * The alternatives are quite cumbersome and leaving out
+	 * the page containing the flush code is not very nice.
+	 */
+	if (cpu_has_feature(CPU_FTR_POWER9_DD1)) {
+		pr_warn("Warning: Unable to mark rodata read only on P9 DD1\n");
+		return;
+	}
+
 	start = (unsigned long)_stext;
 	end = (unsigned long)__init_begin;
 
-- 
2.9.5

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

end of thread, other threads:[~2017-10-16  1:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-27  9:51 [PATCH 1/2] powerpc/strict_rwx: quirks for STRICT_RWX patches Balbir Singh
2017-09-27  9:51 ` [PATCH 2/2] powerpc/strict_rwx: fixup region splitting Balbir Singh
2017-10-04 11:14   ` Michael Ellerman
2017-10-16  1:03     ` Balbir Singh
2017-10-04  9:04 ` [PATCH 1/2] powerpc/strict_rwx: quirks for STRICT_RWX patches Michael Ellerman
2017-10-16  1:01   ` Balbir Singh

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).