Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[S390] remove reset of system call restart on psw changes

git commit 20b40a794baf3b4b "signal race with restarting system calls"
added code to the poke_user/poke_user_compat to reset the system call
restart information in the thread-info if the PSW address is changed.
The purpose of that change has been to workaround old gdbs that do
not know about the REGSET_SYSTEM_CALL. It turned out that this is not
a good idea, it makes the behaviour of the debuggee dependent on the
order of specific ptrace call, e.g. the REGSET_SYSTEM_CALL register
set needs to be written last. And the workaround does not really fix
old gdbs, inferior calls on interrupted restarting system calls do not
work either way.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

-12
-12
arch/s390/kernel/ptrace.c
··· 296 296 ((data & PSW_MASK_EA) && !(data & PSW_MASK_BA)))) 297 297 /* Invalid psw mask. */ 298 298 return -EINVAL; 299 - if (addr == (addr_t) &dummy->regs.psw.addr) 300 - /* 301 - * The debugger changed the instruction address, 302 - * reset system call restart, see signal.c:do_signal 303 - */ 304 - task_thread_info(child)->system_call = 0; 305 - 306 299 *(addr_t *)((addr_t) &task_pt_regs(child)->psw + addr) = data; 307 300 308 301 } else if (addr < (addr_t) (&dummy->regs.orig_gpr2)) { ··· 607 614 /* Transfer 31 bit amode bit to psw mask. */ 608 615 regs->psw.mask = (regs->psw.mask & ~PSW_MASK_BA) | 609 616 (__u64)(tmp & PSW32_ADDR_AMODE); 610 - /* 611 - * The debugger changed the instruction address, 612 - * reset system call restart, see signal.c:do_signal 613 - */ 614 - task_thread_info(child)->system_call = 0; 615 617 } else { 616 618 /* gpr 0-15 */ 617 619 *(__u32*)((addr_t) &regs->psw + addr*2 + 4) = tmp;