2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 06:15:24 +00:00
Commit Graph

2812 Commits

Author SHA1 Message Date
Pavel Emelyanov
960694e96f page-pipe: Introduce object to collect pages within
The page-pipe is an object, that can accumulate pages inside it. It
consists of list of page-pipe-bufs, which in turn has a pipa, an
array of iovecs that describe the pages' locations and some stats.

Users of it are supposed to vmsplice pages into pipes to accumulate
then for later use, and vmsplice them from pipes when required.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-01 20:12:58 +04:00
Pavel Emelyanov
21449cf73a parasite: Prepare to allocate args for page maps
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-01 20:12:46 +04:00
Pavel Emelyanov
4d0b24b52a vma: Keep track of lonest vma in list and sum of its lengths
I will have to push some sort of map of pages to dump into parasite.
For this, I need to have estimation of how much memory I'd need for
than in parasite args. These two values will help with it.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-01 20:12:33 +04:00
Pavel Emelyanov
8fdc707084 vma: Helper, that checks whether vma is dumped via parasite
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-01 20:12:02 +04:00
Pavel Emelyanov
b71f9e80be vma: Introduce list-of-vmas object
Right now when we collect list of vmas we need to know the
number of elements in it. In the future I will need to know
more, so it makes sense to create a vmas-list object for it.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-01 20:11:51 +04:00
Pavel Emelyanov
7a7506f615 fd: Dynamically allocate args for the array of fds to drain
Just make use of previous patch. The creds dumping args are tuned to
fit one page (minimal static args size).

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-01 20:11:38 +04:00
Pavel Emelyanov
b8d0d5e779 parasite: Make parasite arguments variable size
Sometimes we don't know the exact amount of data we would want
to send to parasite via args area (e.g. -- while draining fds).

Fix this, by moving the args area behind the parasite blob and
mmap-ing it with the run-time calculated size.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-03-01 20:11:28 +04:00
Cyrill Gorcunov
8133ab41f3 parasite-syscall: Use pr_perror on prctl call failure
This prints more detailed error report.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-27 15:43:36 +04:00
Cyrill Gorcunov
6f5859ec84 parasite: Print unknown command number
Convenient for debugging

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-27 15:43:35 +04:00
Cyrill Gorcunov
300a200724 pie: Pass CR_NOGLIBC in pie/Makefile
PIE code can't use glibc helpers so instead of passing
CR_NOGLIBC macro in every source file pie code uses just
pass it in pie/Makefile.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-27 15:43:34 +04:00
Cyrill Gorcunov
bdf8c565d9 lock: Include bug.h instead of big util.h
This makes it suitable to use in PIE code.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-27 15:43:33 +04:00
Cyrill Gorcunov
19cc8a5eb2 Move BUG_ONs to include/bug.h
We will need futexes to use in PIE code but futex.h
uses BUG_ON helper, so to diet inclusions move BUG_ONs
code to include/bug.h.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-27 15:43:31 +04:00
Cyrill Gorcunov
2badc1d3b0 make: arm -- Use syscalls-asm-y-asmflags instead of CFLAGS
CFLAGS can be overriden, we need own flags here.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Tested-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-23 00:37:06 +04:00
Cyrill Gorcunov
e02bc20b29 make: pie -- Add -fno-stack-protector
PIE code use own handmade stack so we need -fno-stack-protector
option to eliminate compilation warning if -fstack-protector
passed in command line CFLAGS.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Tested-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-23 00:36:56 +04:00
Cyrill Gorcunov
efe0cbc1c9 make: pie -- Drop -fno-strict-aliasing option
It's already defined in general Makefile

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Tested-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-23 00:36:45 +04:00
Cyrill Gorcunov
f7066d7dca make: Provide mandatory options in cflags-y variable
In case if CFLAGS is overriden from command line we don't
see our headers anymore. So provide mandatory options in
ccflags-y variable to fix that.

https://bugzilla.openvz.org/show_bug.cgi?id=2521

Reported-by: Jan Engelhardt <jengelh@inai.de>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Tested-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-23 00:36:36 +04:00
Cyrill Gorcunov
b8ebb4d260 check: Check for pipe return value in check_unaligned_vmsplice
| cr-check.c: In function ‘check_unaligned_vmsplice’:
| cr-check.c:372:2: error: ignoring return value of ‘pipe’, declared with attribute warn_unused_result [-Werror=unused-result]

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-22 15:56:50 +04:00
Cyrill Gorcunov
94ef03947a pstree: Add general core_entry_free helper
This facrots out common core members freeing into pstree.c
helper. Per-arch freeing helpers are now symmetrical to the
allocating ones.

This is a merge of two Cyrill's patches.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-22 15:41:27 +04:00
Cyrill Gorcunov
38e75bc883 arch: Sanitize headers inclusion in arch/x86/crtools.c
- For NT_X86_XSTATE we need a system elf.h
 - Drop duplicated parasite-syscall.h
 - Organize headers in the way
    - system headers
    - asm headers
    - regular headers
    - protobuf stuff

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-22 15:35:52 +04:00
Pavel Emelyanov
e3b4fb62cc criu: Version 0.4 release
This is the first release, that actually doesn't require a custom
kernel in order to make all the tool features to work. Just take
the v3.8 (with proper config) and that's it :)

Another coolness about this release is the ARM port. In this case,
however, one does require a custom kernel, since the kcmp system
call is not wired into the ARM table in the upstream kernel :(

What else? Quite a lot, actually:

* C/R ability of a LOT of new stuff
* Remote syscall execution
* Deprecation of --namespace option
* Build system rework
* Ability to collect gcov info

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
v0.4
2013-02-20 14:58:57 +04:00
Alexander Kartashov
15211ed3f7 arm: fixed the syscall table generation rule
Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-20 14:54:45 +04:00
Alexander Kartashov
ab0b175115 arm: added CPU-specific header inclusion
Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-20 14:54:42 +04:00
Alexander Kartashov
5b476fff88 arm: added missing asm/cpu.h
Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-20 14:54:38 +04:00
Alexander Kartashov
888bdda5d4 protobuf: fixed compilation on ARM
The constant 4294967295 isn't replaced with 0xFFFFFFFF
in a generated source.

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-20 14:54:35 +04:00
Andrew Vagin
d767625be9 zdtm.sh: fix the mainstream-kernel tests list
Currently the mainstream-kernel tests list is equal to cr test list.

Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-20 14:26:54 +04:00
Pavel Emelyanov
b55e07f883 sk: Fail is SO_BINDTODEVICE and SO_GET_FILTER are missing
The v3.8 is out, so we should exptect these to be in kernel.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-20 13:32:20 +04:00
Pavel Emelyanov
47eac37e8b make: Move criu version constants from scripts/ to root Makefile
It's nicer to have them there.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-19 18:14:26 +04:00
Cyrill Gorcunov
ff328579bc make: arch -- Make sure the syscalls headers are generated before deps
In case if here is a fast cpu and make is done in parallel
we may have the following error

| GEN      arch/x86/sys-exec-tbl.c
| GEN      arch/x86/syscalls.S
| CC       arch/x86/crtools.o
| CC       arch/x86/cpu.o
| CC       arch/x86/syscalls.o
| LINK     arch/x86/syscalls.built-in.o
| In file included from include/restorer.h:12:0,
|                 from arch/x86/crtools.c:19:
| include/lock.h: In function ‘futex_set_and_wake’:
| include/lock.h:56:2: error: implicit declaration of function ‘sys_futex’ [-Werror=implicit-function-declaration]
| cc1: all warnings being treated as errors
| make[1]: *** [arch/x86/crtools.o] Error 1
| make: *** [arch/x86] Error 2

This is because crtools.c includes syscall.h but this header
is generated by a special script. So use $(deps-after) feature
provided by our make engine making sure the header is generated
before the deps are started to build.

Reported-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Tested-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-19 15:46:24 +04:00
Cyrill Gorcunov
379a5d311d make: scripts/Makefile.build -- Add $deps-after variable to order deps creation
Since we generate some headers the deps creation may
need to be ordered, thus add deps-after variable
for this case.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Tested-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-19 15:46:12 +04:00
Cyrill Gorcunov
55412e0d16 make: Use -iquote for headers lookup
Some of ours headers (such as syscall.h) are
clashes with system headers names. So we need
to be sure that the headers we include as

 | #include "something.h"

being searched in known place. In particular on
some machines it it already produced problems.

This btw revealved a problem in cr-dump.c -- we've
had #include <parasite.h> there. Fix it.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Tested-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-19 15:46:06 +04:00
Cyrill Gorcunov
03b95b5717 fpu: Move definitions to asm/fpu.h
The FPU data is quite CPU-type oriented,
thus move it to asm/fpu.h.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-18 18:42:08 +04:00
Cyrill Gorcunov
dfa686db8f make: x86 -- Make syscalls compilation flags being target specific
No need to propagate special flags we use for syscalls library
to all arch specific objects. Make them syscalls local.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-18 18:42:08 +04:00
Cyrill Gorcunov
fcb9a9bfb1 cpu: Make cpu routines being per-acrh
They are really depends on CPU we're running on.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-18 18:42:08 +04:00
Cyrill Gorcunov
f50f7d01ec make: Move all generated files cleanup to clean-built target
This allows to reuse the code and make rebuild to work correctly.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-18 18:42:08 +04:00
Cyrill Gorcunov
2f9f03a36b lock: Move inline attribute before function type
That's correct syntax.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-18 18:42:08 +04:00
Cyrill Gorcunov
80c51eeb09 docs: crtools -- Use bold format for parameters
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-18 18:42:07 +04:00
Cyrill Gorcunov
44faee19c1 make: docs -- Append manpages generation
I occasionally used assignments instead of
appending manpages for generation. Fix it.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-18 18:42:07 +04:00
Cyrill Gorcunov
25e8cb5c58 make: Switch main Makefile to simplified form
This is a bit tricky since the build infrastructure
we're switching to is targeted to per-directory targets
if simplified Makefiles are used.

So I did the following

 - move rules to compile general sources to Makefile.crtools
 - main Makefiles now simply calls for scritps/Makefile.build
   help to generate built-in.o target

Also note that we clean up suffixes for implicit rules with

	.SUFFIXES:

this is done on purpose to eliminate any possible side effect
in future -- all rules _must_ be described explicitly.

Because of implicit rules used in zdtm building procedure
I can't use of stict makefile mode and add

	MAKEFLAGS := -r

to the top of the general Makefile. This should be done
one day latter (if ever).

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-18 18:10:49 +04:00
Cyrill Gorcunov
3ab787dba3 make: Use relative pathes where possible
We're building project from toplevel directory so
no need for absolute paths.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-18 18:10:47 +04:00
Cyrill Gorcunov
ecf73756ec make: No need for shell call, use CURDIR builtin instead
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-18 18:10:46 +04:00
Cyrill Gorcunov
c405549934 make: pie -- Switch to a new scheme
Because we need util-net.c for both PIE code and
a regular code, just move it to pie/ directory
and build with -fpie option, this way we can reuse
compiled file in main program without additional
compilation pass.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-18 18:10:45 +04:00
Cyrill Gorcunov
a210b5a1c5 make: protobuf -- Switch to a new scheme
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-18 18:10:44 +04:00
Cyrill Gorcunov
10ed5a0af4 make: arch -- Switch to a new build scheme
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-18 18:10:43 +04:00
Cyrill Gorcunov
16c75274a1 docs: Add documentation about scritps/Makefile.build
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-18 18:10:42 +04:00
Cyrill Gorcunov
60455da825 make: Add scripts/Makefile.build
This script is engine for simplified Makefiles.
I tried to make it somewhat close to what is used
to build linux kernel.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-18 18:10:41 +04:00
Cyrill Gorcunov
77af03686d make: Add scripts/Makefile.rules
This helpers will be used in rules generation
for new make infrastructure.

At moment only a few helpers here -- to compile
*.c and *.S files, and generate *.d,*.s,*.i files.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-18 18:10:40 +04:00
Cyrill Gorcunov
ad4f28cad1 make: Define dummy target for scripts/Makefile.version
At moment built-in .SUFFIXES variable is not cleaned
which slows down the building procedure. Add a dummy
rule thus the make won't try to lookup rules for
scripts/Makefile.version (this happens when last
resort rule is used).

Note that this is rather a stub for future convenience
which doesn't affect much current build procedure.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-18 18:10:38 +04:00
Cyrill Gorcunov
4e6eca1881 make: Drop -r flag from $(RM)
It's already defined as RM := rm -f

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-15 17:37:20 +04:00
Cyrill Gorcunov
75e1fb5c3a include/compiler.h: Cleanup
- Drop parasite \Space in NORETURN definition
- Align likely/unlikely

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-15 17:34:38 +04:00
Cyrill Gorcunov
fdfef4b485 headers: Change "../protobuf/" to "protobuf/"
No need to walk up the directories if we need
to include protobuf file. This was always a bad
use of ability to walk the filesystem from other
headers.

Same time we don't need -I$(SRC_DIR)/protobuf/
in general makefile anymore.

[xemul: Small fixlet in head Makefile, since patch
 it out-of-order]

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-02-15 17:33:06 +04:00