From patchwork Wed Oct 17 10:42:24 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 192025 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E9DD12C009A for ; Wed, 17 Oct 2012 22:50:09 +1100 (EST) Received: from localhost ([::1]:41973 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOS8W-0001r8-1F for incoming@patchwork.ozlabs.org; Wed, 17 Oct 2012 07:50:08 -0400 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:x-mailer:in-reply-to:references; bh=UXAIgZ36ZpydZibLBvTaKNBoLdex16HvGdyuiZ6IijI=; b=kWcoUzEEdsnKXjrQ/0kRJYc4EjhN5MUPJBr9CXV42ZdPofGLrlFnoh7w1bKVhYsRrA NZRPy1INoAmv/Fg8bRtSEWtxa+yIV9NPwxokTvOMK71AWtmLuL5uwZi+9GcJMF6GgDgL H4wnWYTOOEGQWduuumW1k4dwclFiASZ5TI+imXQffFg3VZWsbjrj9oKhb8UOVkE/oKWz yn/P9nEws3J2n9RN+r4KSkHfX5ohKvQbriJkRPccTRc5KEl2PSy73OsARZ8IID5isLQ3 //KHM6bN4cuvA1+c4NHfKxzkKLTVIYJS/r6jj4GhYAQo0XhZPUBTWe5GSVvCiurxKtq1 58zQ== Received: by 10.216.86.6 with SMTP id v6mr5779790wee.42.1350474583970; Wed, 17 Oct 2012 04:49:43 -0700 (PDT) Received: from localhost (rocksteady.se.axis.com. [195.60.68.156]) by mx.google.com with ESMTPS id a10sm27217691wiz.4.2012.10.17.04.49.42 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 17 Oct 2012 04:49:42 -0700 (PDT) From: edgar.iglesias@gmail.com To: qemu-devel@nongnu.org Date: Wed, 17 Oct 2012 12:42:24 +0200 Message-Id: <1350470544-14425-2-git-send-email-edgar.iglesias@gmail.com> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1350470544-14425-1-git-send-email-edgar.iglesias@gmail.com> References: <1350470544-14425-1-git-send-email-edgar.iglesias@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.212.175 Subject: [Qemu-devel] [PATCH 2/2] microblaze: Update PC before simulating syscall X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@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;