Skip to content
  • Bodo Stroesser's avatar
    [PATCH] s390: uml ptrace fixes · c5c3a6d8
    Bodo Stroesser authored
    
    
    To make UML build and run on s390, I needed to do these two little
    changes:
    
    1) UML includes some of the subarch's (s390) headers. I had to
       change one of them with the following one-liner, to make this
       compile. AFAICS, this change doesn't break compilation of s390
       itself.
    
    2) UML needs to intercept syscalls via ptrace to invalidate the syscall,
       read syscall's parameters and write the result with the result of
       UML's syscall processing. Also, UML needs to make sure, that the host
       does no syscall restart processing. On i386 for example, this can be
       done by writing -1 to orig_eax on the 2nd syscall interception
       (orig_eax is the syscall number, which after the interception is used
       as a "interrupt was a syscall" flag only.
       Unfortunately, s390 holds syscall number and syscall result in gpr2 and
       its "interrupt was a syscall" flag (trap) is unreachable via ptrace.
       So I changed the host to set trap to -1, if the syscall number is changed
       to an invalid value on the first syscall interception.
    
    Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    c5c3a6d8