[PATCH v2 0/8] powerpc: copy_thread cleanups

Nicholas Piggin npiggin at gmail.com
Sat Mar 25 23:28:56 AEDT 2023


This series cleans up copy_thread and hopefully makes the code
easier to understand. The big changes in patch 3 and 4 which use
the switch stack instead of user int stack for restoring
fn and args parameters for the new thread.

I don't think there's any bugs fixed here because in the case of
a kernel-user thread, kthread_exec would re-populate the user int
frame with regs, so that should be okay.

Since v1, I only rejiged some changes between patches and minor
cosmetic improvements but no functional change. Tested with
32e/s 64e/s BE and LE.

Thanks,
Nick

Nicholas Piggin (8):
  powerpc: copy_thread remove unused pkey code
  powerpc: copy_thread make ret_from_fork register setup consistent
  powerpc: use switch frame for ret_from_kernel_thread parameters
  powerpc/64: ret_from_fork avoid restoring regs twice
  powerpc: copy_thread differentiate kthreads and user mode threads
  powerpc: differentiate kthread from user kernel thread start
  powerpc: copy_thread don't set _TIF_RESTOREALL
  powerpc: copy_thread don't set PPR in user interrupt frame regs

 arch/powerpc/include/asm/thread_info.h |   2 +
 arch/powerpc/kernel/entry_32.S         |  23 ++++-
 arch/powerpc/kernel/interrupt_64.S     |  28 +++++-
 arch/powerpc/kernel/process.c          | 124 ++++++++++++++-----------
 4 files changed, 113 insertions(+), 64 deletions(-)

-- 
2.37.2



More information about the Linuxppc-dev mailing list