2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-25 19:38:38 +00:00

55 Commits

Author SHA1 Message Date
Andrei Vagin
e0a0e1b7fa pie/log: print space after timestamp
(00.566486)pie: 1: seccomp: mode 0 on tid 1

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-05-16 08:42:36 +03:00
Andrey Vagin
4fb0935f54 compel/log: increase a max line length
There are a lot of lines, which are longer than 79:

(04.331172)pie: 1: Error (criu/pie/restorer.c:460): seccomp: Unexpected tid ->
(04.331172)pie: 1: 1 != 1

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-05-16 08:32:34 +03:00
Dmitry Safonov
0f98ee4641 compel/criu: Add ARCH_HAS_LONG_PAGES to PIE binaries
For architectures like aarch64/ppc64 it's needed to propagate the size
of page inside PIEs. For the parasite page size will be defined during
seizing, and for restorer during early initialization.
Afterward we can use PAGE_SIZE in PIEs like we did before.

Signed-off-by: Dmitry Safonov <dima@arista.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-05-15 03:03:01 +03:00
Joel Nider
0c41a4208b compel: std_vprint_num returns a null-terminated string
This function is an analogue to vsprintf(), and is used in very much the
same way. The caller expects the modified string pointer to be pointing to
a null-terminated string.

Signed-off-by: Joel Nider <joeln@il.ibm.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-05-09 10:17:47 +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
Michael Holzheu
61e6c01d09 s390: Move -msoft-float/-fno-optimize-sibling-calls into compel Makefiles
We currently define "CFLAGS += -msoft-float -fno-optimize-sibling-calls"
in Makefile.compel.

Makefile.compel is included into the toplevel Makefile and so changes
CFLAGS which are exported to all criu and zdtm Makefiles.

We must not use -msoft-float outside the compel files. E.g. otherwise for
zdtm we get the following build error:

uptime_grow.o: In function `main':
/tmp/2/criu/test/zdtm/static/uptime_grow.c:36: undefined reference to `__floatdidf'
/tmp/2/criu/test/zdtm/static/uptime_grow.c:36: undefined reference to `__muldf3'
/tmp/2/criu/test/zdtm/static/uptime_grow.c:36: undefined reference to `__floatdidf'
/tmp/2/criu/test/zdtm/static/uptime_grow.c:36: undefined reference to `__adddf3

Fix this and move the CFLAGS definition to the compel Makefiles.
We do this by defining a new flag CFLAGS_PIE that is only used for pie code.

Reported-by: Adrian Reber <areber@redhat.com>
Suggested-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Tested-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-08-09 18:51:41 +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
Kir Kolyshkin
f3a1dc5cc9 compel/plugins/Makefile: clean up
1. Remove .FORCE, it's not used.

2. Consolidate CFLAGS stripping into a single line.

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
Pavel Emelyanov
6794c8c2a9 compel: Add fds plugin (v2)
This is just export by reasonable name of the existing
code, that sends and receives FDs via compel RPC socket.

v2:
 Rebase on recent criu-dev
 Fix parallel build

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 09:36:09 +03:00
Kir Kolyshkin
eebfeb925b compel plugins uapi: rename includes
The statement like

	#include <compel/plugins/plugin-std.h>

looks a bit tautological. I think the single "plugins" word is enough:

	#include <compel/plugins/std.h>

Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Acked-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 09:36:09 +03:00
Kir Kolyshkin
485a47babc compel/plugins: simplify #includes
First, for building compel plugins, we already have
"-I compel/include/uapi" in ccflags and asflags, so there is
no need to add "-iquote include/uapi".

Second, let's refer to compel plugin uapi includes in a uniform way,
choosing the same way the external code does, i.e. #include <compel/...>.

Third, in a few cases simplify #include statements by including
compel/plugins/plugin-std.h instead of a number of plugins/std/*.h files.

Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Acked-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 09:36:09 +03:00
Kir Kolyshkin
9067c5c18f compel/plugin-std.h: include log.h
This header should have everything we have in std/

Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Acked-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 09:36:09 +03:00
Kir Kolyshkin
ef849f2df8 compel Makefiles: simplify headers [un]install
* install

'cp' can copy recursively, create directories, and even
dereference symlinks.  Everything we have in uapi/ is to be installed.

NOTE we can't use -r for compel includes, as there is some extra stuff
in there we don't want to take with us (in particular, plugins/
and 'compel -> .' symlinks).

* uninstall

rm -rf everything under compel includedir

While at it, fix some minor things here and there.

Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Acked-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 09:36:08 +03:00
Kir Kolyshkin
31eab3e36d compel: nuke compel_main()
It is not used anywhere, so unless someone has any plans, let's kill it.

Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Acked-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 09:36:08 +03:00
Kir Kolyshkin
aa39838c32 compel: fix uninstall
A slash after a directory was missing in a number of places, that
resulted in "make uninstall" leaving a number of files behind.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 09:36:08 +03:00
Kir Kolyshkin
85b04c8bfd Makefiles: nuke $(SRC_DIR)
As all builds are done from top source dir, there is no need
to have SRC_DIR.

Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 09:36:08 +03:00
Kir Kolyshkin
8b745876da compel std: rename printing functions
Let's rename the printing functions so their names look more like
the standard ones.

1. putc/puts with a file descriptor.

__std_putc -> std_dputc
__std_puts -> std_dputs

There are no standard putc/puts that accept fd as an argument,
but the libc convention is to use d prefix for such. Therefore:

NOTE we keep the order of the arguments intact, to be in line
with the rest of the functions.

2. *printf

__std_printk -> std_vdprintf
__std_printf -> std_dprintf

The reason is, these are the names of libc functions with similar
functionality/arguments.

Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 09:36:06 +03:00
Kir Kolyshkin
026968f63a compel std_printf: annotate with printf
This function works like printf, and it helps the compiler
to know that, so it can check whether arguments fit the
format string.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 09:36:06 +03:00
Kir Kolyshkin
b1245247e2 compel/uapi: add prefix to log levels
These are part of compel UAPI so should be prefixed with COMPEL_
in order to not pollute the namespace. While at it, move from
set of defines to an enum, which looks a bit cleaner.

Also, kill LOG_UNDEF as it's not used anywhere.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 09:36:06 +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
Andrey Ryabinin
706c05529f Makefile: add AddressSanitizer to CFLAGS
This allows to build criu with AddressSanitizer enabled:

	make ASAN=1 -j<N>

travis-ci: success for series starting with [1/6] compel/infect: fix out-of-bounds parasite memcpy()
Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-03-15 09:36:04 +03:00
Kirill Tkhai
95817e952e compel: Define __sys_err-s for scm stuff
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 09:36:03 +03:00
Kir Kolyshkin
545bac9b62 Makefiles: rm -I compel/plugins... from cflags
I have noticed compel/plugins/include[/uapi] is not needed,
not entirely sure why (added symlinks?) but everything
compiles just fine without it.

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:55 +03:00
Dmitry Safonov
d4c02f2eb1 compel: kill self-unmap in parasite
Why should we have self-unmapping code in parasite?
It looks like, we can drop this code using simple sys_unmap()
injection (like that I did for `criu exec` action and for cases where we
failed to insert parasite by some reason, but still need to unmap remotes).

It's an RFC, so just a suggestion - maybe I miss something you have in
mind - please, describe that/those things.

My motivation is:
- less code, defined commands for PIE, one BUG() less, one jump to PIE less
- I'm making one 64-bit parasite on x86 instead of two 32 and 64 bit.
  It works (branch 32-one-parasite) with long-jump in the beginning to
  64-bit code from 32-bit task.
  On parasite curing it sig-returns from 64-bit parasite to 32-bit task,
  this point we're trapping in CRIU. After that we command parasite to
  unmap itself, so it long-jumps again to parasite 64-bit code, unmaps,
  we caught task after sys_unmap and the task is with 64-bit CS.
  We can't set 32-bit registers after this - kernel checks that
  registers set is the same on PTRACE_SETREGSET:
> > static int ptrace_regset(struct task_struct *task, int req, unsigned int type,
> >                        struct iovec *kiov)
...
> >       if (!regset || (kiov->iov_len % regset->size) != 0)
> >               return -EINVAL;
  So, to return again to 32-bit task I need sigreturn() again or add
  long-jump with 32-bit CS.
  I've disable that for 32-bit testing with (in compel_cure_remote):
-       if (ctl->addr_cmd) {
+       if (ctl->addr_cmd && user_regs_native(&ctl->orig.regs)) {
  And it works. It also works for native tasks, so why should we keep it?

travis-ci: success for compel: kill self-unmap in parasite
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Pavel Emelyanov <xemul@virtuozzo.com>
Cc: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Acked-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:06:14 +03:00
Cyrill Gorcunov
fe0413ef9e compel: plugins -- Merge fds plugin into std
We use fds helpers in std plugin anyway
so just merge it in.

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
Cyrill Gorcunov
474289f040 compel: Add installation
To ship plugins, libs and dev headers.

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
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
Cyrill Gorcunov
50219defcf compel: plugins,fds -- Don't include log.h
It's libcompel's helper. We need to address this problem later.

travis-ci: success for compel: A few fixes and example
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:12 +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
Cyrill Gorcunov
a51068664b compel: plugins,std -- Move in log engine from criu pie
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:09 +03:00
Cyrill Gorcunov
387361946e criu: pie,log -- Prepate to move into compel std plugin
- Add uapi header and start using it
 - Add std_ prefix into functions and constants
 - Drop unneeded headers

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:09 +03:00
Cyrill Gorcunov
3821b3423e scm: Unweave fds mess
Currently criu built with criu/pie-util-fd (which
is a symlink to criu/pie/util-fd) with same flags
as we use in general compel infection code. Moreover
the criu link with libcompel.a, so we get a problem
where send_fds/recv_fds are multiple defined. Lets
rather unweave this mess:

 - drop criu/pie-util-fd.c completely
 - move send_fd/recv_fd inliners into scm.h

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:08 +03:00
Cyrill Gorcunov
fa6243b65e compel: plugins -- Add missing flags into compilation
These were lost when moving code from CRIU, so pull them
back in.

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:08 +03:00
Cyrill Gorcunov
32405371ee compel: plugins,fds -- Add missing headers into uapi
This plugin is all about sending scm-s over unix sockets,
so having this stuff there is helpful.

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
d9c284c3e9 compel: plugins,std -- Implement generic std_memcpy
The routine was #if0ed for a while (taken from older compel), now it's
time to provide any generic version.

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
93d0494e3e compel: plugins,std -- Include string helpers
They will be needed for log module.

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:06 +03:00
Cyrill Gorcunov
7b6c60b0ee compel: plugins,std -- Use proper quotes in exported header
In UAPI there should be no -iquote-d headers.

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:06 +03:00
Pavel Emelyanov
6606dc722c scm: Switch compel fd plugin onto common
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 00:06:04 +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
a714fff5a3 compel: Use common's compiler.h
And drop compel/include symlink.

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
Kir Kolyshkin
1fe09eb358 Makefiles: move -Wa,--noexecstack out of CFLAGS
The problem is, -Wa is a flag for assembler, but CFLAGS are also used
to generate dependencies, and clang complains loudly when it is used
for deps:

> >   DEP      compel/arch/x86/plugins/std/syscalls-64.d
> >  clang-3.8: error: argument unused during compilation:
> > '-Wa,--noexecstack'

This patch moved the noexecflag from assembler to linker. I am not
100% sure but the end result seems to be the same.

This fixes dependency generation when using clang instead of gcc.

I surely have done my research before proposing this change, and
I have tested this change as good as I could.
Sorry, I should have provided more background in the commit message.
Here it goes.

There are a few ways to have non-executable stack:
1. mark the assembler source file (.S) with .section
.note.GNU-stack,"",%progbits
2. pass the -Wa,--noexecstack to compiler
3. pass the -z execstack to linker

All three ways are fine, let's see them in greater details.

Some people say (1) is the best way, but we have way too many
.S files now (23 of them, to be exact). Anyway, I can certainly do it
this way if you like, just let me know. It would look like this:

    --- a/compel/arch/aarch64/plugins/std/syscalls/syscall-aux.S
    +++ b/compel/arch/aarch64/plugins/std/syscalls/syscall-aux.S
    @@ -3,6 +3,8 @@
     * that are not implemented in the AArch64 Linux kernel
     */

    +.section .note.GNU-stack,"",%progbits
    +
     ENTRY(sys_open)
     mov x3, x2
     mov x2, x1

Way (2) is what is currently used. Unfortunately it breaks dependency
generation with clang. One way to fix it would be to filter-out the bad
flag when we're generating deps. I tried experimenting with
$(filter-out) function in Makefiles today but it's complicated and I failed
to make it work.

Way (3) is what this commit offers. It seem to work fine while being
the least intrusive.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>
Reviewed-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:05:55 +03:00
Cyrill Gorcunov
2a43af1220 complel: plugins -- Disable coverage and mcount
They are not supported in plugins.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-14 23:58:21 +03:00
Cyrill Gorcunov
19fadee9d9 compel: plugins,std -- Implement syscalls in std plugin
And use it in CRIU directly instead:

 - move syscalls into compel/arch/ARCH/plugins/std/syscalls
 - drop old symlinks
 - no build for 32bit on x86 as expected
 - use std.built-in.o inside criu directly (compel_main stub)
 - drop syscalls on x86 criu directory, I copied them already
   in first compel commist, so we can't move them now, but
   delete in place

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-14 23:58:20 +03:00
Cyrill Gorcunov
55bc551846 compel: plugins,std -- Prepare stubs to use syscalls
CRIU will reference to them, but for now they are just stubs.

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-14 23:58:20 +03:00
Cyrill Gorcunov
e0697f780d compel: plugins,std -- Add syscall-types.h header
Both std and criu will use it for syscalls sake.
Note I've to disable x86 compat mode for a while:
we have to provide native types there thus will
back once everything else is complete.

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-14 23:58:11 +03:00
Cyrill Gorcunov
34c8ef4a14 compel: plugins, std -- Use compel_plugin entry point routine name
Plain "main" makes compilers unhappy since it's
known predefined name.

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-14 23:58:11 +03:00
Dmitry Safonov
66929a661c compel: plugins -- Add fds plugin
This is fd passing via unix sockets (scm creds) suitable for use
by parasite code.

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-14 23:58:10 +03:00
Dmitry Safonov
048c5073cf compel: plugins,std -- Use sys_recvfrom instead of recv
prologue.h defines sys_recv() macro - let's use it by now

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-14 23:58:09 +03:00
Dmitry Safonov
a1d931c354 compel: plugins -- Add shmem plugin
The shmem pluging allows creation of shared memory segment between
parasite code and the caller.

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-14 23:58:09 +03:00