Skip to content
  • Jonas Bonn's avatar
    openrisc: restore all regs on rt_sigreturn · c7990219
    Jonas Bonn authored
    
    
    Fix signal handling for when signals are handled as the result of timers
    or exceptions, previous code assumed syscalls. This was noticeable with X
    crashing where it uses SIGALRM.
    
    This patch restores all regs before returning to userspace via
    _resume_userspace instead of via syscall return path.
    
    The rt_sigreturn syscall is more like a context switch than a function
    call; it entails a return from one context (the signal handler) to another
    (the process in question).  For a context switch like this there are
    effectively no call-saved regs that remain constant across the transition.
    
    Reported-by: default avatarSebastian Macke <sebastian@macke.de>
    Signed-off-by: default avatarJonas Bonn <jonas@southpole.se>
    Tested-by: default avatarGuenter Roeck <linux@roeck-us.net>
    [shorne@gmail.com: Updated comment better reflect change and issue]
    Signed-off-by: default avatarStafford Horne <shorne@gmail.com>
    c7990219