From patchwork Tue Oct 31 12:53:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 117611 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp3877789qgn; Tue, 31 Oct 2017 05:57:34 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TCuMxOR5gJsuH+wF+BMB5puck9VgvbMOhpbubjnSeDM52KnI6nUMxb2A1HDJnCWEPlvCvk X-Received: by 10.129.117.9 with SMTP id q9mr1159182ywc.79.1509454654376; Tue, 31 Oct 2017 05:57:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509454654; cv=none; d=google.com; s=arc-20160816; b=EVbUvD+KvPjaUfBZEUp5uOiWe2jh8HmlYq21EcAZKsWI0yhuW6ywMcXhmJrbeZd+Nx EHBwbseL5f0T10Tn/3TJc1mQwh4+HNbIrxL/edVMvLNCBIIAdLbaqxZ8jjxNrGYvfx8S AY0c8fMYGt8Lm/bLE+e4gvMqW4lH2siYeeBOQ1/DjogTE/WLFCYDGgDbtH911GOL/Nd7 8IKf6ek2K2gIFfpi5/BeHqFnE7v0IVZWQCj0MYpQSd7xI820MGK/fm/T34/S4m+9dvzH sSXLIuiepA8y9ftd+v57QUS9Cygt0soSdd0JFSmbv3Lr5RDB03BN+t/h2szZa0lb55ba tkSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=pud2nUSXV0rBPAM+RZaQSzlUNb/w+5/NQMqlaRilYb8=; b=QX/jk8WjsPr9oG83MFrik5QZo2XLrczdDX81N/mJsPE0SF/QiQUYFBknN2XShN4P+y Z0E72ivliAG2ZlaLoYigQIhcaTbBTnEKR7b4Bz0u1/0eSaz0OqAF8ie8nq92rL7ilDqB 3uPSNArzxXx+RxRyza1oKBA9KpDkd+LydjI7+krD9GEKSIVk3icBrDmd9ap2VlZ/i2i5 upw1Dw9tkOPHwpgrNQmPiDY3ojROLF9tpFb8LzjIqRnPq/ZY9oQiatwSzvfGgLNIkfld rxQgKMrXWQRZUiLEDG4eBT+dlOipB+EqJBfQU/IOwVsc+Nrv8flrd2Jo4DHmkRJOw49j U5Uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=W1UZWN+o; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id n75si386615yba.332.2017.10.31.05.57.34 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 31 Oct 2017 05:57:34 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=W1UZWN+o; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:45511 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e9W6n-0004NQ-VQ for patch@linaro.org; Tue, 31 Oct 2017 08:57:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54154) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e9W3o-0002Rw-W9 for qemu-devel@nongnu.org; Tue, 31 Oct 2017 08:54:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e9W3k-0005Ew-CG for qemu-devel@nongnu.org; Tue, 31 Oct 2017 08:54:29 -0400 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]:44709) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e9W3k-0005Ea-2b for qemu-devel@nongnu.org; Tue, 31 Oct 2017 08:54:24 -0400 Received: by mail-wr0-x243.google.com with SMTP id z55so15871182wrz.1 for ; Tue, 31 Oct 2017 05:54:23 -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=pud2nUSXV0rBPAM+RZaQSzlUNb/w+5/NQMqlaRilYb8=; b=W1UZWN+oC7wu27WZXjwfYd7qNCO4BSkY/M31d+aGviSbow/xZcTP7PmzoBsBG5zMFs DZfCgF/vtWPlkX2VDvRR1dOsbPyfYmSD200c2sp/ErU4r24cw2VXLmWRyL7GUmxT3EQH M03TzSZvq9S2ab6GiMmyT6ia2FsbjBbFu1/OA= 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=pud2nUSXV0rBPAM+RZaQSzlUNb/w+5/NQMqlaRilYb8=; b=jfBjtzVN9MRsV+b1/V4Ddi2DnM50cELSlVxWZHAc1xIeA1oig8VM+IaeOU3r8fzbLC 5ibJJWxKxdmV//fy/i2V5XDECAbYnIqgUOwROCqlHNn/XE/pqKMaRBz9U0/lb4/U+Srx dP6hmifgRX6o9XVV6JUKtBdTTxaGRireQGD+feXKcGKQp4Ag2tuFjpS8/ehuYSHCH5ai ZxOUyJt3u5IUXRnX7n3wnK+RRnKgFV6b+RQoNX1LWXFn/s41XjoGv5X7efYUoSztfION TKL7AEgwvHtZL3ezsHSBGqrxO5481CadjZ5OGrzuuB/e01PuRnXom3tCZ9FiGdMwGjc5 lMVw== X-Gm-Message-State: AMCzsaU18cJqL9/npd9X9gDimPYLZv+yxn48HtkDZ1x/SY4mQQpDnNVe GYlIEjKhZG82dQVJfjgwOA4+LzjIfLw= X-Received: by 10.223.179.20 with SMTP id j20mr1885364wrd.116.1509454462861; Tue, 31 Oct 2017 05:54:22 -0700 (PDT) Received: from cloudburst.twiddle.net.ASUS (p57A4515F.dip0.t-ipconnect.de. [87.164.81.95]) by smtp.gmail.com with ESMTPSA id e131sm999011wmg.15.2017.10.31.05.54.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 31 Oct 2017 05:54:22 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 31 Oct 2017 13:53:54 +0100 Message-Id: <20171031125358.23377-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171031125358.23377-1-richard.henderson@linaro.org> References: <20171031125358.23377-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::243 Subject: [Qemu-devel] [PATCH 3/7] 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: riku.voipio@iki.fi, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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 --- linux-user/hppa/target_cpu.h | 4 ++++ 1 file changed, 4 insertions(+) -- 2.13.6 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)