2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-27 20:37:57 +00:00

65 Commits

Author SHA1 Message Date
Cyrill Gorcunov
f3f4dda5f3 compel: cpu -- Add ability to clear features
Will need them to mask some of the features from
command line options.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-18 21:08:15 +03:00
Cyrill Gorcunov
d14734e106 x86: cpu -- Sync bits with kernel
Tracking cpuid features is easier when sync'ed with kernel
source code. Note though that while in kernel feature bits
are not part of ABI, we're saving bits into an image so
as result make sure they are posted in proper place together
with keeping in mind the backward compatibility issue.

Here we also start using v2 of cpuinfo image with more
feature bits.

Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-18 21:07:05 +03:00
Cyrill Gorcunov
4bc286d0e5 x86: Use uint_x types in rt_sigcontext
To be close to the kernel code.

Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-06-18 21:06:45 +03:00
Dmitry Safonov
4af0bb721d compel: Explicitely align all containers of i387_fxsave_struct
As it's aligned to 16, all structures that contain it should be
also aligned to 16. In the kernel there is no such align as
there two separate definitions of i387_fxsave_struct:
one for ia32 and another for x86_64.
Fixes newly introduced align warning in gcc-8.1:
In file included from compel/include/uapi/compel/asm/sigframe.h:7,
                 from compel/plugins/std/infect.c:13:
compel/include/uapi/compel/asm/fpu.h:89:1: error: alignment 1 of 'struct xsave_struct_ia32' is less than 16 [-Werror=packed-not-aligned]
 } __packed;
 ^

It doesn't change the current align of the struct, as containing
structures are __packed and it aligned already *by fact*.
It only affects the function users of the struct's local variables:
now they lay aligned on a stack.

Signed-off-by: Dmitry Safonov <dima@arista.com>
2018-02-13 10:14:42 +03:00
Dmitry Safonov
3b9091ae66 compel/x86: Add workaround on ptrace() bug on Skylake
On Skylake processors and kernel older than v4.14
    ptrace(PTRACE_GETREGSET, pid, NT_X86_XSTATE, iov)
may return not full xstate, ommiting FP part (that is XFEATURE_MASK_FP).
There is a patch which describes this bug:
  https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1318800.html
Anyway, it's fixed in v4.14 kernel by (what we believe with Andrey) this:
  https://patchwork.kernel.org/patch/9567939/

As we still support kernels from v3.10 and newer, we need to have a
workaround for this kernel bug on Skylake CPUs.

Big thanks to Shlomi for the reports, the effort and for providing an
Amazon VM to test this. I wish more bug reporters were like you.

Reported-by: Shlomi Matichin <shlomi@binaris.com>
Provided-test-env: Shlomi Matichin <shlomi@binaris.com>
Investigated-with: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Dmitry Safonov <dima@arista.com>
2018-02-13 10:14:42 +03:00
Dmitry Safonov
df18ed2f89 compel/x86: Separate functions used to get fpu state
Mere cleanup. For Skylake workaround I'll call one after another,
so it's better separate it in a small helpers.

Signed-off-by: Dmitry Safonov <dima@arista.com>
2018-02-13 10:14:42 +03:00
Dmitry Safonov
70b67e3383 compel: Add ctx flags to get_task_regs()
get_task_regs() needs to know if it needs to use workaround
for a Skylake ptrace() bug. The next patch will introduce a
new flag for that.
I also thought about making 3 versions of get_task_regs() and
adding them to ictx->get_task_regs() depending on the flags..
But get_task_regs() is a private function and infect_ctx is
a uapi.. So, let's just pass context flags to get_task_regs().

Signed-off-by: Dmitry Safonov <dima@arista.com>
2018-02-13 10:14:42 +03:00
Andrei Vagin
c1b0a849e4 syscall: fix arguments for preadv()
It has two arguments "pos_l and "pos_h" instead of one "off". It is used
to handle 64-bit offsets on 32-bit kernels.

SYSCALL_DEFINE5(preadv, unsigned long, fd, const struct iovec __user *, vec,
                unsigned long, vlen, unsigned long, pos_l, unsigned long, pos_h)

https://github.com/checkpoint-restore/criu/issues/424
Signed-off-by: Andrei Vagin <avagin@openvz.org>
Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-12-15 21:54:58 +03:00
Kirill Tkhai
8df85f8c51 compel, x86_64: Fix sys_clone() definition
Commit 37e4c7bfc264 fixed arm, ppc, x86 (32bit),
while it made wrong definition of x86_64. Fix that.

Also, add commentary to raw fork() implementation.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:29:44 +03:00
Cyrill Gorcunov
2e16cc1e4f compel: Do not loose sign of result in compat syscall
Regs are present in unsigned format so convert them
into signed first to provide results.

In particular if memfd_create syscall failed we won't
notice -ENOMEM error but rather treat it as unsigned
hex value

 | (05.303002) Putting parasite blob into 0x7f1c6ffe0000->0xfffffff4
 | (05.303234) Putting tsock into pid 42773

Signed-off-by: Cyrill Gorcunov <gorcunov@virtuozzo.com>
Reviewed-by: Dmitry Safonov <dima@arista.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-23 20:23:14 +03:00
Dmitry Safonov
b53d90692d compel: Add R_X86_64{,_REX}_GOTPCRELX relocs
Add handeling of R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX.
They are not that old, so I provided ifdef-guards for them.
According to x86-64 ABI specification paper, they should be
generated instead of R_X86_64_GOTPCREL for cases when relaxation
is possible.

At this moment we can handle them the same way like R_X86_64_GOTPCREL.

[0] https://github.com/hjl-tools/x86-psABI/wiki/x86-64-psABI-r249.pdf

Fixes: #397

Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Reported-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Dmitry Safonov <dima@arista.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-10-22 06:35:00 +03:00
Kirill Kolyshkin
20a460fabf Silence clang-4 warning about unaligned pointer
This is what we have:
> compel/src/lib/infect.c:1145:38: error: taking address of packed member
> 'uc_sigmask' of class or structure 'ucontext_ia32' may result in an
> unaligned pointer value [-Werror,-Waddress-of-packed-member]
>         blk_sigset = RT_SIGFRAME_UC_SIGMASK(f);
>                      ~~~~~~~~~~~~~~~~~~~~~~~^~
> compel/include/uapi/asm/sigframe.h:133:4: note: expanded from macro
> 'RT_SIGFRAME_UC_SIGMASK'
>         (&rt_sigframe->compat.uc.uc_sigmask))
>           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 1 error generated.

Indeed this results in an unaligned pointer, but as this is intended and
well known (see commit dd6736bd "compel/x86/compat: pack ucontext_ia32"),
we need to silence the warning here.

For more details, see https://reviews.llvm.org/D20561

Originally found by Travis on Alpine Linux, reproduced on Ubuntu 17.10.

[v2: fix for non-x86]

Reported-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-10-17 08:40:10 +03:00
Kirill Tkhai
b85b5bcad9 arch: Fix sys_clone() arguments order
The right order for all of our 4 archs is:

SYSCALL_DEFINE5(clone, unsigned long, clone_flags, unsigned long, newsp,
                 int __user *, parent_tidptr,
                 unsigned long, tls,
                 int __user *, child_tidptr)

See Linux kernel for the details.

Note, this is just a fix, and it's not connected with the second patch.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-09-21 00:45:10 +03:00
Pavel Emelyanov
aebbdbf1ef compel: Add preadv syscall
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-05-19 09:21:16 +03:00
Dmitry Safonov
58c1309aac ia32: Rename has_compat_sigreturn => compat_cr
This naming is left from the first compatible kernel patches.
At that time to return to 32-bit task rt_sigreturn was used with
a special flag.
Now it's not true anymore, the naming doesn't relate.

Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-05-10 04:13:40 +03:00
Kir Kolyshkin
9e1bde4d57 pr_err(): don't forget a newline
Unlike pr_perror(), pr_err() does not append a newline.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-04-11 08:51:50 +03:00
Kir Kolyshkin
8b99809a4e compel: make plugins .a archives
The objective is to only do parasite code linking once -- when we link
parasite objects with compel plugin(s). So, let's use ar (rather than
ld) here. This way we'll have a single ld invocation with the proper
flags (from compel ldflags) etc.

There are two tricks in doing it:

1. The order of objects while linking is important. Therefore, compel
   plugins should be the last to add to ld command line.

2. Somehow ld doesn't want to include parasite-head.o in the output
   (probably because no one else references it), so we have to force
   it in with the modification to our linker scripts.

NB: compel makefiles are still a big mess, but I'll get there.

Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-04-02 18:12:10 +03:00
Stanislav Kinsburskiy
6d8f8399ef compel: wrap rt_sigframe with parentheses
It can be passed as link to real object.

Signed-off-by: Stanislav Kinsburskiy <skinsbursky@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-04-02 18:12:10 +03:00
Cyrill Gorcunov
6e4d05853d compel: infect -- Don't forget to fetch sas early
When infecting victim we construct sigframe to
be able to self-rectore it in case if something
goes wrong. But in case is a targer been using
alternative stack for signal handling it will
be missed in sigframe since we don't fetch it.

Thus add fetching sas on infection stage and
put it into signal frame early.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-04-02 18:09:34 +03:00
Dmitry Safonov
b502d7fd6b compel: pass regs by pointer in get_task_regs()
CID 73371 (#1 of 1): Big parameter passed by value (PASS_BY_VALUE)
pass_by_value: Passing parameter regs of type user_regs_struct_t
(size 224 bytes) by value.

Suggesting to do this until compel is released and API is cut in stone.

Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 09:36:09 +03:00
Cyrill Gorcunov
51b10d6864 compel: arch, x86 -- Add support of FPU restore in ia32 compat mode
To support ia32 compat mode on x86-64 we need to things

 - extend fpu_state_t type to carry ia32 specifics
 - fill up additional members in fpu_state_ia32_t type
   before calling sigreturn (this also requires the
   uc_mcontext::fpstate won't be aligned on 32 bytes)

Because we touches base types in compel the criu
has been updated accordingly.

Acked-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Acked-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 09:36:06 +03:00
Cyrill Gorcunov
88014eb029 compel: arch, x86 -- Don't require compat frame alignment
Acked-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Acked-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 09:36:06 +03:00
Cyrill Gorcunov
b729c187d5 compel: arch,x86 -- Drop native ia32 pieces
It was never functional neither we plan to support
native ia32 mode, so drop these incomplete code
pieces out.

 - Presumably we will need TASK_SIZE for compat
   mode so I provide TASK_SIZE_IA32 for this sake

 - 32 bit syscalls are remaining for a while

Acked-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Acked-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 09:36:05 +03:00
Kir Kolyshkin
f233b86a02 compel: Move memcpy/memcpy/etc stuff in
This is the difference between two commits

	criu-dev/b0f6f293/Unify own memcpy/memset/memcmp
	  master/0367a1fe/Drop prefix from own memcpy/memset/memcmp

that makes criu-dev after rebase on master with latter commit
be the same as it was with former commit before rebase.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 09:36:05 +03:00
Kir Kolyshkin
c18aa3e7fb compel: add compel_ prefix to cpu_has_feature
travis-ci: success for compel uapi cleanups
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 09:36:05 +03:00
Kir Kolyshkin
adaa7979be compel: split sanitize ptrace.h
We have ptrace defines and functions that are part of UAPI,
and we have some internal stuff not to be exposed. Split
ptrace.h into two files accordingly.

While at it, do some cleanups:
 - add ptrace_ prefix to some functions and macros
 - remove (duplicated) PTRACE_* defines from .c files
 - rename ptrace_seccomp(), remove its duplicate
 - remove unused ptrace defines
 - remove unneeded (ptrace-related) includes

travis-ci: success for compel uapi cleanups
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 09:36:04 +03:00
Dmitry Safonov
cbde93e12e compel/x86: clang-3.4 isn't a friend to numbers in macro
It's a workaround to clang-3.4, which doesn't handle numbers
in asm macros rightly:
https://llvm.org/bugs/show_bug.cgi?id=21500

Which resulted in:
  CC       compel/arch/x86/plugins/std/parasite-head.o
<instantiation>:3:2: error: too few operands for instruction
 pushq
 ^
compel/arch/x86/plugins/std/parasite-head.S:26:2: note: while in macro instantiation
 PARASITE_ENTRY
 ^

Fixes: https://travis-ci.org/0x7f454c46/criu/jobs/186099057

travis-ci: success for 32-bit tests fixes
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 00:09:58 +03:00
Dmitry Safonov
be783a3768 compel/x86: hang in 32-bit mode on sw-break for compat tasks
Otherwise we'll try to set 32-bit register set to 64-bit task,
which is not possible with ptrace - it uses register set size,
according to processes mode. So we should set 32-bit regset
only to tasks those are in 32-bit mode already.
Please, see inline comment in the patch for more info.

travis-ci: success for 32-bit tests fixes
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 00:09:58 +03:00
Dmitry Safonov
dd6736bd24 compel/x86/compat: pack ucontext_ia32
As I've united k_rtsigset_t between native and compat ucontext's,
it's 8-bytes aligned now. We don't care about align of this as
we fill it always with memcpy()/memset(0).
So after those changes, ucontext_ia32 has received new padding
between uc_mcontext and uc_sigmask (4 bytes to align to 8-byte sized
sigmask). Because of this, mask of blocked signals was restored
with shift (wrongly).
Fixes: signalfd00, file_attr tests.

travis-ci: success for 32-bit tests fixes
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 00:09:58 +03:00
Kir Kolyshkin
1be75af874 compel_syscall(): make ret argument signed
I saw this line in the code

	unsigned long sret = -ENOSYS;

and ended up with this patch. Note syscall(2) man page says return value
is long -- who am I to disagree?

travis-ci: success for More polishing for compel cli
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 00:09:54 +03:00
Dmitry Safonov
4120f64d3d pie: fix clobber registers for int 0x80
I managed to forgot that kernel erases R8...R11 regitster
prior returning to userspace from `int 0x80`:
https://lkml.org/lkml/2009/10/1/164

That was the reason for hang on gcc v6.1 on Jenkins/elsewhere:
https://ci.openvz.org/job/CRIU/job/CRIU-x86_64/branch/criu-dev/

Tested on gcc v6.1 locally, on Travis-CI:
https://travis-ci.org/0x7f454c46/criu/builds/183976899

travis-ci: success for pie: fix clobber registers for int 0x80 (rev2)
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Tested-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 00:09:54 +03:00
Dmitry Safonov
1c452384c6 x86/parasite-head: add 32-bit parasite entry
To drop the second parasite blob, create another entry in 64-bit
parasite.
Didn't remove parasite-head-compat.S - it we gonna support native 32-bit
buids, we gonna need it.

travis-ci: success for Rectify 32-bit compatible C/R on x86
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 00:06:17 +03:00
Cyrill Gorcunov
5a7c137bb7 compel: Prepare to ship common headers into compel
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 00:06:13 +03:00
Dmitry Safonov
2e39767a41 uapi/compel/criu: move auxv_t, tls_t back to CRIU
We don't need them in libcompel for PIE - only needed for C/R.

Fixes (with compat enabled back):
  CC       criu/arch/x86/sigaction_compat.o
In file included from criu/arch/x86/sigaction_compat.c:1:0:
/home/japdoll/tools/criu/criu/arch/x86/include/asm/restorer.h:15:25: error: unknown type name ‘tls_t’
 extern void restore_tls(tls_t *ptls);
                         ^~~~~

travis-ci: success for Compel/compat cleanups
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 00:06:12 +03:00
Dmitry Safonov
0723c8a6f1 compel/uapi: remove compat_sigset_t type
Remove compatible sigset structure: as it has the same size for both
32-bit and 64-bit, I didn't use it across the code, only for a size check.
The check is removed as we use now only k_rtsigset_t.
Wordsize for sigset is changed to 64-bit - as it's written in comment
for possible 32-bit native building.

If we ever going to support compat mode for other archs, we will
need to re-introduce compat_sigset_t type if it has for those archs
different sizes for compat/native builds.
But for a while, let's simplify this.

travis-ci: success for Compel/compat cleanups
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 00:06:11 +03:00
Cyrill Gorcunov
c7a717c1d1 compel: Save and restore regs inside compel by default
CRIU keeps all registers on CoreEntry and makes sigframe from
them as well, which means anyone using the compel library
have to provide own handlers, which is inconvenient. So
now it's possible to leave this task for libcompel itself:
it will save the regs and prerare sigframe on its own.

travis-ci: success for compel: Contrinue improving library
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 00:06:11 +03:00
Pavel Emelyanov
5be5424047 compel: Split cpu.h heander into uapi and priv parts
https://travis-ci.org/xemul/criu/builds/177585567
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 00:06:10 +03:00
Pavel Emelyanov
fd26c6fcd6 compel: Drop common/page.h from UAPI headers
This one is needed only for task_size() on some arches and it is
simpler to keep this routine in compel .c rather than messing
with common/page.h installation.

https://travis-ci.org/xemul/criu/builds/177585567
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 00:06:10 +03:00
Cyrill Gorcunov
51458d4518 compel: plugins,std -- Move in infect code
Providing infect functionality inside std plugin
doesn't look suite for me: the restorer has to define
dummy parasite_daemon_cmd/parasite_trap_cmd/parasite_cleanup
just to be able to compile with it.

So we have to define weak stubs right here in near future.

travis-ci: success for compel: The final infect move and install target
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 00:06:10 +03:00
Pavel Emelyanov
72e4804b07 compel: Prepare to hide parasite_thread_ctl
This only means introducing a compel_get_task_regs wrapper
over the get_task_regs() call that works on thread-ctl, not
thread-ctx.

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 00:06:08 +03:00
Cyrill Gorcunov
0be8beb666 compel: Add lds scripts for PIE code
In CRIU these are auto-generated, we want to have them in
compel and it looks like it's better to have them fixed
rather than generated.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 00:06:07 +03:00
Cyrill Gorcunov
cbe24fb9c4 compel: Move in parasite engine
This is the final patch in the series. It does a bunch
of renames and fixes headers respectively.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 00:06:06 +03:00
Cyrill Gorcunov
51092282de compel: Move sigframe code into compel
We use it in both -- parasite engine and criu,
so export them as well.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 00:06:05 +03:00
Cyrill Gorcunov
b05f066644 compel: Move fpu.h into it
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 00:06:03 +03:00
Cyrill Gorcunov
aabb45bece compel: Move cpu interface to compel
We will need it when parasite engine will be creating signal frames.
Export appropriate headers and use it in CRIU by linking with libcompel.a.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 00:06:03 +03:00
Cyrill Gorcunov
1a30731b1f compel: Add callback-based log engine
pr_out is only special left in piegen engine, the rest use
compel's pr_x output. Probably we will need to enhance it
one day to make same close to what we have in criu.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 00:06:02 +03:00
Cyrill Gorcunov
a0810481e5 compel: Include compel headers as system ones
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 00:06:02 +03:00
Cyrill Gorcunov
bb8b8e84f9 compel: Remove criu's int.h from infect
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 00:06:02 +03:00
Pavel Emelyanov
dec9a25054 infect: Move processor-flags.h into compel
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 00:06:01 +03:00
Pavel Emelyanov
f15dfc6107 infect: Move __NR32_mmap into compel headers
This remove parasite-syscall.h from infect.

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 00:06:01 +03:00