mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-18 00:58:31 +00:00
vdso: move VMAs traverse cycle in vdso_proxify()
Reduce __export_restore_task(), which is fat and too long, drop needless parameter from vdso_proxify() and drop also that find-tuple logic, which isn't needed really. Acked-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
parent
2261748e41
commit
9062e59e5e
3 changed files with 20 additions and 25 deletions
|
|
@ -82,7 +82,7 @@ static inline bool is_vdso_mark(void *addr)
|
|||
extern int vdso_do_park(struct vdso_symtable *sym_rt, unsigned long park_at, unsigned long park_size);
|
||||
extern int vdso_map_compat(unsigned long map_at);
|
||||
extern int vdso_proxify(struct vdso_symtable *sym_rt,
|
||||
unsigned long vdso_rt_parked_at, size_t index,
|
||||
unsigned long vdso_rt_parked_at,
|
||||
VmaEntry *vmas, size_t nr_vmas, bool compat_vdso);
|
||||
|
||||
#else /* CONFIG_VDSO */
|
||||
|
|
|
|||
|
|
@ -104,26 +104,29 @@ int __vdso_fill_symtable(uintptr_t mem, size_t size,
|
|||
#endif
|
||||
|
||||
int vdso_proxify(struct vdso_symtable *sym_rt,
|
||||
unsigned long vdso_rt_parked_at, size_t index,
|
||||
unsigned long vdso_rt_parked_at,
|
||||
VmaEntry *vmas, size_t nr_vmas, bool compat_vdso)
|
||||
{
|
||||
VmaEntry *vma_vdso = NULL, *vma_vvar = NULL;
|
||||
struct vdso_symtable s = VDSO_SYMTABLE_INIT;
|
||||
bool remap_rt = false;
|
||||
unsigned int i;
|
||||
|
||||
/*
|
||||
* Figure out which kind of vdso tuple we get.
|
||||
*/
|
||||
if (vma_entry_is(&vmas[index], VMA_AREA_VDSO))
|
||||
vma_vdso = &vmas[index];
|
||||
else if (vma_entry_is(&vmas[index], VMA_AREA_VVAR))
|
||||
vma_vvar = &vmas[index];
|
||||
for (i = 0; i < nr_vmas; i++) {
|
||||
if (vma_entry_is(&vmas[i], VMA_AREA_VDSO))
|
||||
vma_vdso = &vmas[i];
|
||||
else if (vma_entry_is(&vmas[i], VMA_AREA_VVAR))
|
||||
vma_vvar = &vmas[i];
|
||||
}
|
||||
|
||||
if (index < (nr_vmas - 1)) {
|
||||
if (vma_entry_is(&vmas[index + 1], VMA_AREA_VDSO))
|
||||
vma_vdso = &vmas[index + 1];
|
||||
else if (vma_entry_is(&vmas[index + 1], VMA_AREA_VVAR))
|
||||
vma_vvar = &vmas[index + 1];
|
||||
if (!vma_vdso && !vma_vvar) {
|
||||
pr_info("No VVAR, no vDSO in image\n");
|
||||
/*
|
||||
* We don't have to unmap rt-vdso, rt-vvar as they will
|
||||
* be unmapped with restorer blob in the end,
|
||||
* see __export_unmap()
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!vma_vdso) {
|
||||
|
|
|
|||
|
|
@ -1185,17 +1185,9 @@ long __export_restore_task(struct task_restore_args *args)
|
|||
/*
|
||||
* Proxify vDSO.
|
||||
*/
|
||||
for (i = 0; i < args->vmas_n; i++) {
|
||||
if (vma_entry_is(&args->vmas[i], VMA_AREA_VDSO) ||
|
||||
vma_entry_is(&args->vmas[i], VMA_AREA_VVAR)) {
|
||||
if (vdso_proxify(&args->vdso_sym_rt,
|
||||
args->vdso_rt_parked_at,
|
||||
i, args->vmas, args->vmas_n,
|
||||
args->compatible_mode))
|
||||
goto core_restore_end;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (vdso_proxify(&args->vdso_sym_rt, args->vdso_rt_parked_at,
|
||||
args->vmas, args->vmas_n, args->compatible_mode))
|
||||
goto core_restore_end;
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue