summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/process.c
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2023-03-25 13:28:57 +0100
committerMichael Ellerman <mpe@ellerman.id.au>2023-04-11 15:13:32 +0200
commitc013e9f2bbe1d2be5e1c7f4a84216cd10837f20d (patch)
tree97ce003c52b499a85bc3f804cfad2ee552756609 /arch/powerpc/kernel/process.c
parentpowerpc/64: Always build with 128-bit long double (diff)
downloadlinux-c013e9f2bbe1d2be5e1c7f4a84216cd10837f20d.tar.xz
linux-c013e9f2bbe1d2be5e1c7f4a84216cd10837f20d.zip
powerpc: copy_thread remove unused pkey code
The pkey registers (AMR, IAMR) do not get loaded from the switch frame so it is pointless to save anything there. Remove the dead code. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20230325122904.2375060-2-npiggin@gmail.com
Diffstat (limited to 'arch/powerpc/kernel/process.c')
-rw-r--r--arch/powerpc/kernel/process.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index a7f9f3f85e20..7fe700309151 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -1813,6 +1813,7 @@ int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
sp -= STACK_SWITCH_FRAME_SIZE;
((unsigned long *)sp)[0] = sp + STACK_SWITCH_FRAME_SIZE;
kregs = (struct pt_regs *)(sp + STACK_SWITCH_FRAME_REGS);
+ kregs->nip = ppc_function_entry(f);
p->thread.ksp = sp;
#ifdef CONFIG_HAVE_HW_BREAKPOINT
@@ -1845,17 +1846,6 @@ int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
p->thread.tidr = 0;
#endif
- /*
- * Run with the current AMR value of the kernel
- */
-#ifdef CONFIG_PPC_PKEY
- if (mmu_has_feature(MMU_FTR_BOOK3S_KUAP))
- kregs->amr = AMR_KUAP_BLOCKED;
-
- if (mmu_has_feature(MMU_FTR_BOOK3S_KUEP))
- kregs->iamr = AMR_KUEP_BLOCKED;
-#endif
- kregs->nip = ppc_function_entry(f);
return 0;
}