• Nicholas Piggin's avatar
    powerpc/64/syscall: Remove non-volatile GPR save optimisation · 965dd3ad
    Nicholas Piggin authored
    powerpc has an optimisation where interrupts avoid saving the
    non-volatile (or callee saved) registers to the interrupt stack frame
    if they are not required.
    
    Two problems with this are that an interrupt does not always know
    whether it will need non-volatiles; and if it does need them, they can
    only be saved from the entry-scoped asm code (because we don't control
    what the C compiler does with these registers).
    
    system calls are the most difficult: some system calls always require
    all registers (e.g., fork, to copy regs into the child). Sometimes
    registers are only required under certain conditions (e.g., tracing,
    signal delivery). These cases require ugly logic in the call
    chains (e.g., ppc_fork), and require a lot of logic to be implemented
    in asm.
    
    So remove the optimisation for system calls, and always save NVGPRs on
    entry. Modern high performance CPUs are not so sensitive, because the
    stores are dense in cache and can be hidden by other expensive work in
    the syscall path -- the null syscall selftests benchmark on POWER9 is
    not slowed (124.40ns before and 123.64ns after, i.e., within the
    noise).
    
    Other interrupts retain the NVGPR optimisation for now.
    Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
    Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
    Link: https://lore.kernel.org/r/20200225173541.1549955-24-npiggin@gmail.com
    965dd3ad
syscall.tbl 21.8 KB