Commit f33df79e authored by Huang Qiang's avatar Huang Qiang Committed by Pavel Emelyanov

cr-restore: fix to print correct length of bootstrap

The length of bootstrap in the print is old and wrong, we need to fix
it and unify the length variable.
Signed-off-by: 's avatarHuang Qiang <h.huangqiang@huawei.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 60d382f9
...@@ -1318,6 +1318,7 @@ static int sigreturn_restore(pid_t pid, CoreEntry *core, struct list_head *tgt_v ...@@ -1318,6 +1318,7 @@ static int sigreturn_restore(pid_t pid, CoreEntry *core, struct list_head *tgt_v
long new_sp, exec_mem_hint; long new_sp, exec_mem_hint;
long ret; long ret;
long restore_bootstrap_len;
struct task_restore_core_args *task_args; struct task_restore_core_args *task_args;
struct thread_restore_args *thread_args; struct thread_restore_args *thread_args;
...@@ -1362,21 +1363,22 @@ static int sigreturn_restore(pid_t pid, CoreEntry *core, struct list_head *tgt_v ...@@ -1362,21 +1363,22 @@ static int sigreturn_restore(pid_t pid, CoreEntry *core, struct list_head *tgt_v
current->nr_threads, current->nr_threads,
KBYTES(restore_thread_vma_len)); KBYTES(restore_thread_vma_len));
restore_bootstrap_len = restorer_len +
restore_task_vma_len +
restore_thread_vma_len +
SHMEMS_SIZE + TASK_ENTRIES_SIZE +
self_vmas_len + vmas_len +
rst_tcp_socks_size;
exec_mem_hint = restorer_get_vma_hint(pid, tgt_vmas, &self_vma_list, exec_mem_hint = restorer_get_vma_hint(pid, tgt_vmas, &self_vma_list,
restorer_len + restore_bootstrap_len);
restore_task_vma_len +
restore_thread_vma_len +
self_vmas_len + vmas_len +
SHMEMS_SIZE + TASK_ENTRIES_SIZE +
rst_tcp_socks_size);
if (exec_mem_hint == -1) { if (exec_mem_hint == -1) {
pr_err("No suitable area for task_restore bootstrap (%ldK)\n", pr_err("No suitable area for task_restore bootstrap (%ldK)\n",
restore_task_vma_len + restore_thread_vma_len); restore_bootstrap_len);
goto err; goto err;
} }
pr_info("Found bootstrap VMA hint at: 0x%lx (needs ~%ldK)\n", exec_mem_hint, pr_info("Found bootstrap VMA hint at: 0x%lx (needs ~%ldK)\n", exec_mem_hint,
KBYTES(restore_task_vma_len + restore_thread_vma_len)); KBYTES(restore_bootstrap_len));
ret = remap_restorer_blob((void *)exec_mem_hint); ret = remap_restorer_blob((void *)exec_mem_hint);
if (ret < 0) if (ret < 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment