sparc: Fix handling of orig_i0 wrt. debugging when restarting syscalls.
commit2a89fc8b91abf1ba56daa23b05e6572b30331837
authorDavid S. Miller <davem@davemloft.net>
Mon, 26 Dec 2011 17:30:13 +0000 (26 12:30 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 6 Jan 2012 22:14:05 +0000 (6 14:14 -0800)
tree39bb67a7a1075e7f8032b76c1295880a48382d06
parentd4afed4d20e91a12de7cd1c64bb3451ee2236d19
sparc: Fix handling of orig_i0 wrt. debugging when restarting syscalls.

[ A combination of upstream commits 1d299bc7732c34d85bd43ac1a8745f5a2fed2078 and
  e88d2468718b0789b4c33da2f7e1cef2a1eee279 ]

Although we provide a proper way for a debugger to control whether
syscall restart occurs, we run into problems because orig_i0 is not
saved and restored properly.

Luckily we can solve this problem without having to make debuggers
aware of the issue.  Across system calls, several registers are
considered volatile and can be safely clobbered.

Therefore we use the pt_regs save area of one of those registers, %g6,
as a place to save and restore orig_i0.

Debuggers transparently will do the right thing because they save and
restore this register already.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/sparc/kernel/signal32.c
arch/sparc/kernel/signal_32.c
arch/sparc/kernel/signal_64.c