From 9fa62adfe7c8ce32d954b4b411bb8e5e1fd616d6 Mon Sep 17 00:00:00 2001 From: Balazs Gerofi Date: Mon, 10 Aug 2015 14:18:11 +0900 Subject: [PATCH] execve(): stay compliant with locked context switching --- kernel/syscall.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/syscall.c b/kernel/syscall.c index fda9f0b2..818232b6 100644 --- a/kernel/syscall.c +++ b/kernel/syscall.c @@ -1833,6 +1833,10 @@ SYSCALL_DECLARE(execve) dkprintf("execve(): switching to new process\n"); proc->execed = 1; + /* Lock run queue because enter_user_mode expects to release it */ + cpu_local_var(runq_irqstate) = + ihk_mc_spinlock_lock(&(get_this_cpu_local_var()->runq_lock)); + ihk_mc_switch_context(NULL, &cpu_local_var(current)->ctx, cpu_local_var(current));