[CRIU] [PATCH 3/6] Replace PAGE_SIZE in parasite_map_exchange

Christopher Covington cov at codeaurora.org
Mon Oct 6 11:50:15 PDT 2014


Introduce a page_align(var) macro to replace round_up(var, PAGE_SIZE)
usage with something that uses sysconf(_SC_PAGESIZE).

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

Error (parasite-syscall.c:1112): Can't open 104/map_files/0x3ffb7db0000-0x3ffb7dbb000 on procfs: No such file or directory

Signed-off-by: Christopher Covington <cov at codeaurora.org>
---
 include/asm-generic/page.h | 2 ++
 parasite-syscall.c         | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/asm-generic/page.h b/include/asm-generic/page.h
index a434796..78ec4e7 100644
--- a/include/asm-generic/page.h
+++ b/include/asm-generic/page.h
@@ -4,6 +4,8 @@
 /* Always less than or equal to the size of a page */
 #define PAGE_OR_LESS	4096
 
+#define page_align(a)	round_up(a, sysconf(_SC_PAGESIZE))
+
 #ifndef PAGE_SHIFT
 # define PAGE_SHIFT	12
 #endif
diff --git a/parasite-syscall.c b/parasite-syscall.c
index 7cc1a84..c33bd69 100644
--- a/parasite-syscall.c
+++ b/parasite-syscall.c
@@ -1101,7 +1101,7 @@ int parasite_map_exchange(struct parasite_ctl *ctl, unsigned long size)
 		return -1;
 	}
 
-	ctl->map_length = round_up(size, PAGE_SIZE);
+	ctl->map_length = page_align(size);
 
 	fd = open_proc_rw(ctl->pid.real, "map_files/%p-%p",
 		 ctl->remote_map, ctl->remote_map + ctl->map_length);
-- 
Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by the Linux Foundation.



More information about the CRIU mailing list