1
0
Fork 0
alistair23-linux/arch/xtensa/include/asm
Linus Torvalds 8f6ccf6159 clone3-v5.3
-----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQRAhzRXHqcMeLMyaSiRxhvAZXjcogUCXSMhhgAKCRCRxhvAZXjc
 or7kAP9VzDcQaK/WoDd2ezh2C7Wh5hNy9z/qJVCa6Tb+N+g1UgEAxbhFUg55uGOA
 JNf7fGar5JF5hBMIXR+NqOi1/sb4swg=
 =ELWo
 -----END PGP SIGNATURE-----

Merge tag 'clone3-v5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux

Pull clone3 system call from Christian Brauner:
 "This adds the clone3 syscall which is an extensible successor to clone
  after we snagged the last flag with CLONE_PIDFD during the 5.2 merge
  window for clone(). It cleanly supports all of the flags from clone()
  and thus all legacy workloads.

  There are few user visible differences between clone3 and clone.
  First, CLONE_DETACHED will cause EINVAL with clone3 so we can reuse
  this flag. Second, the CSIGNAL flag is deprecated and will cause
  EINVAL to be reported. It is superseeded by a dedicated "exit_signal"
  argument in struct clone_args thus freeing up even more flags. And
  third, clone3 gives CLONE_PIDFD a dedicated return argument in struct
  clone_args instead of abusing CLONE_PARENT_SETTID's parent_tidptr
  argument.

  The clone3 uapi is designed to be easy to handle on 32- and 64 bit:

    /* uapi */
    struct clone_args {
            __aligned_u64 flags;
            __aligned_u64 pidfd;
            __aligned_u64 child_tid;
            __aligned_u64 parent_tid;
            __aligned_u64 exit_signal;
            __aligned_u64 stack;
            __aligned_u64 stack_size;
            __aligned_u64 tls;
    };

  and a separate kernel struct is used that uses proper kernel typing:

    /* kernel internal */
    struct kernel_clone_args {
            u64 flags;
            int __user *pidfd;
            int __user *child_tid;
            int __user *parent_tid;
            int exit_signal;
            unsigned long stack;
            unsigned long stack_size;
            unsigned long tls;
    };

  The system call comes with a size argument which enables the kernel to
  detect what version of clone_args userspace is passing in. clone3
  validates that any additional bytes a given kernel does not know about
  are set to zero and that the size never exceeds a page.

  A nice feature is that this patchset allowed us to cleanup and
  simplify various core kernel codepaths in kernel/fork.c by making the
  internal _do_fork() function take struct kernel_clone_args even for
  legacy clone().

  This patch also unblocks the time namespace patchset which wants to
  introduce a new CLONE_TIMENS flag.

  Note, that clone3 has only been wired up for x86{_32,64}, arm{64}, and
  xtensa. These were the architectures that did not require special
  massaging.

  Other architectures treat fork-like system calls individually and
  after some back and forth neither Arnd nor I felt confident that we
  dared to add clone3 unconditionally to all architectures. We agreed to
  leave this up to individual architecture maintainers. This is why
  there's an additional patch that introduces __ARCH_WANT_SYS_CLONE3
  which any architecture can set once it has implemented support for
  clone3. The patch also adds a cond_syscall(clone3) for architectures
  such as nios2 or h8300 that generate their syscall table by simply
  including asm-generic/unistd.h. The hope is to get rid of
  __ARCH_WANT_SYS_CLONE3 and cond_syscall() rather soon"

* tag 'clone3-v5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux:
  arch: handle arches who do not yet define clone3
  arch: wire-up clone3() syscall
  fork: add clone3
2019-07-11 10:09:44 -07:00
..
Kbuild treewide: Add SPDX license identifier - Kbuild 2019-05-30 11:32:33 -07:00
asm-offsets.h kbuild: move asm-offsets.h to include/generated 2009-12-12 13:08:14 +01:00
asm-uaccess.h get rid of legacy 'get_ds()' function 2019-03-04 10:50:14 -08:00
asmmacro.h xtensa: replace variant/core.h with asm/core.h 2019-05-06 17:48:55 -07:00
atomic.h xtensa: add exclusive atomics support 2019-05-07 10:36:31 -07:00
barrier.h xtensa: add exclusive atomics support 2019-05-07 10:36:31 -07:00
bitops.h xtensa: add exclusive atomics support 2019-05-07 10:36:31 -07:00
bootparam.h xtensa: split bootparam and kernel meminfo 2014-04-02 01:35:51 +04:00
bugs.h
cache.h xtensa: replace variant/core.h with asm/core.h 2019-05-06 17:48:55 -07:00
cacheasm.h xtensa: increase ranges in ___invalidate_{i,d}cache_all 2018-08-13 20:08:01 -07:00
cacheflush.h docs: Fix some broken references 2018-06-15 18:10:01 -03:00
checksum.h xtensa: replace variant/core.h with asm/core.h 2019-05-06 17:48:55 -07:00
cmpxchg.h xtensa: add exclusive atomics support 2019-05-07 10:36:31 -07:00
coprocessor.h xtensa: replace variant/core.h with asm/core.h 2019-05-06 17:48:55 -07:00
core.h xtensa: implement initialize_cacheattr for MPU cores 2019-05-07 10:36:34 -07:00
current.h xtensa: consolidate kernel stack size related definitions 2017-12-10 14:48:55 -08:00
delay.h xtensa: implement ndelay 2014-01-15 00:28:11 +04:00
dma.h Fix common misspellings 2011-03-31 11:26:23 -03:00
elf.h xtensa: enable CORE_DUMP_USE_REGSET 2018-12-17 13:48:22 -08:00
fixmap.h xtensa: move fixmap and kmap just above the KSEG 2017-12-16 22:37:12 -08:00
flat.h binfmt_flat: remove the persistent argument from flat_get_addr_from_rp 2019-06-24 09:16:47 +10:00
ftrace.h ftrace: Make CALLER_ADDRx macros more generic 2014-05-21 03:10:32 -04:00
futex.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
highmem.h xtensa: move fixmap and kmap just above the KSEG 2017-12-16 22:37:12 -08:00
hw_breakpoint.h perf/hw_breakpoint: Remove default hw_breakpoint_arch_parse() 2018-06-26 09:07:58 +02:00
hw_irq.h
initialize_mmu.h xtensa: implement initialize_cacheattr for MPU cores 2019-05-07 10:36:34 -07:00
io.h xtensa: drop ifdef __KERNEL__ from kernel-only headers 2019-05-06 17:48:54 -07:00
irq.h xtensa: replace variant/core.h with asm/core.h 2019-05-06 17:48:55 -07:00
irqflags.h xtensa: replace CONFIG_DEBUG_KERNEL with CONFIG_DEBUG_MISC 2019-05-14 19:52:50 -07:00
jump_label.h xtensa: implement jump_label support 2018-12-20 14:44:38 -08:00
kasan.h xtensa: fix build with KASAN 2018-02-11 09:18:12 -08:00
kmem_layout.h xtensa: platform-specific handling of coherent memory 2018-07-11 15:59:41 -07:00
linkage.h xtensa: clean up functions in assembly code 2017-12-10 14:48:54 -08:00
mmu.h xtensa: add SMP support 2014-01-14 10:19:58 -08:00
mmu_context.h xtensa: extract init_kio 2017-12-16 22:37:10 -08:00
module.h Make most arch asm/module.h files use asm-generic/module.h 2012-09-28 14:31:03 +09:30
mxregs.h xtensa: add MX irqchip 2014-01-14 10:19:58 -08:00
nommu_context.h xtensa: extract init_kio 2017-12-16 22:37:10 -08:00
page.h xtensa: rework {CONFIG,PLATFORM}_DEFAULT_MEM_START 2018-08-20 12:28:03 -07:00
pci-bridge.h xtensa: drop ifdef __KERNEL__ from kernel-only headers 2019-05-06 17:48:54 -07:00
pci.h xtensa: drop ifdef __KERNEL__ from kernel-only headers 2019-05-06 17:48:54 -07:00
perf_event.h xtensa: enable HAVE_PERF_EVENTS 2014-01-15 00:27:03 +04:00
pgalloc.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
pgtable.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
platform.h xtensa: platform-specific handling of coherent memory 2018-07-11 15:59:41 -07:00
processor.h xtensa: replace variant/core.h with asm/core.h 2019-05-06 17:48:55 -07:00
ptrace.h xtensa: replace variant/core.h with asm/core.h 2019-05-06 17:48:55 -07:00
regs.h xtensa: clean up exception handling structure 2017-12-16 22:37:09 -08:00
serial.h
shmparam.h
signal.h consolidate kernel-side struct sigaction declarations 2013-02-03 15:09:22 -05:00
smp.h xtensa: implement CPU hotplug 2014-01-14 10:19:59 -08:00
spinlock.h xtensa: use generic spinlock/rwlock implementation 2019-02-07 12:24:20 -08:00
spinlock_types.h xtensa: use generic spinlock/rwlock implementation 2019-02-07 12:24:20 -08:00
stackprotector.h xtensa: enable stack protector 2017-12-16 22:37:07 -08:00
stacktrace.h xtensa: move oprofile stack tracing to stacktrace.c 2015-08-17 07:32:49 +03:00
string.h xtensa: shut up gcc-8 warnings 2018-01-02 03:25:41 -08:00
switch_to.h Disintegrate asm/system.h for Xtensa 2012-03-28 18:30:03 +01:00
syscall.h audit/stable-5.2 PR 20190507 2019-05-07 19:06:04 -07:00
sysmem.h xtensa: drop sysmem and switch to memblock 2016-07-24 06:34:00 +03:00
thread_info.h xtensa: drop unused definitions 2019-02-07 12:35:02 -08:00
timex.h xtensa: clean up WSR*/RSR*/get_sr/set_sr 2018-12-04 14:08:11 -08:00
tlb.h arch/tlb: Clean up simple architectures 2019-04-03 10:32:54 +02:00
tlbflush.h xtensa: optimize local_flush_tlb_kernel_range 2014-04-06 21:29:17 +04:00
traps.h xtensa: drop unused field from the struct exc_table 2018-12-03 01:39:22 -08:00
types.h UAPI: (Scripted) Disintegrate arch/xtensa/include/asm 2012-10-15 21:48:53 -07:00
uaccess.h get rid of legacy 'get_ds()' function 2019-03-04 10:50:14 -08:00
ucontext.h
unaligned.h
unistd.h arch: handle arches who do not yet define clone3 2019-06-21 01:54:53 +02:00
user.h
vectors.h xtensa: replace variant/core.h with asm/core.h 2019-05-06 17:48:55 -07:00