• Andrey Vagin's avatar
    parasite: allocate stack for each thread · 294d62dd
    Andrey Vagin authored
    It will be used for executed parasite as a daemon.
    What we have previously -- the stack has been preallocated in parasite
    blob itself and bootstrap procedure calculated the value needed for %rsp.
    
    With this patch applied we provide every thread own stack as:
    
    - find out how many threads are present
    - calculate the summary size of all stacks
    - when we ask dumpee to provide us memory area needed to run
      parasite code, we pass summary size needed for everything
    - when parasite code is asked to run we calculate %rsp needed
      taking into account the thread number (ie offsets) and then
      setup proper %rsp via ptrace call, instead of calculating it
      in bootstrap parasite code
    Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
    Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
    294d62dd
parasite-syscall.h 403 Bytes