powerpc/64s: system call support for scv/rfscv instructions
authorNicholas Piggin <npiggin@gmail.com>
Thu, 11 Jun 2020 08:12:03 +0000 (18:12 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 22 Jul 2020 13:00:27 +0000 (23:00 +1000)
commit7fa95f9adaee7e5cbb195d3359741120829e488b
tree1ca2d65102ad2c5223afe9a78e3105836982479f
parentb2dc2977cba48990df45e0a96150663d4f342700
powerpc/64s: system call support for scv/rfscv instructions

Add support for the scv instruction on POWER9 and later CPUs.

For now this implements the zeroth scv vector 'scv 0', as identical to
'sc' system calls, with the exception that LR is not preserved, nor
are volatile CR registers, and error is not indicated with CR0[SO],
but by returning a negative errno.

rfscv is implemented to return from scv type system calls. It can not
be used to return from sc system calls because those are defined to
preserve LR.

getpid syscall throughput on POWER9 is improved by 26% (428 to 318
cycles), largely due to reducing mtmsr and mtspr.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
[mpe: Fix ppc64e build]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200611081203.995112-3-npiggin@gmail.com
20 files changed:
Documentation/powerpc/syscall64-abi.rst
arch/powerpc/include/asm/asm-prototypes.h
arch/powerpc/include/asm/exception-64s.h
arch/powerpc/include/asm/head-64.h
arch/powerpc/include/asm/ppc_asm.h
arch/powerpc/include/asm/ptrace.h
arch/powerpc/include/asm/setup.h
arch/powerpc/include/asm/sstep.h
arch/powerpc/kernel/cpu_setup_power.S
arch/powerpc/kernel/cputable.c
arch/powerpc/kernel/dt_cpu_ftrs.c
arch/powerpc/kernel/entry_64.S
arch/powerpc/kernel/exceptions-64s.S
arch/powerpc/kernel/process.c
arch/powerpc/kernel/setup_64.c
arch/powerpc/kernel/signal.c
arch/powerpc/kernel/syscall_64.c
arch/powerpc/lib/sstep.c
arch/powerpc/platforms/pseries/setup.c
arch/powerpc/xmon/xmon.c