From patchwork Wed May 25 10:31:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 626108 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 3rF8Ft5Jt3z9sC4 for ; Wed, 25 May 2016 20:50:58 +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=hVQGrjef; dkim-atps=neutral Received: from localhost ([::1]:58892 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5WOu-0001Hw-2Z for incoming@patchwork.ozlabs.org; Wed, 25 May 2016 06:50:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41347) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5W74-000180-M3 for qemu-devel@nongnu.org; Wed, 25 May 2016 06:32:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b5W6p-00034Q-Js for qemu-devel@nongnu.org; Wed, 25 May 2016 06:32:29 -0400 Received: from mail-lf0-x22b.google.com ([2a00:1450:4010:c07::22b]:35085) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5W6o-00033L-7M for qemu-devel@nongnu.org; Wed, 25 May 2016 06:32:15 -0400 Received: by mail-lf0-x22b.google.com with SMTP id w16so4189803lfd.2 for ; Wed, 25 May 2016 03:32:14 -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=6wSOyydaSpPS1VjgSHjZV/9x0dKRzUeOm2npmKgSIAM=; b=hVQGrjefk7+vchPd1N8R7NaaMsEl+sd+cG91AprJnYieNL2txb+TXXryEx2307T9tx hfKClnFz41datWnS3Aswe+RJ7CZfDX0y1iV4gDz22AOi0nLkeMAuNwqBFKTQdZBU9VXh v52X8dt7hSXkw6d5gwn2xmbEgc8OfQXSji32I= 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=6wSOyydaSpPS1VjgSHjZV/9x0dKRzUeOm2npmKgSIAM=; b=XDUljR8hpa3WLziAuSC4//QeD2oE0KV10H/xyH1MBpEFh01xw9JCZM50uvWY3B7pun KWKIQ98DI7X1UsbNl8cB/TWMx4rFyK3H/rHxoPJGAlHdGKGO43NoYUl4P+/0mkUJHrTi HuIbWcjJl63cuUEvW+Nyy2kctsWCdo5RpE7f4jlA4G+c7mMecaaAuRcOZPPvMp3YZ7a9 C9k0KmIBYQP/OfM+0pjME+OaZIAgGQ6+kR3FNZ9Msws/XnVGOe/m1bz/sjSNiZbJt4rR YMFlRrPXtJ04YFidBDKc38jfqPvilXAcJup+M+gilmO7AF9YwJxVKygi/Bs2hIqYC8og E+aQ== X-Gm-Message-State: ALyK8tIDQvadfWoVYOIEWyKuuY+CJFPvVHQsipDo6SayvmmIipaPVsez2IK2qaj7QG2GGlx/ X-Received: by 10.25.18.26 with SMTP id h26mr604741lfi.110.1464172333423; Wed, 25 May 2016 03:32:13 -0700 (PDT) Received: from beaming.home (91-157-168-132.elisa-laajakaista.fi. [91.157.168.132]) by smtp.gmail.com with ESMTPSA id o75sm1379610lfi.9.2016.05.25.03.32.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 May 2016 03:32:12 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Wed, 25 May 2016 13:31:41 +0300 Message-Id: <6ce5fdb6f7d332463bdb1f4ae5550bd8dfc25b24.1464153942.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:c07::22b Subject: [Qemu-devel] [PULL 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 3b47045..f53cf9d 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 */