[CRIU] [PATCH 2/9] x86: fixed the value of the macro TASK_SIZE to match the kernel one

Alexander Kartashov alekskartashov at parallels.com
Wed Jan 16 03:28:24 EST 2013


This makes it possible to use TASK_SIZE instead of TASK_SIZE_MAX.

Signed-off-by: Alexander Kartashov <alekskartashov at parallels.com>
---
 arch/x86/include/asm/types.h |    2 +-
 cr-restore.c                 |    3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/x86/include/asm/types.h b/arch/x86/include/asm/types.h
index acf224c..837daa8 100644
--- a/arch/x86/include/asm/types.h
+++ b/arch/x86/include/asm/types.h
@@ -247,7 +247,7 @@ typedef struct {
 # define MADV_DONTDUMP 16
 #endif
 
-#define TASK_SIZE ((1UL << 47) - 1)
+#define TASK_SIZE ((1UL << 47) - PAGE_SIZE)
 
 typedef uint64_t auxv_t;
 
diff --git a/cr-restore.c b/cr-restore.c
index 9350ed2..b4e489a 100644
--- a/cr-restore.c
+++ b/cr-restore.c
@@ -1262,7 +1262,6 @@ int cr_restore_tasks(pid_t pid, struct cr_options *opts)
 	return restore_root_task(root_item, opts);
 }
 
-#define TASK_SIZE_MAX   ((1UL << 47) - PAGE_SIZE)
 static long restorer_get_vma_hint(pid_t pid, struct list_head *tgt_vma_list,
 		struct list_head *self_vma_list, long vma_len)
 {
@@ -1270,7 +1269,7 @@ static long restorer_get_vma_hint(pid_t pid, struct list_head *tgt_vma_list,
 	long prev_vma_end = 0;
 	struct vma_area end_vma;
 
-	end_vma.vma.start = end_vma.vma.end = TASK_SIZE_MAX;
+	end_vma.vma.start = end_vma.vma.end = TASK_SIZE;
 	prev_vma_end = PAGE_SIZE * 0x10; /* CONFIG_LSM_MMAP_MIN_ADDR=65536 */
 
 	s_vma = list_first_entry(self_vma_list, struct vma_area, list);
-- 
1.7.10.4



More information about the CRIU mailing list