- 26 Apr, 2012 3 commits
-
-
Pavel Emelyanov authored
Collect all unix sockets in a list while dumping to check whether we've missed something early (at the restore time it can be already late for roll-back). Plus, fix the checks for external stream sockets. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
This is common, that opened fd fix its fowner and flags. Make a cuntion for this. Those that obtain fd with open() don't need to restore flags though. A thought -- do we need yet another abstraction between fdinfo and type-d files? Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
The conn job misses fowner restoratio. Other places are ok, but toss the code for easier next patching. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 25 Apr, 2012 7 commits
-
-
Cyrill Gorcunov authored
The kernel patch titled c/r: prctl: Simplify PR_SET_MM on mm::code/data assignment (which now in linux-next) allows us to setup code/data addresses without requirement of underlied VMA. So revert commit 090513d5 and make code more simplier Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Kernel 3.4-rc4 has two formats for stack "[stack]" and "[stack:%d]" (for threads) so adopt our parsing routine for both. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
To reflect the change in kernel v3.4-rc4 update PR_GET_TID_ADDR and rename it to PR_GET_TID_ADDRESS as it named in kernel. [xemul: this fixes futex test broken with 3.4 rebase] Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Some of them (FC12 I debug on) doesn't have fown_ex stuff in their libc. Add the missing declarations. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Since 3.4-rc the seize-devel flag is removed, the stop event is renamed (great) and the way si_code should be parsed has been fixed. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
The getsid/getpig require _GNU_SOURCE on some libc-s. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 24 Apr, 2012 1 commit
-
-
Konstantin Khlebnikov authored
printf() has standard flag for adding "0x" prefix before hexadecimal integer. MOD='[-+]\?[0-9]*.\?[0-9]*[lL]*' git grep -l "0x%${MOD}x" | xargs -n1 sed -e "s/0x%\(${MOD}\)x/%#\1x/g" -i Signed-off-by:
Konstantin Khlebnikov <khlebnikov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 23 Apr, 2012 7 commits
-
-
Cyrill Gorcunov authored
Easier to read. [ xemul: There's a silent change in how sk buffer is read in -- before the patch there was a static buffer for data, now this thing is xrealloc-ed ] Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Needed for IPv6. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
To be in same form as collected sockets. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Will need it for IPv6 Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 19 Apr, 2012 4 commits
-
-
Cyrill Gorcunov authored
This allows to have more detailed control over files generated and might be extended in future. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
No need to duplicate variable for pie.lds.S. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Should be -fpie (actually it's not a problem at moment since asm files have simple code and work even without -fpie passed, but better to fix it anyaway). Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
In case if dgram socket peer is not connected back we can try to resolve peer by name. For security reason this happens only if '-x' option is passed at checkpoint and restore time. In particular this is needed for programs which do use dgram socket to send messages to /dev/log. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 18 Apr, 2012 18 commits
-
-
Pavel Emelyanov authored
It's unused, but makes show command show 0, not trash. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
At early days we've been using only a few syscalls which together with debug compiler options always produce relative addresses for memory variables used in parasite and restorer blobs. Thus it came in unnoticed that there is something worng with syscalls declarations we use. Basically all our syscalls are just a wrappers over inline assembly code in form of static long syscall2(int nr, long arg0, long arg1) { long ret; asm volatile( "movl %1, %%eax \t\n" "movq %2, %%rdi \t\n" "movq %3, %%rsi \t\n" "syscall \t\n" "movq %%rax, %0 \t\n" : "=r"(ret) : "g" ((int)nr), "g" (arg0), "g" (arg1) : "rax", "rdi", "rsi", "memory"); return ret; } so every argument treated to be plain long (even if the call sematics implies it's a memory address passed but not some integer direct value) and transferred via general purpose register. As being mentioned it caused no problems when debug options specified at compile time, the compiler do not tries to optimize addressing but generates code which always compute them. The situation is changed if one is building crtools with optimization enabled -- the compiler finds that arguments are rather plain long numbers and might pass direct addresses of variables, instead of generating relative addresses (because function declarations have no pointers and 'g' in cope with 'mov' is used, which is of course wrong). To fix all this -- now syscalls declarations are generated from syscall.def file and function arguments are passed in conform with x86-64 ABI. This shrinks amount of source code needed to declare syscalls and opens a way to use optimization. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Inline assembly is very convenient if a couple of instructions is used but when it grows better to move it out of wrapper C code and write in plain assembly, after all we need a very precise control in bootstrap code. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Since the blob files are generated a different way in compare with plain compiling we use for regular *.c files -- add own Makefile.pie for this target. This increases readability of general Makefile and Makefile.pie itself. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Instead of generating offsets from early compiled object files (one day the offsets obtained from there might be changed during linkage stage) better to get them from a final stage where all object files involved are linked into complete binary blob. That happened that at early stage we indeed were using only single file per parasite and restorer but at present there a couple of file involved (and will be more in future) so we need a safe approach. Also note the symbols being exported are prefixed as "__export_". This is easier approach for now. Putting such symbols into separate section requires a way more efforts to handle. The main reason of having two files (Elf object and binary blob) is to get 1:1 mapping between symbols definition and their position in binary target. The exported symbols name addresses are obtained from object file and used as offsets in binary target. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Build one "section for all" only. This reflects what we really do runtime with generated parasite and restorer blobs. Signle section is named as ".crblob". Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Don't re-read fdinfo image 4 times on restore, just use those collected on me pstree_entry instance. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Later we'll be able to restore them without re-reading the fdinfo file again. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
The plan is to put collected resources on this to avoid seeking the image. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
To follow convention as declared in kernel. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
First argument is void pointer Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
This brings hardness into syscall trasition to asm code, pass this constants in callers. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Will need it for syscalls design transition. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Since we're generating blobs for execution better to use -fpie which serves for such things. Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-