mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-25 02:58:54 +00:00
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>
21 lines
371 B
C
21 lines
371 B
C
#ifndef __CR_ASM_PAGE_H__
|
|
#define __CR_ASM_PAGE_H__
|
|
|
|
#include <unistd.h>
|
|
|
|
#ifndef PAGE_SHIFT
|
|
# define PAGE_SHIFT 12
|
|
#endif
|
|
|
|
#ifndef PAGE_SIZE
|
|
# define PAGE_SIZE (1UL << PAGE_SHIFT)
|
|
#endif
|
|
|
|
#ifndef PAGE_MASK
|
|
# define PAGE_MASK (~(PAGE_SIZE - 1))
|
|
#endif
|
|
|
|
#define PAGE_PFN(addr) ((addr) / PAGE_SIZE)
|
|
#define page_size() sysconf(_SC_PAGESIZE)
|
|
|
|
#endif /* __CR_ASM_PAGE_H__ */
|