• Paolo \'Blaisorblade\' Giarrusso's avatar
    [PATCH] uml: fix sysemu test at startup · b9232fc4
    Paolo \'Blaisorblade\' Giarrusso authored
    From: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it>
          Bodo Stroesser <bodo.stroesser@fujitsu-siemens.com>
          Jeff Dike <jdike@addtoit.com>
    
    Currently, the test for the SYSEMU support on the host is completely wrong, as
    Bodo noticed.  We should change the syscall result (inserting the host pid)
    and check if it is received correctly by the guest.  What we actually do,
    without this patch, is to overwrite the syscall number.
    
    This went unnoticed because we only check that the getpid() syscall from the
    child does not return its pid.  We don't check that it returns the correct
    value.
    
    Also, override the result portably, using the PT_SYSCALL_RET_OFFSET macro
    which abstract away the host stack frame layout (took from Jeff Dike code).
    Signed-off-by: default avatarPaolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    b9232fc4
process.c 8.63 KB