Skip to contentSkip to conversation

FAILED: patch "[PATCH] powerpc/mm: Fix CONFIG_PPC_KUAP_DEBUG on PPC32" failed to apply to 5.4-stable tree

PATCH [email protected] 2 participants 2 messages Apr 27, 2020

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 5.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From feb8e960d780e170e992a70491eec9dd68f4dbf2 Mon Sep 17 00:00:00 2001
From: Christophe Leroy <[email protected]>
Date: Fri, 17 Apr 2020 11:58:36 +0000
Subject: [PATCH] powerpc/mm: Fix CONFIG_PPC_KUAP_DEBUG on PPC32

CONFIG_PPC_KUAP_DEBUG is not selectable because it depends on PPC_32 which doesn't exists.

Fixing it leads to a deadlock due to a vital register getting clobbered in _switch().

Change dependency to PPC32 and use r0 instead of r4 in _switch()

arch/powerpc/kernel/entry_32.S +1 -1
index a6371fb8f761..8420abd4ea1c 100644
@@ -732,7 +732,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_SPE)
 	stw	r10,_CCR(r1)
 	stw	r1,KSP(r3)	/* Set old stack pointer */
 
-	kuap_check r2, r4
+	kuap_check r2, r0
 #ifdef CONFIG_SMP
 	/* We need a sync somewhere here to make sure that if the
 	 * previous task gets rescheduled on another CPU, it sees all
arch/powerpc/platforms/Kconfig.cputype +1 -1
index 0c3c1902135c..27a81c291be8 100644
@@ -397,7 +397,7 @@ config PPC_KUAP
 
 config PPC_KUAP_DEBUG
 	bool "Extra debugging for Kernel Userspace Access Protection"
-	depends on PPC_KUAP && (PPC_RADIX_MMU || PPC_32)
+	depends on PPC_KUAP && (PPC_RADIX_MMU || PPC32)
 	help
 	  Add extra debugging for Kernel Userspace Access Protection (KUAP)
 	  If you're unsure, say N.
#1 lore raw
Quoted 6 lines · On 04/27/2020 05:41 PM, [email protected] wrote:

The patch below does not apply to the 5.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

I think the easiest would be to first apply 61da50b76b62 ("powerpc/kuap: PPC_KUAP_DEBUG should depend on PPC_KUAP").

Otherwise I can backport.

Christophe