From e2e0fad849886285518c65f67af532354282e02d Mon Sep 17 00:00:00 2001 From: NAKAMURA Gou Date: Thu, 21 Apr 2016 21:07:44 +0900 Subject: [PATCH] arch_clear_host_user_space: set zero to args[2] to avoid duplicated per_proc_list entry. --- arch/x86/kernel/syscall.c | 12 +++++------- kernel/include/syscall.h | 1 + kernel/syscall.c | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/arch/x86/kernel/syscall.c b/arch/x86/kernel/syscall.c index bed2d960..1f62ebdf 100644 --- a/arch/x86/kernel/syscall.c +++ b/arch/x86/kernel/syscall.c @@ -137,14 +137,12 @@ int obtain_clone_cpuid() { int arch_clear_host_user_space() { - struct syscall_request request IHK_DMA_ALIGN; + struct thread *th = cpu_local_var(current); - request.number = __NR_munmap; - request.args[0] = cpu_local_var(current)->vm->region.user_start; - request.args[1] = cpu_local_var(current)->vm->region.user_end - - cpu_local_var(current)->vm->region.user_start; - - return do_syscall(&request, ihk_mc_get_processor_id(), 0); + /* XXX: might be unnecessary */ + clear_host_pte(th->vm->region.user_start, + (th->vm->region.user_end - th->vm->region.user_start)); + return 0; } SYSCALL_DECLARE(rt_sigaction) diff --git a/kernel/include/syscall.h b/kernel/include/syscall.h index d8206de8..4aaf3244 100644 --- a/kernel/include/syscall.h +++ b/kernel/include/syscall.h @@ -365,6 +365,7 @@ void reset_cputime(); void set_cputime(int mode); intptr_t do_mmap(intptr_t addr0, size_t len0, int prot, int flags, int fd, off_t off0); +void clear_host_pte(uintptr_t addr, size_t len); typedef int32_t key_t; int do_shmget(key_t key, size_t size, int shmflg); struct process_vm; diff --git a/kernel/syscall.c b/kernel/syscall.c index 748850dc..7106e03f 100644 --- a/kernel/syscall.c +++ b/kernel/syscall.c @@ -833,7 +833,7 @@ SYSCALL_DECLARE(exit_group) return 0; } -static void clear_host_pte(uintptr_t addr, size_t len) +void clear_host_pte(uintptr_t addr, size_t len) { ihk_mc_user_context_t ctx; long lerror;