Skip to content

RFC prctl: Modernise wiring for optional prctl() calls

Dave Martin linux-arch lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest11 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11prctl: Support movement of arch prctls out of common codearch/Kconfig include/linux/prctl.h include/uapi/linux/prctl.h +2 more+29 -71 reply
2/11arm64: Move arch-specific prctls out of core codearch/arm64/Kconfig arch/arm64/include/asm/processor.h arch/arm64/kernel/sys.c +1 more+16 -161 reply
3/11MIPS: Remove unused task argument from prctl functionsarch/mips/include/asm/processor.h arch/mips/kernel/process.c arch/mips/kernel/syscall.c +1 more+18 -180 replies
4/11MIPS: Move arch-specific prctls out of core codearch/mips/Kconfig arch/mips/include/asm/processor.h arch/mips/kernel/syscall.c +1 more+15 -150 replies
5/11x86: Move arch-specific prctls out of core codearch/x86/Kconfig arch/x86/include/asm/processor.h arch/x86/kernel/Makefile +2 more+28 -340 replies
6/11powerpc: Remove unused task argument from prctl functionsarch/powerpc/include/asm/processor.h arch/powerpc/kernel/process.c kernel/sys.c+29 -291 reply
7/11powerpc: Move arch-specific prctls out of core codearch/powerpc/Kconfig arch/powerpc/include/asm/processor.h arch/powerpc/kernel/syscalls.c +1 more+18 -301 reply
8/11ia64: Remove unused task argument from prctl functionsarch/ia64/include/asm/processor.h kernel/sys.c+8 -80 replies
9/11ia64: Move arch-specific prctls out of core codearch/ia64/Kconfig arch/ia64/include/asm/processor.h arch/ia64/kernel/sys_ia64.c +1 more+23 -240 replies
10/11prctl: Remove redundant task argument from PR_{SET,GET}_UNALIGN backendsarch/alpha/include/asm/thread_info.h arch/ia64/include/asm/processor.h arch/parisc/include/asm/processor.h +5 more+34 -340 replies
11/11prctl: Refactor PR_{SET,GET}_UNALIGN to reduce boilerplatearch/Kconfig arch/alpha/Kconfig arch/alpha/include/asm/thread_info.h +16 more+100 -800 replies

Reviews trailers per patch

4 of 11 patches have a Reviewed-by or Acked-by.

PatchMichael EllermanWill Deacon
1/11A-b
2/11A-b
3/11
4/11
5/11
6/11A-b
7/11A-b
8/11
9/11
10/11
11/11

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [RFC PATCH 00/11] prctl: Modernise wiring for optional prctl() calls

[Reviewer note: this is a cross-arch series. To reduce spam, I have tried not to Cc people on patches they aren't likely to care about. The complete series can be found in the LKML or linux-arch archives.]

The core framework for the prctl() syscall is unloved and looking rather crusty these days. It also relies on defining ancillary boilerplate macros for each prctl() in order to control conditional compilation of the different prctl calls. We have better ways to do this now.

This series attempts to modernise the code by defining a couple of new Kconfig variables HAVE_PRCTL_ARCH and HAVE_ARCH_PR_SET_GET_UNALIGN to allow architectures to provide hooks for arch-dependent prctls.

For now this series has had minimal testing: some basic testing of arch-specific prctls using PR_SVE_SET_VL on arm64; build-tested on x86; otherwise untested.

This is not polished yet... but I'm interested to know what people think about the approach.

Cheers
---Dave

Dave Martin (11):
prctl: Support movement of arch prctls out of common code
arm64: Move arch-specific prctls out of core code
MIPS: Remove unused task argument from prctl functions
MIPS: Move arch-specific prctls out of core code
x86: Move arch-specific prctls out of core code
powerpc: Remove unused task argument from prctl functions
powerpc: Move arch-specific prctls out of core code
ia64: Remove unused task argument from prctl functions
ia64: Move arch-specific prctls out of core code
prctl: Remove redundant task argument from PR_{SET,GET}_UNALIGN
backends
prctl: Refactor PR_{SET,GET}_UNALIGN to reduce boilerplate

 arch/Kconfig                         |   6 ++
 arch/alpha/Kconfig                   |   1 +
 arch/alpha/include/asm/thread_info.h |  23 --------
 arch/alpha/kernel/Makefile           |   2 +-
 arch/alpha/kernel/sys.c              |  36 ++++++++++++
 arch/arm64/Kconfig                   |   1 +
 arch/arm64/include/asm/processor.h   |   4 --
 arch/arm64/kernel/sys.c              |  15 +++++
 arch/ia64/Kconfig                    |   2 +
 arch/ia64/include/asm/processor.h    |  24 --------
 arch/ia64/kernel/sys_ia64.c          |  37 ++++++++++++
 arch/mips/Kconfig                    |   1 +
 arch/mips/include/asm/processor.h    |   3 -
 arch/mips/kernel/process.c           |  23 ++++----
 arch/mips/kernel/syscall.c           |  15 +++++
 arch/parisc/Kconfig                  |   1 +
 arch/parisc/include/asm/processor.h  |  14 -----
 arch/parisc/kernel/sys_parisc.c      |  15 +++++
 arch/powerpc/Kconfig                 |   2 +
 arch/powerpc/include/asm/processor.h |  20 ++-----
 arch/powerpc/kernel/process.c        |  38 ++++++------
 arch/powerpc/kernel/syscalls.c       |  17 ++++++
 arch/sh/Kconfig                      |   1 +
 arch/sh/include/asm/processor.h      |   7 ---
 arch/sh/mm/alignment.c               |  12 ++--
 arch/x86/Kconfig                     |   1 +
 arch/x86/include/asm/processor.h     |   6 --
 arch/x86/kernel/Makefile             |   1 +
 arch/x86/kernel/sys.c                |  26 +++++++++
 include/linux/prctl.h                |  27 +++++++++
 include/uapi/linux/prctl.h           |   6 +-
 kernel/sys.c                         | 110 ++++-------------------------------
 tools/include/uapi/linux/prctl.h     |   6 +-
 33 files changed, 263 insertions(+), 240 deletions(-)
 create mode 100644 arch/alpha/kernel/sys.c
 create mode 100644 arch/x86/kernel/sys.c
 create mode 100644 include/linux/prctl.h
Signature · 1 line
2.1.4