From patchwork Fri May 27 13:00:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 627129 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rGRGY6lMgz9t3f for ; Fri, 27 May 2016 23:11:01 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b=cPx2cQgF; dkim-atps=neutral Received: from localhost ([::1]:45741 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6HXX-0000by-Th for incoming@patchwork.ozlabs.org; Fri, 27 May 2016 09:10:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37211) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6HNd-0007IA-Pt for qemu-devel@nongnu.org; Fri, 27 May 2016 09:00:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b6HNc-00019W-Q9 for qemu-devel@nongnu.org; Fri, 27 May 2016 09:00:45 -0400 Received: from mail-lb0-x22c.google.com ([2a00:1450:4010:c04::22c]:34448) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6HNc-000193-IZ for qemu-devel@nongnu.org; Fri, 27 May 2016 09:00:44 -0400 Received: by mail-lb0-x22c.google.com with SMTP id sh2so31744704lbb.1 for ; Fri, 27 May 2016 06:00:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=i5NWqGsVk9R+/9afiktYy5UVfu6YwYaB7DA4xa0PP9U=; b=cPx2cQgF8rpcxRFe782706xAY89xxsuMA4ORBEeggWU1FfLYrlxGkqVtLG+II+L0ig 7D86iVm5UWcKaO+evM6OalC6EZHiJpqJhouD4XwmlEOQEYLtQ9sraD28dsLSl1rqQCM2 boQ+PRRc5obBNvdZlNXuOJM4i43y6mRHG4vYo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=i5NWqGsVk9R+/9afiktYy5UVfu6YwYaB7DA4xa0PP9U=; b=J5IgFzwaliThbgU0PG3NVRvaENp8Em9EjGpxxn7rUQ+QSDSxeWedivLRyvMGsaXojY 2ZOxTNlZXEFwC1PfMPTJ5a+PxjjJxjQi9Jty5qXfTDF56bo2HV0nVl0AY89ewcy7OwSe 0sRtUI0J1p0TiYl8q45Sq+M8X+fSUjO6I4UePq+9ci/TiMWes3bbOH8VCx7OkZP2FDfQ mr+QZcAC5J5EMTANemyHsrAzpj8wvaoEUCk6lqVB/aWOpVaXoUuTt2zTaZvCLQhtfIT6 XXKPFnqNTv6qk0s0Up88qajPGublcSQ4q/uJI/BmRhYJ4pFCcxTdpk2mSY3RnoQAN3rY Uv7Q== X-Gm-Message-State: ALyK8tLclmeqxjc3UwzoWd2b58xEH8KeZ+JGK+KBzF1D2x0/U0CAq/lAFJEg2PaxSSbIyQdy X-Received: by 10.112.125.228 with SMTP id mt4mr4416201lbb.136.1464354043661; Fri, 27 May 2016 06:00:43 -0700 (PDT) Received: from beaming.home (91-157-168-132.elisa-laajakaista.fi. [91.157.168.132]) by smtp.gmail.com with ESMTPSA id n16sm2281066lfg.31.2016.05.27.06.00.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 27 May 2016 06:00:42 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Fri, 27 May 2016 16:00:00 +0300 Message-Id: <6db9d00e2f05db0dfcc1a4d8b811fdd40170c91c.1464353863.git.riku.voipio@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c04::22c Subject: [Qemu-devel] [PULL v2 09/38] linux-user: Support for restarting system calls for PPC targets X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Timothy E Baldwin Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Timothy E Baldwin Update the PPC main loop code: * on TARGET_ERESTARTSYS, wind guest PC backwards to repeat syscall insn (We already handle TARGET_QEMU_ESIGRETURN.) Signed-off-by: Timothy Edward Baldwin Message-id: 1441497448-32489-8-git-send-email-T.E.Baldwin99@members.leeds.ac.uk Reviewed-by: Peter Maydell [PMM: tweak commit message; drop TARGET_USE_ERESTARTSYS define] Signed-off-by: Peter Maydell Signed-off-by: Riku Voipio --- linux-user/main.c | 4 ++++ linux-user/ppc/target_signal.h | 1 + 2 files changed, 5 insertions(+) diff --git a/linux-user/main.c b/linux-user/main.c index 73e3668..dfc098f 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -1987,6 +1987,10 @@ void cpu_loop(CPUPPCState *env) ret = do_syscall(env, env->gpr[0], env->gpr[3], env->gpr[4], env->gpr[5], env->gpr[6], env->gpr[7], env->gpr[8], 0, 0); + if (ret == -TARGET_ERESTARTSYS) { + env->nip -= 4; + break; + } if (ret == (target_ulong)(-TARGET_QEMU_ESIGRETURN)) { /* Returning from a successful sigreturn syscall. Avoid corrupting register state. */ diff --git a/linux-user/ppc/target_signal.h b/linux-user/ppc/target_signal.h index a93b5cf..4f01dd4 100644 --- a/linux-user/ppc/target_signal.h +++ b/linux-user/ppc/target_signal.h @@ -26,4 +26,5 @@ static inline abi_ulong get_sp_from_cpustate(CPUPPCState *state) return state->gpr[1]; } + #endif /* TARGET_SIGNAL_H */