From patchwork Fri May 27 12:59:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 9138311 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4E22C607D3 for ; Fri, 27 May 2016 13:05:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 401DA27CF9 for ; Fri, 27 May 2016 13:05:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3513C28160; Fri, 27 May 2016 13:05:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, FSL_HELO_HOME, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D471427CF9 for ; Fri, 27 May 2016 13:05:55 +0000 (UTC) Received: from localhost ([::1]:45712 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6HSc-0003ST-Ue for patchwork-qemu-devel@patchwork.kernel.org; Fri, 27 May 2016 09:05:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37234) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6HNg-0007IZ-B0 for qemu-devel@nongnu.org; Fri, 27 May 2016 09:00:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b6HNb-00018a-Ip for qemu-devel@nongnu.org; Fri, 27 May 2016 09:00:47 -0400 Received: from mail-lf0-x22f.google.com ([2a00:1450:4010:c07::22f]:34271) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6HNb-000187-BE for qemu-devel@nongnu.org; Fri, 27 May 2016 09:00:43 -0400 Received: by mail-lf0-x22f.google.com with SMTP id k98so45665122lfi.1 for ; Fri, 27 May 2016 06:00:43 -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=L7X6vhPfk3t0yYVylFQbi4IUnfeEGxjyEgKzpn3OTuo=; b=EByPFFyQj/KzsLsvq3KD5HhVB1xcnVxz+ZMq8cZ/bmjfBobuuSW1fAUSIDgTDdy0Ka 89RjxKWKDnY+E38cG+PNYkbjz0gLXpPRapM+g0jmoXpCnYD3FSWYxTQ4VjYZWQCFRFyS Yv+prpk2do4ORAd0lbDUZTMUxqdfO354xAzng= 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=L7X6vhPfk3t0yYVylFQbi4IUnfeEGxjyEgKzpn3OTuo=; b=hGUkQddLjsFnZqEkhID/fjkursGuu0AwkpyrL511H3YAu/qXSPcGZ0j7OnZr6Z6zWt czV29R80a4VmnPo/VSodD4vrgOA71y6OVhN4JPzqufKxlZ1INP+eWIezvRBfseIFmqOW s7+39JX51TCnXRCQDyMsueQkVqdT9xOKKzVv6y9gZ4ys+aC1X5985QSsXLZUuBuo643Q nHQOzQV2Tkk5Jv//yj+zU3zfnoxf3ESWbAeoamzfuS1JjBXvB7RxXSeEEss2+D+xYPHi GQ+9A/DesNAeuvYiZF02kISzELs4vGYJKsuIUAKCHMHcx219mIIg04JVqCMwlaYN4AKi G/Yg== X-Gm-Message-State: ALyK8tJAT1y6DPb3CF493Kd/0h8+8D1dv9nSToG0LgDggqCjN7VAWzj7vRAmA2lIOoPVRQ+V X-Received: by 10.25.160.77 with SMTP id j74mr3609821lfe.72.1464354042476; Fri, 27 May 2016 06:00:42 -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.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 27 May 2016 06:00:41 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Fri, 27 May 2016 15:59:59 +0300 Message-Id: <2eb3ae27ec3b797eba16338c08dfac23465f0d7b.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:c07::22f Subject: [Qemu-devel] [PULL v2 08/38] linux-user: Support for restarting system calls for MIPS 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Timothy E Baldwin Update the MIPS 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-7-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/mips/target_signal.h | 1 + linux-user/mips64/target_signal.h | 1 + 3 files changed, 6 insertions(+) diff --git a/linux-user/main.c b/linux-user/main.c index 7916efc..73e3668 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -2528,6 +2528,10 @@ done_syscall: env->active_tc.gpr[8], env->active_tc.gpr[9], env->active_tc.gpr[10], env->active_tc.gpr[11]); # endif /* O32 */ + if (ret == -TARGET_ERESTARTSYS) { + env->active_tc.PC -= 4; + break; + } if (ret == -TARGET_QEMU_ESIGRETURN) { /* Returning from a successful sigreturn syscall. Avoid clobbering register state. */ diff --git a/linux-user/mips/target_signal.h b/linux-user/mips/target_signal.h index 6e1dc8b..460cc9f 100644 --- a/linux-user/mips/target_signal.h +++ b/linux-user/mips/target_signal.h @@ -26,4 +26,5 @@ static inline abi_ulong get_sp_from_cpustate(CPUMIPSState *state) return state->active_tc.gpr[29]; } + #endif /* TARGET_SIGNAL_H */ diff --git a/linux-user/mips64/target_signal.h b/linux-user/mips64/target_signal.h index 5fb6a2c..a2dc514 100644 --- a/linux-user/mips64/target_signal.h +++ b/linux-user/mips64/target_signal.h @@ -26,4 +26,5 @@ static inline abi_ulong get_sp_from_cpustate(CPUMIPSState *state) return state->active_tc.gpr[29]; } + #endif /* TARGET_SIGNAL_H */