From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47473) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOS8K-0001gH-6V for qemu-devel@nongnu.org; Wed, 17 Oct 2012 07:49:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TOS88-0003KO-V2 for qemu-devel@nongnu.org; Wed, 17 Oct 2012 07:49:56 -0400 Received: from mail-wi0-f175.google.com ([209.85.212.175]:54047) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOS88-0003KK-OM for qemu-devel@nongnu.org; Wed, 17 Oct 2012 07:49:44 -0400 Received: by mail-wi0-f175.google.com with SMTP id hq4so423364wib.10 for ; Wed, 17 Oct 2012 04:49:44 -0700 (PDT) From: edgar.iglesias@gmail.com Date: Wed, 17 Oct 2012 12:42:24 +0200 Message-Id: <1350470544-14425-2-git-send-email-edgar.iglesias@gmail.com> In-Reply-To: <1350470544-14425-1-git-send-email-edgar.iglesias@gmail.com> References: <1350470544-14425-1-git-send-email-edgar.iglesias@gmail.com> Subject: [Qemu-devel] [PATCH 2/2] microblaze: Update PC before simulating syscall List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org From: "Edgar E. Iglesias" Fixes a clone() emulation bug were the new thread starts at the point of the syscall and thus clones in a loop. Signed-off-by: Edgar E. Iglesias --- linux-user/main.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/linux-user/main.c b/linux-user/main.c index f4bbe69..5827ee6 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -2527,6 +2527,7 @@ void cpu_loop(CPUMBState *env) case EXCP_BREAK: /* Return address is 4 bytes after the call. */ env->regs[14] += 4; + env->sregs[SR_PC] = env->regs[14]; ret = do_syscall(env, env->regs[12], env->regs[5], @@ -2537,7 +2538,6 @@ void cpu_loop(CPUMBState *env) env->regs[10], 0, 0); env->regs[3] = ret; - env->sregs[SR_PC] = env->regs[14]; break; case EXCP_HW_EXCP: env->regs[17] = env->sregs[SR_PC] + 4; -- 1.7.8.6