don't map syscall pages into process space
Request pages, response pages, and a doorbell page are mapped into process space to enable user processes to delegate system calls directly to mcctrl/mcexec. This commit removes these mappings for the following reasons. - These mappings cause a memory leak in current fork() implementation. - These mappings are not used. - These mappings do not function properly. And the fix which corrects function of these mappings is not easy.
This commit is contained in:
@ -191,38 +191,10 @@ int prepare_process_ranges_args_envs(struct process *proc,
|
||||
proc->vm->region.data_end;
|
||||
#endif
|
||||
|
||||
/* Map system call stuffs */
|
||||
flags = VR_RESERVED | VR_PROT_READ | VR_PROT_WRITE;
|
||||
flags |= VRFLAG_PROT_TO_MAXPROT(flags);
|
||||
addr = proc->vm->region.map_start - PAGE_SIZE * SCD_RESERVED_COUNT;
|
||||
e = addr + PAGE_SIZE * DOORBELL_PAGE_COUNT;
|
||||
if(add_process_memory_range(proc, addr, e,
|
||||
cpu_local_var(scp).doorbell_pa,
|
||||
VR_REMOTE | flags, NULL, 0) != 0){
|
||||
kprintf("ERROR: adding memory range for syscalls dorbell\n");
|
||||
goto err;
|
||||
}
|
||||
addr = e;
|
||||
e = addr + PAGE_SIZE * REQUEST_PAGE_COUNT;
|
||||
if(add_process_memory_range(proc, addr, e,
|
||||
cpu_local_var(scp).request_pa,
|
||||
VR_REMOTE | flags, NULL, 0) != 0){
|
||||
kprintf("ERROR: adding memory range for syscalls request pa\n");
|
||||
goto err;
|
||||
}
|
||||
addr = e;
|
||||
e = addr + PAGE_SIZE * RESPONSE_PAGE_COUNT;
|
||||
if(add_process_memory_range(proc, addr, e,
|
||||
cpu_local_var(scp).response_pa,
|
||||
flags, NULL, 0) != 0){
|
||||
kprintf("ERROR: adding memory range for syscalls response pa\n");
|
||||
goto err;
|
||||
}
|
||||
|
||||
/* Map, copy and update args and envs */
|
||||
flags = VR_PROT_READ | VR_PROT_WRITE;
|
||||
flags |= VRFLAG_PROT_TO_MAXPROT(flags);
|
||||
addr = e;
|
||||
addr = proc->vm->region.map_start - PAGE_SIZE * SCD_RESERVED_COUNT;
|
||||
e = addr + PAGE_SIZE * ARGENV_PAGE_COUNT;
|
||||
|
||||
if((args_envs = ihk_mc_alloc_pages(ARGENV_PAGE_COUNT, IHK_MC_AP_NOWAIT)) == NULL){
|
||||
|
||||
@ -22,8 +22,7 @@
|
||||
#define RESPONSE_PAGE_COUNT 16
|
||||
#define DOORBELL_PAGE_COUNT 1
|
||||
#define ARGENV_PAGE_COUNT 8
|
||||
#define SCD_RESERVED_COUNT \
|
||||
(REQUEST_PAGE_COUNT + RESPONSE_PAGE_COUNT + DOORBELL_PAGE_COUNT + ARGENV_PAGE_COUNT)
|
||||
#define SCD_RESERVED_COUNT ARGENV_PAGE_COUNT
|
||||
|
||||
#define SCD_MSG_PREPARE_PROCESS 0x1
|
||||
#define SCD_MSG_PREPARE_PROCESS_ACKED 0x2
|
||||
|
||||
Reference in New Issue
Block a user