Commit graph

265 commits

Author SHA1 Message Date
Christopher Covington
f9ae6d9dd4 Replace remaining hard-coded TASK_SIZE use
If we want one CRIU binary to work across all AArch64 kernel
configurations, a single task size value cannot be hard coded. While
trivial applications successfully checkpoint and restore on AArch64
kernels with CONFIG_ARM64_64K_PAGES=y without this patch, replacing
the remaining use of the hard-coded value seems like the best way to
guard against failures that more complex process trees and future uses
may expose.

Signed-off-by: Christopher Covington <cov@codeaurora.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-03 17:14:19 +03:00
Christopher Covington
c0c0546c31 kerndat: Introduce task_size variable
If we want one CRIU binary to work across all AArch64 kernel
configurations, a single task size value cannot be hard coded.

Signed-off-by: Christopher Covington <cov@codeaurora.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-08-03 17:14:15 +03:00
Cyrill Gorcunov
cab42bca65 x86: sigframe -- Don't forget to copy ss
Make sure we don't pass any trash value here, because
the kernel does copy it explicitly. We allocate the
memory for frame as zero filled but stack segment
is special and zero is not acceptable (we've had
a discussion on LKML if we need a special handling
for zero ss but end up that new kernels need new CRIU
version, upon which all agreed). Finally in
commit 296bbf7e3 I managed to hit exactly
this problem :)

Reported-by: Andrey Wagin <avagin@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrey Wagin <avagin@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-07-30 16:35:48 +03:00
Christopher Covington
69d008d567 Use run-time page_size() for mremap
The old and new address parameters passed to the mremap system
call must be page size aligned. On AArch64, the page size can
only be correctly determined at run time. This fixes the following
errors for CRIU on AArch64 kernels with CONFIG_ARM64_64K_PAGES=y.

      call mremap(0x3ffb7d50000, 8192, 8192, MAYMOVE | FIXED, 0x2a000)
  Error (rst-malloc.c:201): Can't mremap rst mem: Invalid argument

      call mremap(0x3ffb7d90000, 8192, 8192, MAYMOVE | FIXED, 0x32000)
  Error (rst-malloc.c:201): Can't mremap rst mem: Invalid argument

Signed-off-by: Christopher Covington <cov@codeaurora.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-07-28 13:38:30 +03:00
Laurent Dufour
ba74350954 ppc64: Add Altivec and VSX support
Add checkpoint and restore of the Altivec and VSX registers.

Currently we rely on the return value of ptrace to detect if the CPU is
supporting these features or not. In the future, we should rely on the
AT_HWCAP vector and check feature at restart time.

Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-07-28 13:35:20 +03:00
Cyrill Gorcunov
296bbf7e33 x86: Add proper ifdefs into sigframe construction
This will help to support compat mode in the future.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-07-28 13:31:55 +03:00
Andrey Vagin
518405cc04 arm: fix syscall numbers for waitid
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-07-24 18:22:35 +03:00
Tycho Andersen
c91cbe3caa add the waitid syscall
We'll use this in the next patch for collecting the zombies without
actually waiting on them.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-07-23 15:17:54 +03:00
Laurent Dufour
6fc15485d0 ppc64: Fix broken SYS V shared memory support
The initial support of the SYS V shared memory on ppc64 is broken. The call
to shmat done in the restore blob has no chance to work correctly.

This patch fixes the sys_shmat call.

Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-06-24 17:57:38 +03:00
Tycho Andersen
a5019ff36b pie/x86_64: syscall clobbers rcx and r11
o_O this is one of those "how has nobody ever hit this" bugs.

According to:

http://stackoverflow.com/questions/2535989/what-are-the-calling-conventions-for-unix-linux-system-calls-on-x86-64

syscall on x86_64 clobbers rcx and r11. We should mark these registers as
clobbered in RUN_CLONE_RESTORE_FN so that gcc avoids using them, e.g.:

...<__export_restore_task>
    ...
    1894: 49 89 db              mov    r11,rbx
    1897: 4c 8d 4c 24 60        lea    r9,[rsp+0x60]
    189c: 48 89 eb              mov    rbx,rbp
    189f: 48 89 44 24 10        mov    QWORD PTR [rsp+0x10],rax
    18a4: 48 8d 44 24 30        lea    rax,[rsp+0x30]
    18a9: 48 89 44 24 18        mov    QWORD PTR [rsp+0x18],rax
    18ae: eb 53                 jmp    1903 <clone_end+0x15>

00000000000018b0 <clone_emul>:
    18b0: 48 8b 74 24 08        mov    rsi,QWORD PTR [rsp+0x8]
    18b5: 48 83 ee 10           sub    rsi,0x10
    18b9: 48 89 ef              mov    rdi,rbp
    18bc: 48 89 7e 08           mov    QWORD PTR [rsi+0x8],rdi
    18c0: 49 8b 7b 20           mov    rdi,QWORD PTR [r11+0x20]
    18c4: 48 89 3e              mov    QWORD PTR [rsi],rdi
    18c7: 48 c7 c7 00 0d 05 00  mov    rdi,0x50d00
    18ce: 48 8b 54 24 18        mov    rdx,QWORD PTR [rsp+0x18]
    18d3: 4d 89 fa              mov    r10,r15
    18d6: b8 38 00 00 00        mov    eax,0x38
    18db: 0f 05                 syscall
    18dd: 48 85 c0              test   rax,rax
    18e0: 74 05                 je     18e7 <thread_run>
    18e2: 48 89 c5              mov    rbp,rax
    18e5: eb 07                 jmp    18ee <clone_end>

00000000000018e7 <thread_run>:
    18e7: 48 31 ed              xor    rbp,rbp
    18ea: 58                    pop    rax
    18eb: 5f                    pop    rdi
    18ec: ff d0                 call   rax

00000000000018ee <clone_end>:
    18ee: 41 83 c5 01           add    r13d,0x1
    18f2: 49 81 c7 00 8c 00 00  add    r15,0x8c00
    18f9: 45 39 6b 14           cmp    DWORD PTR [r11+0x14],r13d

will cause a seg fault because r11 is clobbered.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-06-16 12:17:34 +03:00
Tycho Andersen
e7d89a60b6 add openat() to syscall list
We'll need this for use in the restorer blob for restoring LSMs. It looks like
arm already has openat, so I think it's just x86 and ppc that need it. In any
case, please double check this, as I've only tested it on x86.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-06-11 19:51:40 +03:00
Laurent Dufour
f50e0a6e36 ppc64: Fix buggy floating point register handling
The checkpoint and restore of the Power PC floating point registers is
buggy.

The issue is that the signal frame context is defined to store double value
while the protocol buffer is handling unsigned 64bits integer value. A
silent cast done by the compiler was modifying the restored value in our
back.

This fix changes the type used when manipulating the FP registers value to
be consistent between checkpoint and restart.

Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-06-11 19:49:19 +03:00
Laurent Dufour
89d6b39cfe ppc64: pie -- Add ppc64le relocation's processing
This cleans the assembly code, removing no more needed trick with the
register 2 (TOC pointer). As a consequence, the __export_restore_task_trampoline()
and __export_unmap_trampoline() are no more needed.

Thus, the changes introduced by the commit de9df91002 ("Per architecture restorer
trampolines") in cr-restore.c are no more used but are not impacting
runtime code anyway.

Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-06-08 23:53:30 +03:00
Cyrill Gorcunov
fba12ae9ff arch: x86-32 -- Be able to build 32bit CRIU
After this patch one can run ARCH="ia32" make to build
32bit version on CRIU on 64bit host. Note this is only
build procedure which tuned up, the CRIU itself is not
yet ready to make a checkpoint/restore cycle -- a lot
of additional code is needed and here we rather put
stubs simply to make build procedure run.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-06-08 23:53:22 +03:00
Cyrill Gorcunov
e04f683d85 pie: x86-32 -- Prepare parasite head
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-06-08 23:53:21 +03:00
Cyrill Gorcunov
816c802176 x86: Add 32bit variant of TASK_SIZE
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-06-08 23:53:19 +03:00
Cyrill Gorcunov
918f20648c arch: x86-32 syscalls -- Wire in syscalls generation
To support x86-32 mode we will need own syscall table.
Here is it. Note the CRIU itself doesn't support such
mode yet.

Meanwhile put syscall table here just in case if someone
is adding new syscall 32 bit variant should be updated
as well.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-06-08 23:53:18 +03:00
Laurent Dufour
61c1936ed9 ppc64: Optimizing bit operation
Introduce optimized bit operation for PowerPc

Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-05-14 12:34:37 +03:00
Laurent Dufour
d28984e80e ppc64: Use optimized memcmp
Instead of belonging to the common C memcmp() function, belong on the
optimized one stolen from the kernel.

Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-05-14 12:34:23 +03:00
Laurent Dufour
16ad19410e ppc64: Use optimized memcpy
Instead of belonging to the common C memcpy function, belong on the
optimized one stolen from the kernel.

Cc: Anton Blanchard <anton@au.ibm.com>
Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-05-14 12:33:54 +03:00
Laurent Dufour
892a96c4f3 ppc64: Fix assembly code
Add various register definition to clean the assembly code.

Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-05-14 12:33:43 +03:00
Laurent Dufour
c32add821f ppc64: belong on sysconf to get current page size
Page size may change, so page size should be read through sysconf.

Suggested-by: Christopher Covington <cov@codeaurora.org>
Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-05-05 23:12:13 +03:00
Laurent Dufour
61984edd1a ppc64: fixing comment
Fixing comment leading to think that 32bit tasks are supported, which is
not the case.

For the record, ppc64le is not supporting 32bit task, while ppc64 (the Big
Endian architecture) has an option to support 32bit task but CRIU doesn't
yet run on ppc64.

Reported-by: Christopher Covington <cov@codeaurora.org>
Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-05-05 23:12:09 +03:00
Kir Kolyshkin
3ea2fd78eb crtools.c: fix compilation by clang
Fix the following error:

> >   LINK     arch/x86/syscalls.built-in.o
> > arch/x86/crtools.c:36:20: error: unused function '__check_code_syscall'
> >       [-Werror,-Wunused-function]
> > static inline void __check_code_syscall(void)

As the function consists of a few BUILD_BUG_ONs, it gets optimized out.
Let's add __attribute__((__unused__)) so clang stops complaining.

[v2: s/used/unused/, fix all the arches, whitespace cleanup]

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-05-05 13:44:34 +03:00
Laurent Dufour
de9df91002 Per architecture restorer trampolines
Some architectures like ppc64 requires a trampoline to be called prior to
the standard restorer services.

This patch introduces 3 trampolines which can be overwritten by
architectures in arch/x/include/asm/restore.h:
 - arch_export_restore_thread
 - arch_export_restore_task
 - arch_export_unmap

The architecture which doesn't need to overwrite them, has nothing to do.

Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-05-05 13:35:48 +03:00
Laurent Dufour
303b875892 arch/ppc64: Add PowerPC 64 LE support
This patch initiates the ppc64le architecture support in CRIU.

Note that ppc64 (Big Endian) architecture is not yet supported since there
are still several issues to address with this architecture. However, in the
long term, the two architectures should be addressed using the almost the
same code, so sharing the ppc64 directory.

Major ppc64 issues:

Loader is not involved when the parasite code is loaded. So no relocation
is done for the parasite code. As a consequence r2 must be set manually
when entering the parasite code, and GOT is not filled.

Furthermore, the r2 fixup code at the services's global address which has
not been fixed by the loader should not be run. Branching at local address,
as the assembly code does is jumping over it.

On the long term, relocation should be done when loading the parasite code.

We are introducing 2 trampolines for the 2 entry points of the restorer
blob.  These entry points are dealing with r2. These ppc64 specific entry
points are overwritting the standard one in sigreturn_restore() from
cr-restore.c.  Instead of using #ifdef, we may introduce a per arch wrapper
here.

CRIU needs 2 kernel patches to be run powerpc which are not yet upstream:
 - Tracking the vDSO remapping
 - Enabling the kcmp system call on powerpc

Feature not yet supported:
- Altivec registers C/R
- VSX registers C/R
- TM support
- all lot of things I missed..

Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-30 09:57:49 +03:00
Cyrill Gorcunov
b82a441525 x86: Add explicit type conversion for encode/decode pointer
Eliminate warning on 32bit builds.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 14:52:55 +03:00
Cyrill Gorcunov
05b28b7ba1 x86: Add explicit type conversion in show_rt_xsave_frame
So won't be a warning on x86-32 (I don't like PRI conversion,
it's ugly as hell, plain long is enough here).

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 14:52:55 +03:00
Cyrill Gorcunov
89671a0929 x86: x86-64 syscalls -- Rework build procedure
- Get rid of shell script, we can do everything via make itself in parallel mode
 - Collect syscall related data into syscalls subdirectory (we gonna implement
   32 bit mode soon)
 - We can't drop off __NR_ constants because we're using them in parasite code
   (when we inject dumper and for "criu exec" mode)

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 14:52:55 +03:00
Andrey Vagin
e7c05c5eba ptrace: print PID in error messages
We want to know which process can not be handled.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 14:31:21 +03:00
Christopher Covington
cefe22bdac Use run-time page size where it matters
In AArch64, pages may be 4K or 64K depending on kernel configuration.
The GNU C Library documentation suggests [1], "the correct interface
to query about the page size is sysconf". Introduce one new
architecture-specific function-like macro, page_size(), that on x86
and AArch32 remains a constant so as to minimally affect performance,
but on AArch64 is sysconf(_SC_PAGESIZE) for correctness.

1. https://www.gnu.org/software/libc/manual/html_node/Query-Memory-Parameters.html

To minimize churn, the PAGE_SIZE macro is left as a build-time
estimation of what the run-time page size might be.

This fixes the following errors for CRIU on AArch64 kernels with
CONFIG_ARM64_64K_PAGES=y, allowing dump of
`setsid sleep < /dev/null &> /dev/null` to succeed.

Error (kerndat.c:48): Can't stat self map_files: No such file or directory

Error (util.c:668): Can't read pme for pid 90: No such file or directory

Error (parasite-syscall.c:1135): Can't open 89/map_files/0x3ffb7da0000-0x3ffb7dac000 on procfs: No such file or directory

Signed-off-by: Christopher Covington <cov@codeaurora.org>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-22 15:39:05 +03:00
Andrey Vagin
a67e9f7bb9 vdso: don't play with a function exit code
We should not have a chance to exit with a wrong code on error
paths.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-22 15:36:49 +03:00
Oleg Nesterov
80c92e90c2 report the potential selinux problem if mmap_seized() fails
selinux can deny mmap(PROT_WRITE | PROT_EXEC) and in this case it is
not clear why CRIU fails, "Can't allocate memory for parasite blob"
doesn't tell too much. Add a pr_warn() hint for the user.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Cyrill Gorcunov<gorcunov@openvz.org>
Acked-by: Ruslan Kuprieiev <rkuprieiev@cloudlinux.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-22 13:29:01 +03:00
Yixun Lan
b56b4204d1 aarch64: fix undefined "struct user_regs_struct_t" error
tested under Gentoo Linux, with sys-kernel/linux-headers-3.19 installed
"struct user_pt_regs" is defined at file /usr/include/asm/ptrace.h

Signed-off-by: Yixun Lan <yixun.lan@gmail.com>
Reviewed-by: Christopher Covington <cov@codeaurora.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-14 16:05:46 +03:00
Cyrill Gorcunov
8ec2ea8288 x86: syscall -- Drop redundant _sys_ part from definition
Somehow _sys_ token sneaked into __NR term. Drop it off
to be close to kernel's representation.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-09 19:21:30 +03:00
Oleg Nesterov
dd71cca58a dump/x86: sanitize the ERESTART_RESTARTBLOCK -> EINTR transition
1. The -ERESTART_RESTARTBLOCK case in get_task_regs() depends on kernel
   internals too much, and for no reason. We shouldn't rely on fact that
   a) we are going to do sigreturn() and b) restore_sigcontext() always
   sets restart_block->fn = do_no_restart_syscall which returns -EINTR.

   Just change this code to enforce -EINTR after restore, this is what
   we actually want until we teach criu to handle ERESTART_RESTARTBLOCK.

2. Add pr_warn() to make the potential bug-reports more understandable,
   a sane application should handle -EINTR correctly but this is not
   always the case.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-03-26 14:10:32 +03:00
Oleg Nesterov
07dcf0dbb6 restore/x86: restore_gpregs() needs to initialize ->ss as well
Before the recent "x86_64,signal: Fix SS handling for signals delivered
to 64-bit programs" kernel patch, sigreturn paths forgot to restore ->ss
after return from the signal handler.

Now that the kernel was fixed, restore_gpregs() has to initialize ->ss
too, it is no longer ignored.

Note: this is the minimal fix. In the long term we probably should not
dump/restore the segment registers at all. We can use sigcontext filled
by the target kernel and modify the general-purpose regs.

Reported-and-tested-by: Andrey Wagin <avagin@gmail.com>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-03-20 16:29:59 +03:00
Pavel Emelyanov
e29c9daec2 img: Remove O_OPT and COLLECT_OPTIONAL
Current code doesn't make any difference between OPT and no-OPT
except for the message is printed or not in the open_image().
So this particular change changes nothing but the availability of
this message.

In the next patches I wil introduce "empty images" to deal with
the ENOENT situation in a more graceful manner.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-03-13 14:42:01 +03:00
Christopher Covington
70f28122e5 aarch64: Fix restore for multithreaded processes
The stack handling in the RUN_CLONE_RESTORE_FN macro for
AArch64 was incorrect, resulting in a segfault of the restored
process. With this change the pthread00 test case (and probably
others) runs to completion and passes.

Signed-off-by: Christopher Covington <cov@codeaurora.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-01-12 14:51:57 +03:00
Cyrill Gorcunov
fd07bc7791 cpu: Add 'ins' mode to --cpu-cap option
In this mode we test if target cpu has all features present
in image file but do not require bit to bit match: target cpu
may be a new one with more features present.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-12-26 18:15:46 +03:00
Pavel Emelyanov
80cf042695 x86: Add io syscalls
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-12-26 18:13:33 +03:00
Cyrill Gorcunov
f165bdc93c cpu: x86 -- Fix --cpu-cap=fpu handling on restore mode
Our CPU_CAP_s are bitmaps so if cpuinfo image is present
but we require only FPU to check we need to check this
bit being sole on comman line.

It was a typo in first place which caused statement to
be false always (it's not a problem though and not a
@stable candidate because with this mistake we fall
into strict match cpu mode).

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-12-25 21:12:05 +03:00
Andrew Vagin
7f4afef2cf arm: fix compilation on ARMv6
Cc: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Tested-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-12-22 17:41:33 +03:00
Ruslan Kuprieiev
5d9c83cf88 arch:aarch64: add atomic_cmpxchg
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-12-08 15:55:55 +03:00
Ruslan Kuprieiev
3a2d171976 arch:arm: add atomic_cmpxchg
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-12-08 15:55:53 +03:00
Ruslan Kuprieiev
424162b075 arch:x86: add atomic_cmpxchg
Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-12-08 15:55:52 +03:00
Andrey Vagin
77905aae19 dump: get tasks ids from parasite
We have two reason for that:
* parsing of /proc/pid/status is slow
* parasite returns ids from a target userns

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-11-07 17:14:32 +04:00
Andrey Vagin
de71c48079 syscall: add memfd_create() (v3)
v2: Follow the kerndat style that "features" are described
just by global boolean variables.

v3: give NULL as a name to get EFAULT if memfd_create is supported
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-10-23 19:57:10 +04:00
Christopher Covington
f3afc1da12 AArch64: Remove TASK_SIZE from mmap_seized
TASK_SIZE for AArch64 may be any of several options between (1 << 39)
and (1 << 48), inclusive, depending on kernel configuration. Go back
to just checking the most significant bit, as was done before commit
3f12d688ae was made to accomodate 32-bit
ARM (before mmap_seized got architecture-specific implementations).

This fixes the following error for AArch64 kernels with
CONFIG_ARM64_64K_PAGES=y.

Error (parasite-syscall.c:1105): Can't allocate memory for parasite blob (pid: 104)

Signed-off-by: Christopher Covington <cov@codeaurora.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-10-07 15:46:47 +04:00
Pavel Emelyanov
ebada5b274 cpuinfo: Don't report negative values to shell
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-10-07 15:44:12 +04:00