[CRIU] [PATCH 00/78] compel: libcompel incarnation

Cyrill Gorcunov gorcunov at openvz.org
Mon Nov 7 08:35:45 PST 2016


Hi all, I'm pleased to announce libcompel initial rfc. From
the very beginning of criu project we've been thinking that
our infect engine might be useful not only for criu but for
side projects as well, so here is a first but I would say
a big step forward in this direction -- now our infection
engine sits in libcompel.

I should warn that all this is not yet stable enough so
we will be reworking some pieces but in general it should
stay in the form as it now.

Also of course no documentation present.
But I think everything can be seen from the code
(just +4K and -3K lines :-).

Cyrill Gorcunov (18):
  compel: Create symlink into arch dir inside uapi headers
  compel: Remove criu's int.h from infect
  compel: Use common's compiler.h
  compel: Include compel headers as system ones
  compel: Rename shipped library to libcompel.a
  compel: Add callback-based log engine
  compel: Move cpu interface to compel
  criu: Fix headers for non-x86 arches.
  criu: arch,x86 -- Use stdint in fpu
  compel: Move fpu.h into it
  compel: Build syscalls before the compel
  headers: Move lock.h into include/common/
  criu: Call compel with debug level when building blobs
  criu: Move ptrace_peeksiginfo_args into separate header
  common: lock -- Sync function proto with syscalls
  infect: Move compel_relocs_apply into engine
  compel: Move sigframe code into compel
  compel: Move in parasite engine

Pavel Emelyanov (60):
  arch: Split get_task_regs() into get_ and save_ parts
  arch: Turn save_task_regs into pointer
  seize: Split proc_status_creds into pieces
  seize: Make seize_wait_task() parse task status via callback
  scm: Move fd-sending core code AS IS into include/common/
  scm: Define __memcpy
  scm: Compile out opts management
  scm: Move scm_fdset structure into include/common
  infect: Introduce infect_ctx
  infect: Introduce flags on ictx
  infect: Place sigchild handler on ictx
  infect: Add registers keeping on infect_ctx
  infect: Keep entry point for first syscall on ictx
  infect: The big split of infection routine
  infect: Introduce skeleton for soon-to-be compel code
  infect: Move seize_catch_task -> compel_stop_task
  infect: Move seize_wait_task -> compel_wait_task
  infect: Make parasite_ctl private
  infect: Move infect() into infect.c
  infect: Move parasite_prep_ctl into infect.c
  infect: Move parasite_stop_daemon and parasite_cure_* into infect.c
  infect: Move parasite_args* into infect.c
  infect: Move parasite_execute_syscall() into infect.c
  infect: Move parasite_run_in_thread() into infect.c
  infect: Move parasite_unmap() into infect.c
  infect: Move parasite_trap() into infect.c
  infect: Move restore_thread_ctx() into infect.c
  infect: Move parasite_map_exchange() into infect.c
  infect: Move unseize_task() into infect.c
  infect: Move pie tracing code into infect.c
  infect: Move parasite RPC code into infect-rpc.c
  infect: Move seized_native() into infect.c
  infect: Move sigmask getter (from ctl) into infec.c
  infect: Introduce API to configure the infection
  infect: Introduce arch part
  infect: Move get_task_regs-s into arch/infect.c
  infect: Move mmap_seized() and syscall_seized() into arch/infect.c
  infect: Remove infect-priv.h from arch/crtools.c
  infect: Move ksigset helpers into compel
  infect: Remove parasite.h from infect.c
  infect: Move ptrace_get/set_regs() into ptrace.c
  infect: Move thread_ctx structure into infect
  infect: Remove parasite-syscall.h from infect
  infect: Move breakpoints management into infect
  infect: Move __NR32_mmap into compel headers
  infect: Reshuffle headers
  infect: Move errno.h to compel
  infect: Move processor-flags.h into compel
  infect: Remove criu util.h from infect
  infect: Remove types.h from infect.h
  infect x86: Remove kdat
  infect arm & aarch64: Remove kdat
  pie: Split parasite_daemon into pieces
  pie: Split parasite_fini into pieces
  pie: Split parasite_service into pieces
  scm: Switch compel fd plugin onto common
  pie: Detach infect
  infect: Add log_fd on ictx
  infect-rpc: Split into priv and uapi parts
  infect: Introduce and use parasite_blob_desc

 Makefile                                           |    7 +-
 Makefile.compel                                    |   38 +-
 compel/Makefile                                    |   16 +-
 compel/arch/aarch64/src/lib/cpu.c                  |   28 +
 compel/arch/aarch64/src/lib/handle-elf.c           |    1 +
 compel/arch/aarch64/src/lib/include/syscall.h      |    4 +
 .../aarch64/src/lib/include/uapi/asm/.gitignore    |    0
 .../aarch64/src/lib/include/uapi/asm/breakpoints.h |   15 +
 compel/arch/aarch64/src/lib/include/uapi/asm/cpu.h |    6 +
 .../arch/aarch64/src/lib/include/uapi}/asm/fpu.h   |    0
 .../src/lib/include/uapi}/asm/infect-types.h       |    0
 .../src/lib/include/uapi/asm/processor-flags.h     |    4 +
 .../aarch64/src/lib/include/uapi}/asm/sigframe.h   |    2 +-
 compel/arch/aarch64/src/lib/infect.c               |  111 ++
 .../arch/arm/plugins/std/syscalls/gen-syscalls.pl  |   16 +-
 compel/arch/arm/plugins/std/syscalls/syscall.def   |    4 +-
 compel/arch/arm/src/lib/cpu.c                      |   28 +
 compel/arch/arm/src/lib/handle-elf.c               |    1 +
 compel/arch/arm/src/lib/include/syscall.h          |    4 +
 .../arch/arm/src/lib/include/uapi/asm/.gitignore   |    0
 .../arm/src/lib/include/uapi/asm/breakpoints.h     |   15 +
 compel/arch/arm/src/lib/include/uapi/asm/cpu.h     |    6 +
 .../arch/arm/src/lib/include/uapi}/asm/fpu.h       |    0
 .../arm/src/lib/include/uapi}/asm/infect-types.h   |    0
 .../src/lib/include/uapi}/asm/processor-flags.h    |    0
 .../arch/arm/src/lib/include/uapi}/asm/sigframe.h  |    4 +-
 compel/arch/arm/src/lib/infect.c                   |  122 ++
 .../ppc64/plugins/std/syscalls/Makefile.syscalls   |    6 +-
 .../ppc64/plugins/std/syscalls/syscall-ppc64.tbl   |    4 +-
 compel/arch/ppc64/src/lib/cpu.c                    |   42 +
 compel/arch/ppc64/src/lib/handle-elf.c             |    1 +
 compel/arch/ppc64/src/lib/include/syscall.h        |    4 +
 .../arch/ppc64/src/lib/include/uapi/asm/.gitignore |    0
 .../ppc64/src/lib/include/uapi/asm/breakpoints.h   |   15 +
 compel/arch/ppc64/src/lib/include/uapi/asm/cpu.h   |   10 +
 .../arch/ppc64/src/lib/include/uapi}/asm/fpu.h     |    0
 .../ppc64/src/lib/include/uapi}/asm/infect-types.h |    0
 .../src/lib/include/uapi/asm/processor-flags.h     |    4 +
 .../ppc64/src/lib/include/uapi/asm/processor.h     |    4 +
 .../ppc64/src/lib/include/uapi}/asm/sigframe.h     |    2 +-
 compel/arch/ppc64/src/lib/infect.c                 |  318 +++++
 .../x86/plugins/std/syscalls/Makefile.syscalls     |   12 +-
 compel/arch/x86/plugins/std/syscalls/syscall32.c   |   24 +-
 .../arch/x86/plugins/std/syscalls/syscall_32.tbl   |    8 +-
 .../arch/x86/plugins/std/syscalls/syscall_64.tbl   |    4 +-
 compel/arch/x86/src/lib/cpu.c                      |  189 +++
 compel/arch/x86/src/lib/handle-elf.c               |    1 +
 compel/arch/x86/src/lib/include/syscall.h          |   13 +
 .../arch/x86/src/lib/include/uapi/asm/.gitignore   |    0
 .../x86/src/lib/include/uapi/asm/breakpoints.h     |    6 +
 .../arch/x86/src/lib/include/uapi}/asm/cpu.h       |   25 +-
 .../arch/x86/src/lib/include/uapi}/asm/fpu.h       |   58 +-
 .../x86/src/lib/include/uapi}/asm/infect-types.h   |    2 +-
 .../src/lib/include/uapi}/asm/processor-flags.h    |    0
 .../arch/x86/src/lib/include/uapi}/asm/sigframe.h  |    5 +-
 compel/arch/x86/src/lib/infect.c                   |  351 ++++++
 compel/include/compiler.h                          |    1 -
 {criu => compel}/include/errno.h                   |    4 +-
 compel/include/infect-priv.h                       |   59 +
 compel/include/int.h                               |    1 -
 compel/include/log.h                               |   61 +
 compel/include/piegen.h                            |   26 +-
 compel/include/rpc-pie-priv.h                      |   48 +
 compel/include/uapi/compel.h                       |   14 +
 compel/include/uapi/cpu.h                          |   14 +
 compel/include/uapi/infect-rpc.h                   |   16 +
 compel/include/uapi/infect-util.h                  |    5 +
 compel/include/uapi/infect.h                       |  147 +++
 .../signal.h => compel/include/uapi/ksigset.h      |    6 +-
 compel/include/uapi/loglevels.h                    |   13 +
 compel/include/uapi/plugins                        |    1 +
 {criu/include => compel/include/uapi}/ptrace.h     |   24 +-
 .../include/uapi}/sigframe-common.h                |    2 +-
 compel/plugins/Makefile                            |    7 +
 compel/plugins/fds/fds.c                           |   21 +-
 compel/plugins/include/uapi/plugin-fds.h           |    8 +
 compel/plugins/include/uapi/std/syscall-types.h    |   13 +-
 compel/plugins/std/std.c                           |    1 -
 compel/src/lib/handle-elf.c                        |   38 +-
 compel/src/lib/infect-rpc.c                        |  101 ++
 compel/src/lib/infect-util.c                       |   21 +
 compel/src/lib/infect.c                            | 1262 ++++++++++++++++++++
 compel/src/lib/log-host.c                          |    1 +
 compel/src/lib/log.c                               |   38 +
 compel/src/lib/ptrace.c                            |  100 ++
 compel/src/main.c                                  |   20 +-
 compel/src/shared/fds.c                            |  113 --
 criu/Makefile                                      |    6 +-
 criu/Makefile.crtools                              |    7 +-
 criu/aio.c                                         |    5 +-
 criu/arch/aarch64/Makefile                         |    4 +-
 criu/arch/aarch64/cpu.c                            |    5 -
 criu/arch/aarch64/crtools.c                        |  124 +-
 criu/arch/aarch64/include/asm/cpu.h                |    1 -
 criu/arch/aarch64/include/asm/dump.h               |    2 +-
 criu/arch/aarch64/include/asm/parasite-syscall.h   |   10 -
 criu/arch/aarch64/include/asm/processor-flags.h    |    4 -
 criu/arch/aarch64/include/asm/restorer.h           |   12 +-
 criu/arch/aarch64/include/asm/types.h              |    2 +-
 criu/arch/aarch64/restorer.c                       |    4 +-
 criu/arch/aarch64/sigframe.c                       |    2 +-
 criu/arch/aarch64/vdso-pie.c                       |    2 +-
 criu/arch/arm/Makefile                             |    4 +-
 criu/arch/arm/cpu.c                                |    5 -
 criu/arch/arm/crtools.c                            |  132 +-
 criu/arch/arm/include/asm/cpu.h                    |    1 -
 criu/arch/arm/include/asm/dump.h                   |    2 +-
 criu/arch/arm/include/asm/parasite-syscall.h       |   10 -
 criu/arch/arm/include/asm/restorer.h               |   12 +-
 criu/arch/arm/include/asm/types.h                  |    2 +-
 criu/arch/arm/restorer.c                           |    4 +-
 criu/arch/arm/sigframe.c                           |    2 +-
 criu/arch/ppc64/Makefile                           |    4 +-
 criu/arch/ppc64/cpu.c                              |   17 +-
 criu/arch/ppc64/crtools.c                          |  316 +----
 criu/arch/ppc64/include/asm/cpu.h                  |    1 -
 criu/arch/ppc64/include/asm/dump.h                 |    2 +-
 criu/arch/ppc64/include/asm/parasite-syscall.h     |   10 -
 criu/arch/ppc64/include/asm/processor-flags.h      |    4 -
 criu/arch/ppc64/include/asm/restorer.h             |   13 +-
 criu/arch/ppc64/include/asm/types.h                |    2 +-
 criu/arch/ppc64/restorer.c                         |    4 +-
 criu/arch/ppc64/vdso-pie.c                         |    2 +-
 criu/arch/x86/Makefile                             |    4 +-
 criu/arch/x86/cpu.c                                |  177 +--
 criu/arch/x86/crtools.c                            |  453 ++-----
 criu/arch/x86/include/asm/dump.h                   |    6 +-
 criu/arch/x86/include/asm/parasite-syscall.h       |   19 -
 criu/arch/x86/include/asm/restorer.h               |    6 +-
 criu/arch/x86/include/asm/types.h                  |    2 +-
 criu/arch/x86/restorer.c                           |    4 +-
 criu/arch/x86/sigaction_compat.c                   |    4 +-
 criu/arch/x86/sys-exec-tbl.c                       |    3 +-
 criu/arch/x86/vdso-pie.c                           |    2 +-
 criu/cr-check.c                                    |    3 +-
 criu/cr-dump.c                                     |   28 +-
 criu/cr-exec.c                                     |   20 +-
 criu/cr-restore.c                                  |   17 +-
 criu/files.c                                       |    2 +-
 criu/fsnotify.c                                    |    4 +-
 criu/include/cpu.h                                 |    3 +-
 criu/include/files.h                               |    2 +-
 criu/include/infect-pie.h                          |    7 +
 criu/include/kerndat.h                             |    2 +
 criu/include/parasite-syscall.h                    |   88 +-
 criu/include/parasite.h                            |   59 +-
 criu/include/proc_parse.h                          |   11 +-
 criu/include/ptrace-compat.h                       |   18 +
 criu/include/restorer.h                            |    4 +-
 criu/include/rst_info.h                            |    2 +-
 criu/include/shmem.h                               |    2 +-
 criu/include/sigframe.h                            |    2 +-
 criu/include/types.h                               |    2 +-
 criu/include/util-pie.h                            |   28 +-
 criu/kerndat.c                                     |    3 +-
 criu/log.c                                         |    2 +-
 criu/mem.c                                         |   15 +-
 criu/parasite-syscall.c                            | 1179 ++----------------
 criu/pie/Makefile                                  |    8 +-
 criu/pie/Makefile.library                          |    4 +-
 criu/pie/compat/infect-compat.c                    |    1 +
 criu/pie/infect.c                                  |  221 ++++
 criu/pie/log-simple.c                              |    2 +-
 criu/pie/parasite-vdso.c                           |    2 +-
 criu/pie/parasite.c                                |  289 +----
 criu/pie/pie-relocs.c                              |   49 -
 criu/pie/pie-relocs.h                              |    6 +-
 criu/pie/restorer.c                                |    5 +-
 criu/pie/util-fd.c                                 |  151 +--
 criu/pie/util.c                                    |    2 +-
 criu/proc_parse.c                                  |   17 +-
 criu/pstree.c                                      |    2 +-
 criu/ptrace.c                                      |  313 -----
 criu/seccomp.c                                     |    4 +-
 criu/seize.c                                       |   30 +-
 criu/shmem.c                                       |    2 +-
 criu/uffd.c                                        |    4 +-
 criu/vdso.c                                        |    7 +-
 {criu/include => include/common}/lock.h            |   14 +-
 include/common/scm-code.c                          |  167 +++
 include/common/scm.h                               |   44 +
 181 files changed, 4351 insertions(+), 3641 deletions(-)
 create mode 100644 compel/arch/aarch64/src/lib/cpu.c
 create mode 100644 compel/arch/aarch64/src/lib/include/syscall.h
 create mode 100644 compel/arch/aarch64/src/lib/include/uapi/asm/.gitignore
 create mode 100644 compel/arch/aarch64/src/lib/include/uapi/asm/breakpoints.h
 create mode 100644 compel/arch/aarch64/src/lib/include/uapi/asm/cpu.h
 rename {criu/arch/ppc64/include => compel/arch/aarch64/src/lib/include/uapi}/asm/fpu.h (100%)
 rename {criu/arch/aarch64/include => compel/arch/aarch64/src/lib/include/uapi}/asm/infect-types.h (100%)
 create mode 100644 compel/arch/aarch64/src/lib/include/uapi/asm/processor-flags.h
 rename {criu/arch/aarch64/include => compel/arch/aarch64/src/lib/include/uapi}/asm/sigframe.h (97%)
 create mode 100644 compel/arch/aarch64/src/lib/infect.c
 create mode 100644 compel/arch/arm/src/lib/cpu.c
 create mode 100644 compel/arch/arm/src/lib/include/syscall.h
 create mode 100644 compel/arch/arm/src/lib/include/uapi/asm/.gitignore
 create mode 100644 compel/arch/arm/src/lib/include/uapi/asm/breakpoints.h
 create mode 100644 compel/arch/arm/src/lib/include/uapi/asm/cpu.h
 rename {criu/arch/arm/include => compel/arch/arm/src/lib/include/uapi}/asm/fpu.h (100%)
 rename {criu/arch/arm/include => compel/arch/arm/src/lib/include/uapi}/asm/infect-types.h (100%)
 rename {criu/arch/arm/include => compel/arch/arm/src/lib/include/uapi}/asm/processor-flags.h (100%)
 rename {criu/arch/arm/include => compel/arch/arm/src/lib/include/uapi}/asm/sigframe.h (96%)
 create mode 100644 compel/arch/arm/src/lib/infect.c
 create mode 100644 compel/arch/ppc64/src/lib/cpu.c
 create mode 100644 compel/arch/ppc64/src/lib/include/syscall.h
 create mode 100644 compel/arch/ppc64/src/lib/include/uapi/asm/.gitignore
 create mode 100644 compel/arch/ppc64/src/lib/include/uapi/asm/breakpoints.h
 create mode 100644 compel/arch/ppc64/src/lib/include/uapi/asm/cpu.h
 rename {criu/arch/aarch64/include => compel/arch/ppc64/src/lib/include/uapi}/asm/fpu.h (100%)
 rename {criu/arch/ppc64/include => compel/arch/ppc64/src/lib/include/uapi}/asm/infect-types.h (100%)
 create mode 100644 compel/arch/ppc64/src/lib/include/uapi/asm/processor-flags.h
 create mode 100644 compel/arch/ppc64/src/lib/include/uapi/asm/processor.h
 rename {criu/arch/ppc64/include => compel/arch/ppc64/src/lib/include/uapi}/asm/sigframe.h (98%)
 create mode 100644 compel/arch/ppc64/src/lib/infect.c
 create mode 100644 compel/arch/x86/src/lib/cpu.c
 create mode 100644 compel/arch/x86/src/lib/include/syscall.h
 create mode 100644 compel/arch/x86/src/lib/include/uapi/asm/.gitignore
 create mode 100644 compel/arch/x86/src/lib/include/uapi/asm/breakpoints.h
 rename {criu/arch/x86/include => compel/arch/x86/src/lib/include/uapi}/asm/cpu.h (95%)
 rename {criu/arch/x86/include => compel/arch/x86/src/lib/include/uapi}/asm/fpu.h (56%)
 rename {criu/arch/x86/include => compel/arch/x86/src/lib/include/uapi}/asm/infect-types.h (98%)
 rename {criu/arch/x86/include => compel/arch/x86/src/lib/include/uapi}/asm/processor-flags.h (100%)
 rename {criu/arch/x86/include => compel/arch/x86/src/lib/include/uapi}/asm/sigframe.h (98%)
 create mode 100644 compel/arch/x86/src/lib/infect.c
 delete mode 120000 compel/include/compiler.h
 rename {criu => compel}/include/errno.h (72%)
 create mode 100644 compel/include/infect-priv.h
 delete mode 120000 compel/include/int.h
 create mode 100644 compel/include/log.h
 create mode 100644 compel/include/rpc-pie-priv.h
 create mode 100644 compel/include/uapi/cpu.h
 create mode 100644 compel/include/uapi/infect-rpc.h
 create mode 100644 compel/include/uapi/infect-util.h
 create mode 100644 compel/include/uapi/infect.h
 rename criu/include/signal.h => compel/include/uapi/ksigset.h (78%)
 create mode 100644 compel/include/uapi/loglevels.h
 create mode 120000 compel/include/uapi/plugins
 rename {criu/include => compel/include/uapi}/ptrace.h (76%)
 rename {criu/include => compel/include/uapi}/sigframe-common.h (96%)
 create mode 100644 compel/src/lib/infect-rpc.c
 create mode 100644 compel/src/lib/infect-util.c
 create mode 100644 compel/src/lib/infect.c
 create mode 120000 compel/src/lib/log-host.c
 create mode 100644 compel/src/lib/log.c
 create mode 100644 compel/src/lib/ptrace.c
 delete mode 100644 compel/src/shared/fds.c
 delete mode 100644 criu/arch/aarch64/include/asm/cpu.h
 delete mode 100644 criu/arch/aarch64/include/asm/processor-flags.h
 delete mode 100644 criu/arch/arm/include/asm/cpu.h
 delete mode 100644 criu/arch/ppc64/include/asm/cpu.h
 delete mode 100644 criu/arch/ppc64/include/asm/processor-flags.h
 create mode 100644 criu/include/infect-pie.h
 create mode 100644 criu/include/ptrace-compat.h
 create mode 120000 criu/pie/compat/infect-compat.c
 create mode 100644 criu/pie/infect.c
 delete mode 100644 criu/pie/pie-relocs.c
 delete mode 100644 criu/ptrace.c
 rename {criu/include => include/common}/lock.h (92%)
 create mode 100644 include/common/scm-code.c
 create mode 100644 include/common/scm.h

-- 
2.7.4



More information about the CRIU mailing list