From patchwork Mon Nov 20 21:21:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 10067327 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 537E16038F for ; Mon, 20 Nov 2017 21:28:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 45E0928BF2 for ; Mon, 20 Nov 2017 21:28:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3ACDA290C5; Mon, 20 Nov 2017 21:28:44 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, 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 1C86528BF2 for ; Mon, 20 Nov 2017 21:28:43 +0000 (UTC) Received: from localhost ([::1]:59825 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtcP-000177-Qx for patchwork-qemu-devel@patchwork.kernel.org; Mon, 20 Nov 2017 16:28:41 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58123) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtVo-0004Ur-3u for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:21:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eGtVn-0007iJ-DG for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:21:52 -0500 Received: from mail-lf0-x242.google.com ([2a00:1450:4010:c07::242]:43426) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eGtVn-0007em-6P for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:21:51 -0500 Received: by mail-lf0-x242.google.com with SMTP id 73so11682380lfu.10 for ; Mon, 20 Nov 2017 13:21:51 -0800 (PST) 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=EINUFEocM2tBA4frb4/XJv57aamHc/zNVZQt/EVHD5w=; b=GByk3qHmj3P5hsUaEATBe8xWt6m+H4Dl5cn4w4biiFcn8m0rFPEjD/6MGaXpBeWd1+ SjRoWlZ+6msFJwS5G9H766hWv+mDpbejygJcn4kkMOVbaHyJHk/G6fvzH9k6DiAXPjAc 6j0g+MkBFQ3ds1ML8QTSHWEhNUJP/8nN+qK4o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=EINUFEocM2tBA4frb4/XJv57aamHc/zNVZQt/EVHD5w=; b=cK6RxfTxC2CdouZlnXgur5NO3hTWIw7axRWxyheQQNB6vK9ZBxqbN7jkGDzM9WhlQY kYkw0r+r4UqI2FyOWwICFIpdnswAFQFDTESQ0JCl2HU26Y2QxNEcZ+S6XoEAk6FaOk14 v3paqtEpaaAKTSYcI64dGNXQEL7tzV1ICDFugDC+ftxjlom0wNsdB/mMk/YnoXBnLHzJ VA3eZIruGySvtySMgDv09Xne337S4Xs/j/aO1jf2Pb4bVNz6sYsVoxhIlVXmiPaa5Geg PVrPzBu/BI2ikgfY74yxMqacKoDtH1a8gC6Cq2G7hp3masoIFDdd2jcUaUNRIrPPPHBa 3NYg== X-Gm-Message-State: AJaThX7IuK9aR+29SSNFleyFg6E7DtPPFSGguDYQ0E3CDUanwyp8o4By UeWXJhRJvpbtR2kp/ZQVzjT+G9+ii30= X-Google-Smtp-Source: AGs4zMZY9TPA15/IHm0eBG3XXogH7/Dw+vY0I7hSIR/zkKSqNOOUp1gvSKZTIvujQbmp2+MMPihTMg== X-Received: by 10.46.70.26 with SMTP id t26mr4558913lja.181.1511212909682; Mon, 20 Nov 2017 13:21:49 -0800 (PST) Received: from beaming.home (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id v63sm1645409lje.39.2017.11.20.13.21.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Nov 2017 13:21:48 -0800 (PST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Mon, 20 Nov 2017 23:21:31 +0200 Message-Id: X-Mailer: git-send-email 2.14.2 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::242 Subject: [Qemu-devel] [PULL 03/15] linux-user/hppa: Fix cpu_clone_regs 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: Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Richard Henderson By failing to return from the syscall in the child, the child issues another clone syscall and hilarity ensues. Signed-off-by: Richard Henderson Signed-off-by: Riku Voipio --- linux-user/hppa/target_cpu.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/linux-user/hppa/target_cpu.h b/linux-user/hppa/target_cpu.h index 1a5cecad3c..e50522eae9 100644 --- a/linux-user/hppa/target_cpu.h +++ b/linux-user/hppa/target_cpu.h @@ -24,7 +24,11 @@ static inline void cpu_clone_regs(CPUHPPAState *env, target_ulong newsp) if (newsp) { env->gr[30] = newsp; } + /* Indicate child in return value. */ env->gr[28] = 0; + /* Return from the syscall. */ + env->iaoq_f = env->gr[31]; + env->iaoq_b = env->gr[31] + 4; } static inline void cpu_set_tls(CPUHPPAState *env, target_ulong newtls)