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

11124 Commits

Author SHA1 Message Date
Cyrill Gorcunov
a095617253 restore: Simplify sigreturn code
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-16 18:19:24 +04:00
Cyrill Gorcunov
11eb2ca409 Add ALIGN helper
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-16 18:16:12 +04:00
Cyrill Gorcunov
85506595e9 restorer: Drop futex constants
We don't use them yet, no need to carry.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-15 23:05:36 +04:00
Cyrill Gorcunov
b712182308 Gather file names formats in one place
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-15 18:35:55 +04:00
Cyrill Gorcunov
0fd17a08cb Bring some order in usage of VMA entries helpers
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-15 17:12:29 +04:00
Cyrill Gorcunov
bb15450d98 image: Drop tls_array from the image
We use registers set anyway

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-15 14:57:39 +04:00
Cyrill Gorcunov
bbabbe89a7 util: Use vma_entry_len helper
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-15 14:02:00 +04:00
Cyrill Gorcunov
35781a8c6d util: Drop redundant vma_area->vma.status assignment
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-15 13:37:17 +04:00
Cyrill Gorcunov
3542220a00 util: Split long line
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-15 13:32:09 +04:00
Cyrill Gorcunov
929e316f5f util: VMA area flags might exceed 4 symbols
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-15 13:28:56 +04:00
Cyrill Gorcunov
33ea81e606 Drop redundant pstree_item_info
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-15 13:19:12 +04:00
Cyrill Gorcunov
9ab6e9fe5c crtools: Use %d format for pir_t
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-15 13:12:27 +04:00
Cyrill Gorcunov
4619e48574 dump: parasite -- Drop unneeded error codes
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-15 12:22:40 +04:00
Cyrill Gorcunov
f89f67914e dump: parasite -- Drop unneeded sections
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-15 12:21:17 +04:00
Cyrill Gorcunov
72d3d2326a dump: Drop parasite_complete_ip from parasite_ctl
It was used for debug only to be able to work without
task seizing. Not needed anymore.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-15 12:15:08 +04:00
Cyrill Gorcunov
417fe5d8e1 image: Drop redundant VMA_FORCE_WRITE
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-15 11:57:24 +04:00
Cyrill Gorcunov
2c0e5db7eb image: Drop redundant offsetof
Already in compiler.h

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-15 11:54:01 +04:00
Cyrill Gorcunov
54b1455e8a util: Move maps buffer into routine stack
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-15 11:34:11 +04:00
Cyrill Gorcunov
dd4d829d61 util: Add error messages into files/dirs open helper
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-15 11:29:33 +04:00
Cyrill Gorcunov
1c5f981e51 cleanup: dump -- Add warning on unexpected VMA
Instead of simply dropping this dead code, put
a warning here, just to be on a safe side.

Reported-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-14 18:51:36 +04:00
Cyrill Gorcunov
5ae9d9feb8 cleanup: parasite - Drop PARASITE_CMD_RESTORECORE
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-14 18:50:20 +04:00
Cyrill Gorcunov
ce40f5d96f restore: Fix restoration of anonymous shared vmas
And rename prepare_and_execute_image to
prepare_and_sigreturn which is more appropriate
name here.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-14 17:23:23 +04:00
Cyrill Gorcunov
ba63496330 dump: Update comment
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-14 17:22:17 +04:00
Cyrill Gorcunov
321793cd37 test: Add pipes output into testee
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-14 17:20:21 +04:00
Cyrill Gorcunov
c9c2bddcb8 test: Update shared mem test
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-14 17:19:41 +04:00
Cyrill Gorcunov
6a26e75aba cleanup: Drop elf references
We dont use Elf restore anymore, drop it.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-13 13:07:00 +04:00
Cyrill Gorcunov
e793eb7557 cleanup: Drop unneeded sources
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-13 13:00:32 +04:00
Cyrill Gorcunov
3e72543422 restore: Handle process tree correctly
pstree file is a single one for all processes and
threads so skip non-matched entries correctly.

This brings testee test back to life.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-13 12:57:16 +04:00
Cyrill Gorcunov
1e7bbd35de restore: Add threads restoration
Now threads restortion (and TLS as well) works.
Threads test reports the following

    2775 (main): Counter value:    3 tls_data =    1
    2775 (main): ( 0) fsgs_base 7f9597aa46f0
    2775 (main): ( 0) fsgs_base        0
    2775 (thr3): Counter value:    4 tls_data =    4
    2775 (thr3): ( 0) fsgs_base 42c57940
    2775 (thr3): ( 0) fsgs_base        0
    2775 (thr2): Counter value:    3 tls_data =    2
    2775 (thr2): ( 0) fsgs_base 42456940
    2775 (thr2): ( 0) fsgs_base        0
    2775 (thr1): Counter value:    4 tls_data =    3
    2775 (thr1): ( 0) fsgs_base 40c62940
    2775 (thr1): ( 0) fsgs_base        0
    2775 (main): Counter value:    4 tls_data =    1
    2775 (main): ( 0) fsgs_base 7f9597aa46f0
    2775 (main): ( 0) fsgs_base        0
    2775 (thr1): Counter value:    5 tls_data =    3
    2775 (thr1): ( 0) fsgs_base 40c62940
    2775 (thr1): ( 0) fsgs_base        0

as expected.

This commits merges all preliminary commits into
the final one (sigreturn branch was always experimental
and forced update).

Still some problems remain:

1) While creating threads with clone() the
   flags are to be revisited. We use some predefined
   set here but it's not really correct.

2) No setup of pids in PCB thread zone.

3) No restore of FPU.

But at least on some basic tasks restore works well.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-12 19:26:40 +04:00
Cyrill Gorcunov
db2064811d dump: Add missing newline in error message
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-09 13:00:12 +04:00
Cyrill Gorcunov
0a26593a3b dump, restore: Add blocked signals mask
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-09 00:29:41 +04:00
Cyrill Gorcunov
73e64bec27 restorer: Setup task data via prctl
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-08 18:25:02 +04:00
Cyrill Gorcunov
566a900e4e restore: Use prctl for vDSO restoration
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-08 17:53:47 +04:00
Cyrill Gorcunov
a4d37dcf67 kernel: Add patches needed
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-08 17:53:17 +04:00
Cyrill Gorcunov
76df6d9ed5 syscalls: Add sys_prctl helper
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-08 16:39:21 +04:00
Cyrill Gorcunov
b50ee4a175 Update kernel area
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-08 15:16:06 +04:00
Cyrill Gorcunov
83c209ef07 Move vma prot setup into parsing helper
To shrink restorer code.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-08 13:54:01 +04:00
Cyrill Gorcunov
35502c4564 restore: Add PROT_GROWSDOWN for stack area
Since we stick with x86 for a while.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-08 13:48:10 +04:00
Cyrill Gorcunov
0355f1d23a dump: Don't fail on dumping paths for anon shared mappings
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-08 13:25:15 +04:00
Cyrill Gorcunov
c07a4b2caa restore: Don't forget to close file descriptors on VMAs
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-08 12:20:28 +04:00
Cyrill Gorcunov
b9d0883d76 dump: Anonymous shared mappings should have MAP_ANONYMOUS flag
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-08 12:19:43 +04:00
Cyrill Gorcunov
20c3bf1033 restore: 32k of stack memory is enough
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-08 01:44:40 +04:00
Cyrill Gorcunov
099c9c0016 dump: Don't forget to save MAP_ANONYMOUS if it was there
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-08 00:39:21 +04:00
Cyrill Gorcunov
275e97c77d restore: Increase the stack size for cloned processes
Wasted a couple of hours trying to resolve this non-obvious
issue. It's because bootstrapping the restorer code might
requre more memory than 16K on stack. Strictly speaking
we need a compile time constant here and BUG_ON.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-07 22:58:18 +04:00
Cyrill Gorcunov
b78c664bca restore: Fixup pstree reading
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-07 20:18:38 +04:00
Cyrill Gorcunov
3b7a4cbe09 restorer: Start using sigreturn_restore
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-07 19:14:28 +04:00
Cyrill Gorcunov
7e481f89f9 restore: Add GS-TLS handling
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-07 17:44:24 +04:00
Cyrill Gorcunov
da8f61c1c8 dump: Add GS-TLS handling
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-07 17:44:00 +04:00
Cyrill Gorcunov
1f7018a15c restore: Update fsindex and fs base in sake of TLS
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-07 17:34:59 +04:00
Cyrill Gorcunov
8a8850d146 dump: Dump TLS via sys_arch_prctl
As such -- no need for kernel patch.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2011-11-07 16:29:36 +04:00