Received: from eggs.gnu.org ([2001:4830:134:3::10]:38714) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEbBi-0000Lj-0d for qemu-devel@nongnu.org; Fri, 23 Jan 2015 05:10:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YEbBd-0004MA-Sb for qemu-devel@nongnu.org; Fri, 23 Jan 2015 05:10:01 -0500 Message-ID: <54C21FB2.1050603@sunrus.com.cn> Date: Fri, 23 Jan 2015 18:17:22 +0800 From: Chen Gang S MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] linux-user/main.c: Remove redundant end_exclusive() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: riku.voipio@iki.fi Cc: QEMU Trivial , qemu-devel start/end_exclusive() need be pairs, except the start_exclusive() in stop_all_tasks() which is only used by force_sig(), which will be abort. So at present, start_exclusive() in stop_all_task() need not be paired. So need remove end_exclusive() after queue_signal(). If could really return from queue_signal(), which meant stop_all_task() is not called ( at least, not called in time), the next end_exclusive() would be issue. Also use TARGET_SIGSEGV instead of SIGSEGV, since queue_signal() is for TARGET_*, at present, queue_signal() is a normal function which may call force_sig(), or return (may kill pid or queue signal, then return). Signed-off-by: Chen Gang --- linux-user/main.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/linux-user/main.c b/linux-user/main.c index 8c70be4..a410a17 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -517,14 +517,12 @@ segv: end_exclusive(); /* We get the PC of the entry address - which is as good as anything, on a real kernel what you get depends on which mode it uses. */ - info.si_signo = SIGSEGV; + info.si_signo = TARGET_SIGSEGV; info.si_errno = 0; /* XXX: check env->error_code */ info.si_code = TARGET_SEGV_MAPERR; info._sifields._sigfault._addr = env->exception.vaddress; queue_signal(env, info.si_signo, &info); - - end_exclusive(); } /* Handle a jump to the kernel code page. */ -- 1.9.3 (Apple Git-50)