VM: live update - check for regions above stack
If the stack is not mapped at the VM_DATATOP (e.g. booted with ac_layout = 1), there might be some more regions hiding above the stack. We also have to transfer those. Change-Id: Idf3b94a36fcec8a10ace2f6dffe816faf0a88f60
This commit is contained in:
parent
8f4f859b35
commit
a6db4d0a62
1 changed files with 28 additions and 0 deletions
|
@ -242,6 +242,12 @@ int swap_proc_dyn_data(struct vmproc *src_vmp, struct vmproc *dst_vmp,
|
|||
printf("swap_proc_dyn_data: pt_map_in_range failed\n");
|
||||
return r;
|
||||
}
|
||||
r = pt_map_in_range(src_vmp, dst_vmp, VM_STACKTOP, VM_DATATOP);
|
||||
if(r != OK) {
|
||||
printf("swap_proc_dyn_data: pt_map_in_range failed\n");
|
||||
return r;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#if LU_DEBUG
|
||||
|
@ -280,6 +286,28 @@ int swap_proc_dyn_data(struct vmproc *src_vmp, struct vmproc *dst_vmp,
|
|||
}
|
||||
}
|
||||
|
||||
/* If the stack is not mapped at the VM_DATATOP, there might be some
|
||||
* more regions hiding above the stack. We also have to transfer
|
||||
* those.
|
||||
*/
|
||||
if (VM_STACKTOP == VM_DATATOP)
|
||||
return OK;
|
||||
|
||||
start_vr = region_search(&dst_vmp->vm_regions_avl, VM_STACKTOP, AVL_GREATER_EQUAL);
|
||||
end_vr = region_search(&dst_vmp->vm_regions_avl, VM_DATATOP, AVL_LESS);
|
||||
|
||||
if(start_vr) {
|
||||
#if LU_DEBUG
|
||||
printf("VM: swap_proc_dyn_data: tranferring memory mapped regions from %d to %d\n",
|
||||
dst_vmp->vm_endpoint, src_vmp->vm_endpoint);
|
||||
#endif
|
||||
assert(end_vr);
|
||||
r = map_proc_copy_range(src_vmp, dst_vmp, start_vr, end_vr);
|
||||
if(r != OK) {
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue