criu/arch/arm/include/asm
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
..
atomic.h arm: fix compilation on ARMv6 2014-12-22 17:41:33 +03:00
bitops.h asm: convert the ARM implementation of bit operations to the reference 2014-03-12 00:18:03 +04:00
bitsperlong.h headers: types.h -- Move BITS_PER_LONG to own header 2013-04-02 20:31:41 +04:00
cpu.h arm: added missing asm/cpu.h 2013-02-20 14:54:38 +04:00
dump.h cr: generalize the type to store the value of the TLS register 2014-03-19 10:41:39 +04:00
fpu.h fpu: Move definitions to asm/fpu.h 2013-02-18 18:42:08 +04:00
int.h cr: collect short integer aliases in the single place 2014-04-08 15:35:46 +04:00
linkage.h arm: added ARM-specific files modelled after arch/x86 2013-01-22 22:53:24 +04:00
page.h Use run-time page size where it matters 2015-04-22 15:39:05 +03:00
parasite-syscall.h parasite: allocate stack for each thread 2013-05-24 18:53:33 +04:00
parasite.h cr: generalize the type to store the value of the TLS register 2014-03-19 10:41:39 +04:00
processor-flags.h arm: added ARM-specific files modelled after arch/x86 2013-01-22 22:53:24 +04:00
processor.h arch:arm: add atomic_cmpxchg 2014-12-08 15:55:53 +03:00
restore.h cr: generalize the type to store the value of the TLS register 2014-03-19 10:41:39 +04:00
restorer.h ptrace: flush breakpoints 2014-09-22 18:03:03 +04:00
string.h asm: Move builtin_memcpy helper into asm/string.h 2013-05-23 16:51:06 +04:00
syscall-aux.h arm: added ARM-specific files modelled after arch/x86 2013-01-22 22:53:24 +04:00
syscall-aux.S arm: refactor the syscall glue to support ARMv6 2013-07-10 15:57:26 +04:00
types.h Use run-time page size where it matters 2015-04-22 15:39:05 +03:00