The result is embarrassingly simple: the BUG_ON is wrong, and we simply
need to pass restarted syscalls through __ipipe_syscall_root.
diff --git a/arch/arm/kernel/entry-
common.S b/arch/arm/kernel/entry-common.S
index 68a80d3..8f29cb1 100644
--- a/arch/arm/kernel/entry-common.S
+++ b/arch/arm/kernel/entry-common.S
@@ -446,6 +446,7 @@ ENTRY(vector_swi)
eor scno, scno, #__NR_SYSCALL_BASE @ check OS number
#endif
+local_restart:
#ifdef CONFIG_IPIPE
mov r1, sp
mov r0, scno
@@ -457,7 +458,6 @@ ENTRY(vector_swi)
ldmia sp, { r0 - r3 }
#endif / CONFIG_IPIPE /
-local_restart:
ldr r10, [tsk, #TI_FLAGS] @ check for syscall tracing
stmdb sp!, {r4, r5} @ push fifth and sixth args
diff --git a/arch/arm/kernel/ipipe.c b/arch/arm/kernel/ipipe.c
index abdbe29..3a2266c 100644
--- a/arch/arm/kernel/ipipe.c
+++ b/arch/arm/kernel/ipipe.c
@@ -440,10 +440,6 @@ asmlinkage int __ipipe_syscall_root(unsigned long scno, struct pt_regs *regs)
fast_irq_enable(flags);
out:
-#ifdef CONFIG_IPIPE_DEBUG_INTERNAL
- BUG_ON(ret > 0 && current_thread_info()->restart_block.fn !=
- do_no_restart_syscall);
-#endif
return ret;
}