2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 05:48:05 +00:00

2322 Commits

Author SHA1 Message Date
Cyrill Gorcunov
cb7a9a524d restore: Add restorer bootstrap mmap hint
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-06 01:49:57 +04:00
Cyrill Gorcunov
b69aeb9a26 restore: Don't continue on opening vmas file failure
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-05 01:39:21 +04:00
Cyrill Gorcunov
34c72fc9f6 restore: Add some more debug printing
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-04 18:45:47 +04:00
Cyrill Gorcunov
bf30aa1130 restore: Drop unused struct partial_pt_regs
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-03 19:31:07 +04:00
Cyrill Gorcunov
2ae009ac1b restore: Don't forget to free temporary self VMAs
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-03 19:11:27 +04:00
Cyrill Gorcunov
9e5b145aff restore: Drop dead code, comments
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-03 18:24:23 +04:00
Cyrill Gorcunov
f63777d2be restorer: Setup rt_sigframe to a proper address
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-03 15:24:40 +04:00
Cyrill Gorcunov
345834ecee test: Add prints out in static test
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-03 15:24:08 +04:00
Cyrill Gorcunov
489745f235 restore: A number of fixups and debug printing
An idea is to align restorer size to be sure it
wont be stripped in a middle of code.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-03 11:58:45 +04:00
Cyrill Gorcunov
ed3c4fbacf syscalls: Get rid of mnemonic names for registers
Use explicit registers name instead just to be sure it
wont cause side effects on most gcc versions.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-03 11:55:29 +04:00
Cyrill Gorcunov
48371f729a test: Add static sleep test
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-31 20:37:50 +04:00
Cyrill Gorcunov
6898d7f113 restore: Drop a few more write_hex_n
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-31 18:35:16 +04:00
Cyrill Gorcunov
6a3c7ab3b9 restore: Drop no longer needed printing
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-31 18:19:53 +04:00
Cyrill Gorcunov
bf41dcac48 syscalls: Get rid of register variables
It's been found that gcc 4.1.2 20080704 (Red Hat 4.1.2-48)
ignores register variables so to be on a safe side rewrite
syscalls with inline assembly without them.

nb: gcc version 4.6.1 20110908 (Red Hat 4.6.1-9) (GCC)
compiles them correctly.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-31 16:33:43 +04:00
Cyrill Gorcunov
5b6748b4c9 restore: Call for sigreturn
Prepare the stack value and do a syscall.
Still it fails because of stack corruption
I think and due to lack of setup of several
important values on thread-info area.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-29 20:42:45 +04:00
Cyrill Gorcunov
a50600c7f4 restore: Copy gprs to frame
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-29 01:43:43 +04:00
Cyrill Gorcunov
b99eae2809 restore: Add some more structures for frame setup
Some of them are already in system header files
but until I debug all things I simply picked up
kernel's definitions just to be more-less safe.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-29 01:13:32 +04:00
Cyrill Gorcunov
a74f379d60 syscall: Add sys_unlink
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-28 14:03:59 +04:00
Cyrill Gorcunov
b9004db89f restore: Align self-length on 16 bytes bound
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-28 00:47:56 +04:00
Cyrill Gorcunov
040131fd3b restore: Print out current pid in testing purpose
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-28 00:40:41 +04:00
Cyrill Gorcunov
98cf8f1a0f syscall: Add getpid syscall
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-28 00:40:20 +04:00
Cyrill Gorcunov
50d6423bc1 restore: Handle read-only VMAs
If VMA is read-only we need to make it
writable while read its contents, then
we should drop write permission.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-28 00:27:03 +04:00
Cyrill Gorcunov
5f91037703 restore: Implement local_sleep helper
Use it instead of pause insns to not burn cpu cycles.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-27 23:15:11 +04:00
Cyrill Gorcunov
8523721592 restore: Use MAP_ANONYMOUS for VMAs mapping for testing purpose
While files are not restored yet this flag is needed.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-27 23:01:34 +04:00
Cyrill Gorcunov
1cf388798d restorer: More readable tracepoints
And a pause at the end.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-27 19:55:42 +04:00
Cyrill Gorcunov
3c88046a18 restorer: Start real mapping restore procedure
At moment fails, but just to have a reference point.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-27 19:39:08 +04:00
Cyrill Gorcunov
4907896e4c restore: Don't unmap special areas until they are handled properly
Note for testing purpose a pause issued at the end.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-27 19:09:33 +04:00
Cyrill Gorcunov
dfe814aa58 restore: Unmap running VMAs
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-27 18:59:21 +04:00
Cyrill Gorcunov
44596497e3 restorer: Handle error case in restorer code
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-27 15:34:21 +04:00
Cyrill Gorcunov
57971f721d restorer: Some preliminary work initiated on mmap heuristics
Just to not lose the snippet.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-27 00:57:01 +04:00
Cyrill Gorcunov
aaf3291e00 restore: Dump current VMAs
Restorer needs to know which VMAs
to unmap before map a new set.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-26 22:50:46 +04:00
Cyrill Gorcunov
2cc7488de2 dump: Make VMA parsing to handle absence of map_files
Needed in testing purposes. Also make free_mappings
being a global one (will need it in restorer).

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-26 22:48:10 +04:00
Cyrill Gorcunov
214b8a6a27 restore: Update memory size needed for restorer code
Since VMA areas are allocated with page granularity
better to reflect this in mmap request. This would
allow the restorer to do munmap on page boundaries.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-26 18:13:06 +04:00
Cyrill Gorcunov
66c1464e40 restore: Drop unneded variables
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-26 18:07:33 +04:00
Cyrill Gorcunov
fa56125d16 util: Move memcopy helper into the header
Since we will need it in parasite and restorer
code rename it to inline_memcpy to avoid name
collision.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-26 18:05:32 +04:00
Cyrill Gorcunov
168d8cf17d restore: restorer is finally alive
No real restore code yet, but at least it
produce message ;)

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-26 17:35:50 +04:00
Cyrill Gorcunov
791f2c8c25 restore: Call for indirect execution
Doesn't work at moment but just to have
a snapshot point.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-26 11:16:00 +04:00
Cyrill Gorcunov
b016db7dea syscall: Add sys_exit
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-26 10:58:10 +04:00
Cyrill Gorcunov
0d20dd0b41 util: Add hex_dump helper
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-26 10:10:19 +04:00
Cyrill Gorcunov
ae41bc9d2a restore: Add restore_core_args facility
More convenient instead of manual offset calculations.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-26 00:30:41 +04:00
Cyrill Gorcunov
efdb52e36c restore: Add reading core entry
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-25 23:36:03 +04:00
Cyrill Gorcunov
0133a23a5e restore: Add opening core file
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-25 21:25:42 +04:00
Cyrill Gorcunov
f8c46a5de1 restore: Add rt_sigframe
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-25 19:27:56 +04:00
Cyrill Gorcunov
c32845ef60 dump: Shrink struct core_entry twice
No need to keep it that big. Note from
this patch if we ever deside to use kernel
elf approach -- the image structures are
to be updated in kernel as well.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-25 14:59:35 +04:00
Cyrill Gorcunov
8bcb885877 kernel: Drop redundant string from a patch changelog
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-25 00:45:30 +04:00
Cyrill Gorcunov
c706e8c6e2 restorer: Add lea_args_off helper
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-25 00:01:27 +04:00
Cyrill Gorcunov
57b45ea5eb restore: Preliminary scheme for restore
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-24 23:56:36 +04:00
Cyrill Gorcunov
20ff379ee4 dump: Append threads to the core file
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-24 23:01:42 +04:00
Cyrill Gorcunov
63e08215aa restore: Add restorer test
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-24 22:23:06 +04:00
Cyrill Gorcunov
0fe80627d6 syscall: Use always_inline instead of __always_inline
__always_inline is internal defenition

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-10-24 22:18:13 +04:00