fix some vDSO bugs.
- vDSO sometimes becomes invalid. - vDSO is not succeeded for child process. - vDSO becomes invalid when execve. refs #744
This commit is contained in:
@ -1563,6 +1563,7 @@ static int vdso_get_vdso_info(void)
|
|||||||
struct ihk_ikc_channel_desc *ch = cpu_local_var(syscall_channel);
|
struct ihk_ikc_channel_desc *ch = cpu_local_var(syscall_channel);
|
||||||
|
|
||||||
dkprintf("vdso_get_vdso_info()\n");
|
dkprintf("vdso_get_vdso_info()\n");
|
||||||
|
memset(&vdso, '\0', sizeof vdso);
|
||||||
vdso.busy = 1;
|
vdso.busy = 1;
|
||||||
vdso.vdso_npages = 0;
|
vdso.vdso_npages = 0;
|
||||||
|
|
||||||
|
|||||||
@ -100,8 +100,6 @@ void get_vdso_info(ihk_os_t os, long vdso_rpa)
|
|||||||
vdso_pa = ihk_device_map_memory(dev, vdso_rpa, sizeof(*vdso));
|
vdso_pa = ihk_device_map_memory(dev, vdso_rpa, sizeof(*vdso));
|
||||||
vdso = ihk_device_map_virtual(dev, vdso_pa, sizeof(*vdso), NULL, 0);
|
vdso = ihk_device_map_virtual(dev, vdso_pa, sizeof(*vdso), NULL, 0);
|
||||||
|
|
||||||
memset(vdso, 0, sizeof(*vdso));
|
|
||||||
|
|
||||||
/* VDSO pages */
|
/* VDSO pages */
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)
|
||||||
size = vdso_image->size;
|
size = vdso_image->size;
|
||||||
|
|||||||
@ -2198,6 +2198,7 @@ fork_err:
|
|||||||
strcpy(desc->shell_path, shell_path);
|
strcpy(desc->shell_path, shell_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
desc->enable_vdso = enable_vdso;
|
||||||
__dprintf("execve(): load_elf_desc() for %s OK, num sections: %d\n",
|
__dprintf("execve(): load_elf_desc() for %s OK, num sections: %d\n",
|
||||||
path, desc->num_sections);
|
path, desc->num_sections);
|
||||||
|
|
||||||
|
|||||||
@ -332,6 +332,9 @@ int prepare_process_ranges_args_envs(struct thread *thread,
|
|||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
vm->vdso_addr = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
p->rprocess = (unsigned long)thread;
|
p->rprocess = (unsigned long)thread;
|
||||||
p->rpgtable = virt_to_phys(as->page_table);
|
p->rpgtable = virt_to_phys(as->page_table);
|
||||||
|
|||||||
@ -387,6 +387,8 @@ clone_thread(struct thread *org, unsigned long pc, unsigned long sp,
|
|||||||
goto err_free_proc;
|
goto err_free_proc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
thread->vm->vdso_addr = org->vm->vdso_addr;
|
||||||
|
thread->vm->vvar_addr = org->vm->vvar_addr;
|
||||||
thread->proc->maxrss = org->proc->maxrss;
|
thread->proc->maxrss = org->proc->maxrss;
|
||||||
thread->vm->currss = org->vm->currss;
|
thread->vm->currss = org->vm->currss;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user