From nobody Sat May 18 18:02:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1572003727; cv=none; d=zoho.com; s=zohoarc; b=hHrSTO3kNA6xdE55tgWZH9WbATu3A6B6MZuC4GMKfLQOYnsuCh6xe5A6fPyZ0Lb6Q9bNGrLRpJfdqsLgARJ8K4G7i4RK1NJogFDBI+CGP8pPRCAFqSuxNGIvPDoPhbRF3INyiTNbl9ltg79E2MwvsyVL2mCLkMOahpFWmIP0gsA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572003727; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=eYlJyuG0D2jRtROBHsXLKAoXJWfo30B11DHLmtIIcdc=; b=ErmjeygTFBFDgdANc2Xd6XXsM0f4RKJKzOdbRxzvc+somWOa9iz3u5vLxPcLTETH1WYBEwR3FidOCo5Bcjrc8jWH2V0iVojLicDC9Xp3yy+va2BIvz+7laBQob0DLcgJMIR/KdLY8mBFIVyZwmwmS8hwWFVSp8Ha9Ftv5VGez18= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1572003727095753.2312146466381; Fri, 25 Oct 2019 04:42:07 -0700 (PDT) Received: from localhost ([::1]:58916 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNxym-000235-6F for importer@patchew.org; Fri, 25 Oct 2019 07:42:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45015) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNxwJ-0006KR-L0 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 07:39:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNxwE-0006aR-K0 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 07:39:30 -0400 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]:40944) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNxwD-0006Zo-8V for qemu-devel@nongnu.org; Fri, 25 Oct 2019 07:39:25 -0400 Received: by mail-qt1-x844.google.com with SMTP id o49so2704427qta.7 for ; Fri, 25 Oct 2019 04:39:24 -0700 (PDT) Received: from localhost.localdomain (rrcs-172-254-253-50.nyc.biz.rr.com. [172.254.253.50]) by smtp.gmail.com with ESMTPSA id x38sm1473335qtc.64.2019.10.25.04.39.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2019 04:39: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=eYlJyuG0D2jRtROBHsXLKAoXJWfo30B11DHLmtIIcdc=; b=lorccuDTMLh+8D/MRvn/3jcXAo7cRKC5jenoqK7271yUwJicWS74fBvv2mdCMT5AaV L/9VjuFt3KSawxcv3i76NZ1d2zvFJQkkWPnP1vRaXDxVo+ss82JqG0hD8I/I9TMPKfmC pQv6v1govTTV8SjyWSINJYG4CR1Sy46GtKUvechu2oz8qAjwDThTPZMwC8a6ei46Hdv8 VJ5e2V6ESs7s7KOs1NiWEzKnrQj+AfCmdakFzrr1wiQjD6U81dMy5Grda0L+iWRHCtQN 1awF1gprZVYDTwviGFVd/0KjZfEAgA7L5XcKZiRYBdc97mH7zDr0UQ5lA83LS8r2Na6L ewKw== 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=eYlJyuG0D2jRtROBHsXLKAoXJWfo30B11DHLmtIIcdc=; b=KOHquydTdYTbXmaQaE9a4+gKzjUrn9O/VXaSC+RIWyQO4qKy6XDauygrDuw0dofI2f Kg+uNuyt3q0qeqhBDgt8yXbnj2pdOvtUMtXjmbf7n7owmC26Z5/E/N+9G/uJY4vdDjzi 54wlyjfSNupnNNoMdFhQhI+F/aJmpT8H71qVDtR2qqEtQCg64eQXsncOX7w7+1U167fM lqZc0rOEid0wAyuXtM+Cw5eMDLV7ihc5Qtlib99qgiBlHb1ag3uagnvXS2v8vLI/pN3b K8jUnQeQIOvTOjVbAeoePR8LZoXsXgkUiKcaV+S8qzkSMEsPJXzzzX7O6IjOBIqqgJ0+ WYLQ== X-Gm-Message-State: APjAAAX4Ee6CnP30yD+YuRLGQdoxheijfibfRFNl81ehgcRcRcdoAxTL ws1XBzjBvhUTQ3LQTQO5Lg1yCjRvweM= X-Google-Smtp-Source: APXvYqzzVG40aEcH6EubCiVYH7CCZx5WbXgbca20sBIe4BoH6UxBD05OKgAjW3eAKf/wIWOQobC7Hg== X-Received: by 2002:a0c:b918:: with SMTP id u24mr2759288qvf.212.1572003563868; Fri, 25 Oct 2019 04:39:23 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 01/12] scripts/qemu-binfmt-conf: Update for sparc64 Date: Fri, 25 Oct 2019 07:39:10 -0400 Message-Id: <20191025113921.9412-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191025113921.9412-1-richard.henderson@linaro.org> References: <20191025113921.9412-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::844 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.bennee@linaro.org, laurent@vivier.eu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Also note that we were missing the qemu_target_list entry for plain sparc; fix that at the same time. Reviewed-by: Laurent Vivier Tested-by: Laurent Vivier Signed-off-by: Richard Henderson --- scripts/qemu-binfmt-conf.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh index b5a16742a1..9f1580a91c 100755 --- a/scripts/qemu-binfmt-conf.sh +++ b/scripts/qemu-binfmt-conf.sh @@ -1,8 +1,8 @@ #!/bin/sh # Enable automatic program execution by the kernel. =20 -qemu_target_list=3D"i386 i486 alpha arm armeb sparc32plus ppc ppc64 ppc64l= e m68k \ -mips mipsel mipsn32 mipsn32el mips64 mips64el \ +qemu_target_list=3D"i386 i486 alpha arm armeb sparc sparc32plus sparc64 \ +ppc ppc64 ppc64le m68k mips mipsel mipsn32 mipsn32el mips64 mips64el \ sh4 sh4eb s390x aarch64 aarch64_be hppa riscv32 riscv64 xtensa xtensaeb \ microblaze microblazeel or1k x86_64" =20 @@ -38,6 +38,10 @@ sparc32plus_magic=3D'\x7fELF\x01\x02\x01\x00\x00\x00\x00= \x00\x00\x00\x00\x00\x00\x sparc32plus_mask=3D'\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\x= ff\xff\xff\xff\xfe\xff\xff' sparc32plus_family=3Dsparc =20 +sparc64_magic=3D'\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x= 00\x02\x00\x2b' +sparc64_mask=3D'\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\x= ff\xff\xff\xfe\xff\xff' +sparc64_family=3Dsparc + ppc_magic=3D'\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x= 02\x00\x14' ppc_mask=3D'\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\x= ff\xff\xfe\xff\xff' ppc_family=3Dppc --=20 2.17.1 From nobody Sat May 18 18:02:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1572003726; cv=none; d=zoho.com; s=zohoarc; b=f4wtzeVgdMbsg/rLlQOsD4TrjpXfUbBVUnZ7nY0ghypgS01Q36Qxmqx4f+qPQEVYQCDYBxtzNnxNo2T0bV7kPld07bbnRVxIh36y4jTVGfENOqjsAfB2I/KrEvZ9Lud/M4tQqcgpacm8PHlFL+yhE0owJPViTGTHqHCTGlQqJ6U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572003726; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=RPOooG/qzrYvwV59r2e90DUXAtJHgbXT1XUOCv1dvV0=; b=MBQe5YtUuPh6Tlc2T7eV/METPzbWwPGk2LNlrEOfYhfGlhVpv2dStF+xl3tx0qZ8oD95AN5bVpyGazwnZrLRFbju4OtnezhvlBPNXa8k+EB0w/vStixN8G2vVxFv3QXm/m3W6uV59w9qHmVcmchjwVwT/ESxHQ9YlsknS87bx1Y= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1572003726627317.80226631190374; Fri, 25 Oct 2019 04:42:06 -0700 (PDT) Received: from localhost ([::1]:58918 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNxyk-00023C-AI for importer@patchew.org; Fri, 25 Oct 2019 07:42:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45029) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNxwK-0006P3-Fl for qemu-devel@nongnu.org; Fri, 25 Oct 2019 07:39:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNxwI-0006bz-Dl for qemu-devel@nongnu.org; Fri, 25 Oct 2019 07:39:31 -0400 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]:46897) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNxwF-0006aB-4Q for qemu-devel@nongnu.org; Fri, 25 Oct 2019 07:39:28 -0400 Received: by mail-qt1-x843.google.com with SMTP id u22so2655588qtq.13 for ; Fri, 25 Oct 2019 04:39:25 -0700 (PDT) Received: from localhost.localdomain (rrcs-172-254-253-50.nyc.biz.rr.com. [172.254.253.50]) by smtp.gmail.com with ESMTPSA id x38sm1473335qtc.64.2019.10.25.04.39.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2019 04:39:24 -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=RPOooG/qzrYvwV59r2e90DUXAtJHgbXT1XUOCv1dvV0=; b=cV1M6LmQloVXfRNGHYBEq9bDKP2ivRdJ6N+l3OuK1HiIU3y4jGzYiDX8DtK90JJx+s wbCWHRhjced+ZAQB2xM6CCqv/CUM+DvQYt779ygR68lu78mF54CHRO8CXKzEOmP6WC0l oqXzU/nWrIXpWl9TWOUYW52UD+STUeLAdA65TqArbYNZ2rvzo+R60sDEwgJ5EDEPa8n9 gO+RkeKbx6KzxrrImNfWCP+ywn7PJM8WivhweEUUAHjlWqSAhoM1RyM3qpJkBGAWm4GL e4O7AWOqhbPUvn7G0zvAvRmd0mrLJKGEK1jrEMLM+BjHsLmIHJEwLJAb0H96rDUmCBoJ c5hg== 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=RPOooG/qzrYvwV59r2e90DUXAtJHgbXT1XUOCv1dvV0=; b=LMwgb+RtvNGNC1H0cfjF5CGATKi/cuga0p9zRq1YcMUUQByb5300kpvYvsX6mMU2ie MsoL5oADZCJRpBpGARkPcDwaJk80s6/VQ26aAjgVgiUZ+UJSCrtR0GF9HJwl8RR8vEH9 QQE6K7YU3PnQsAOSLfu8VGjqw+U4x8g7r0vt+B2uW6v5gc4JNzn6SVw7EPPzO/e/BjKK T6jgHrjE27q2V8aeun+sogm7OCxf27S1fu/0L6vSYPSslV8uQml1DrTlKHexqP7YeBPi qlTAx9UxbWEb+YjMuWkc/XtyFEF5hx0xhKIxaihyDS6XozGTY0cY/svyzg8Z5Y8yNt1W 3Tpg== X-Gm-Message-State: APjAAAWQ6fv/u7+tYQYrD+JkZsgfwZola73nunlWCjL4qiFjB7tlfVTQ Hrj5CB1kg0+6eJJBalLF0aYFquUw12I= X-Google-Smtp-Source: APXvYqwNbANUFzw6mQhHvQ0EaHU3iJBwfsI8okv1Bkv+36bKkNVZGjyMVfx8jsTDv8Ol/EKFYYnDng== X-Received: by 2002:a0c:e60e:: with SMTP id z14mr2787832qvm.124.1572003564979; Fri, 25 Oct 2019 04:39:24 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 02/12] tests/tcg/multiarch/linux-test: Fix error check for shmat Date: Fri, 25 Oct 2019 07:39:11 -0400 Message-Id: <20191025113921.9412-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191025113921.9412-1-richard.henderson@linaro.org> References: <20191025113921.9412-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::843 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.bennee@linaro.org, laurent@vivier.eu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The error indicator for this syscall is -1, not 0. Reviewed-by: Laurent Vivier Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- tests/tcg/multiarch/linux-test.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/tcg/multiarch/linux-test.c b/tests/tcg/multiarch/linux-t= est.c index fa4243fc04..673d7c8a1c 100644 --- a/tests/tcg/multiarch/linux-test.c +++ b/tests/tcg/multiarch/linux-test.c @@ -503,8 +503,9 @@ static void test_shm(void) =20 shmid =3D chk_error(shmget(IPC_PRIVATE, SHM_SIZE, IPC_CREAT | 0777)); ptr =3D shmat(shmid, NULL, 0); - if (!ptr) + if (ptr =3D=3D (void *)-1) { error("shmat"); + } =20 memset(ptr, 0, SHM_SIZE); =20 --=20 2.17.1 From nobody Sat May 18 18:02:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1572003916; cv=none; d=zoho.com; s=zohoarc; b=VGPFe42G08WyYB7FIoe6ViSRapkrzidqLCug7y+eQfg8/fYyGPsAcxT25vrVLCx20tF6jsU4AsgfCV62Veww4D92PMk2p44tZGSYxtwJEJQFkIKnLxJLKagXj+G8h1p3VUCOzeB4NxIqdVBmiYNqPuFe646LaTlctMxAPTQVvfE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572003916; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=MfrPU6dfjKdIPv9pRU2qfeqITCMfZWCuzZQmM0QxYQ0=; b=HbKqjJvJZrckHMQZJ05ROyGLQ/evG19mMAKb/k4L8Dx080FVj3+5Ax95tpZjaT+oUkiOykXVaiANmUUmoRkep36VOHFbzG5oXj8dkV47ZECGlq8rJ7qwgxjDzk+BnZY3lCAcltGDTljmCUHr8R6+1dCD8y0kFyMShaRF6Khr4Bs= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1572003916151775.8938700911958; Fri, 25 Oct 2019 04:45:16 -0700 (PDT) Received: from localhost ([::1]:58962 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNy1q-0006LW-MA for importer@patchew.org; Fri, 25 Oct 2019 07:45:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45080) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNxwP-0006gO-1c for qemu-devel@nongnu.org; Fri, 25 Oct 2019 07:39:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNxwI-0006c6-E5 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 07:39:36 -0400 Received: from mail-qk1-x729.google.com ([2607:f8b0:4864:20::729]:38449) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNxwG-0006aV-GD for qemu-devel@nongnu.org; Fri, 25 Oct 2019 07:39:29 -0400 Received: by mail-qk1-x729.google.com with SMTP id p4so1403429qkf.5 for ; Fri, 25 Oct 2019 04:39:26 -0700 (PDT) Received: from localhost.localdomain (rrcs-172-254-253-50.nyc.biz.rr.com. [172.254.253.50]) by smtp.gmail.com with ESMTPSA id x38sm1473335qtc.64.2019.10.25.04.39.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2019 04:39:25 -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=MfrPU6dfjKdIPv9pRU2qfeqITCMfZWCuzZQmM0QxYQ0=; b=YdvW9nh04/K98nOhMMeTA9x6+a26eY7B3qAAmfBLYDRcVNVtC14+Ff5ulygjtXvQCK ZC3zYiRiOjrqlaf331uOhMPK1Gze4ttLD/iO83dPhyrVoVnNaXG5mx7RY4WWOXf8XFtb 0EhGUNL7ICG88dMdRka7PkA+IVtGA9yH2Dtf6KlPPU8jpexZPlkmS97Y8TGkpZcOdYbd VPqqhtnZ6urHQyx8tmQGUE+8guZOKxVXt0nRA3vj+8K9JVtLBmx6033cmsx34mODd7is MsjuvvIi9R8DcavW64tfC+Ir29ExzPCMABmLGXqpdmEcLBiSW/1vzX7mo6GRnQiPoEcl Lw2Q== 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=MfrPU6dfjKdIPv9pRU2qfeqITCMfZWCuzZQmM0QxYQ0=; b=scHJBHaU8PIv9gz78g+Fk2HfrNpxeZhvfhhBW65/SIwxNUEJKbPCKdsxy7G//9Ap0J gXhY2TEmBum3a5vq7NBaSJd7FfOtXZEHBcGD7nuFYxS5bANO7MFrdoV4oUAYqfbbo5pP u6N+ZCxc20iPxlKFUOtCGPC3nB8zYijPSD04CRtgyw586aY5ACwpHQP1q6bWoY+FXNwR C9QPDmYRc08+bNpigLq6gSFdU3rXH4wFBsiQOEZLka6MRrgFCNx3K2Iz4CM1jkANgHLI paJo08UZ7TIPCjBE+4/D3SARHvm7jL6MmucIywBgWums1IdzZQ5pxWntsMikxEBuP249 aKiw== X-Gm-Message-State: APjAAAWitZ5oir0fpgH+RftjgBfbYlnq6JlK8/jOm1CtOvpX7daQCUB6 Iq/k26YizfMoD18WmxsiuJIyp+JHBQc= X-Google-Smtp-Source: APXvYqxq6Aqt5lb8YL8eOGjV2BycRh1h2F/7dT4ZU0wSlZIFZFIYZIY29a9g7KxGI9pHe+nWzD3nzA== X-Received: by 2002:a37:6305:: with SMTP id x5mr2367044qkb.498.1572003566025; Fri, 25 Oct 2019 04:39:26 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 03/12] target/sparc: Define an enumeration for accessing env->regwptr Date: Fri, 25 Oct 2019 07:39:12 -0400 Message-Id: <20191025113921.9412-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191025113921.9412-1-richard.henderson@linaro.org> References: <20191025113921.9412-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::729 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.bennee@linaro.org, laurent@vivier.eu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson --- target/sparc/cpu.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h index 778aa8e073..ae97c7d9f7 100644 --- a/target/sparc/cpu.h +++ b/target/sparc/cpu.h @@ -13,6 +13,39 @@ =20 /*#define EXCP_INTERRUPT 0x100*/ =20 +/* Windowed register indexes. */ +enum { + WREG_O0, + WREG_O1, + WREG_O2, + WREG_O3, + WREG_O4, + WREG_O5, + WREG_O6, + WREG_O7, + + WREG_L0, + WREG_L1, + WREG_L2, + WREG_L3, + WREG_L4, + WREG_L5, + WREG_L6, + WREG_L7, + + WREG_I0, + WREG_I1, + WREG_I2, + WREG_I3, + WREG_I4, + WREG_I5, + WREG_I6, + WREG_I7, + + WREG_SP =3D WREG_O6, + WREG_FP =3D WREG_I6, +}; + /* trap definitions */ #ifndef TARGET_SPARC64 #define TT_TFAULT 0x01 --=20 2.17.1 From nobody Sat May 18 18:02:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1572004124; cv=none; d=zoho.com; s=zohoarc; b=L46GEWNywFfczOphDNXBu5hqbVgyLfNqtOnKcLv00sC49O64SqwhAC5+pzTlIVPCiIHIBLC/KpycLF9H9BDwLlPGjBP9AJJAWfpwdtcy0Akeu8Jvh59hP/h/gQHpH+CkCZl4yg6CCcVI9yPW/K2Pt+Hm8Q7N9sXLiMDo2Fd4Uj0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572004124; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=C1Ka5ZLtI0sImJ7QdMPIBsKCCe+cYWp1x4Ddd/XjEbY=; b=NnKmtUz9otwUlofpWjIUhmeaPpxX72sXE039pf7WzwRFB8fmEoc58BVMPz/ItnC0yl5fAbKyVJlrfPep9yy81CUezzDoETuUzmVzgo6ZSIS/RBOpzvVGM6A4WWBZ2OHkZ1kfzMralXScyEckwNkoZjcGFWdmGqkI5waYK19WgnQ= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1572004124845379.84606906310796; Fri, 25 Oct 2019 04:48:44 -0700 (PDT) Received: from localhost ([::1]:59020 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNy5B-0001ga-24 for importer@patchew.org; Fri, 25 Oct 2019 07:48:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45064) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNxwM-0006U1-3T for qemu-devel@nongnu.org; Fri, 25 Oct 2019 07:39:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNxwK-0006dA-Ea for qemu-devel@nongnu.org; Fri, 25 Oct 2019 07:39:33 -0400 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]:42551) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNxwI-0006au-D5 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 07:39:31 -0400 Received: by mail-qt1-x844.google.com with SMTP id w14so2693836qto.9 for ; Fri, 25 Oct 2019 04:39:27 -0700 (PDT) Received: from localhost.localdomain (rrcs-172-254-253-50.nyc.biz.rr.com. [172.254.253.50]) by smtp.gmail.com with ESMTPSA id x38sm1473335qtc.64.2019.10.25.04.39.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2019 04:39:26 -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=C1Ka5ZLtI0sImJ7QdMPIBsKCCe+cYWp1x4Ddd/XjEbY=; b=IFKRl7SfLyGkRHA2wCnD8Orxigbg5oSbNOHXNwR8D+0jRTEGgSqPnswZdclYiVAgVe B+QIirneWP1g3tK9Fg7ZxbgZI6zsjdAxd/4x3wgp7jYU6MHwzyVN4gViKVDL1wQNCuJb k2/6L/UpkgwvDDKzkeORzFtaX0K2LF6Ai6A+MCQSWA9zvZmPYfrH66OLl9Qq1INDb/7k RXOIYmopyxj8YfGxLhL83DQxXboFsYARE//POLkTkZQf6AyDJzMLBP03u8AOO1Zxd2E4 2c4kkL6rd72rG7nAWdep1OZbAOV8qt8a2a/aRXBIX0CSp6ThZlmVLUHQ55dApCnLPhlp ULHg== 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=C1Ka5ZLtI0sImJ7QdMPIBsKCCe+cYWp1x4Ddd/XjEbY=; b=BWMTHxeQ8wSBqmiJILPGgAzwyAZxpES5iFQw7BcjKNJxm9VpdXqw+8bEhgjQXInggZ HBNSmMvXoZ8GMgbc/LmST+dDuCl6XCg2AxyL35MF6Vt5auMKY+aOEtUWzo5RVuLUIPes d80TSOTFdbSoenVChTnWobtCs3z9seIIqu6/ZQJ3XY4HNqQSYXMFCKLYhPibaIkIZU4Z kiQbrXDJFRQkJgLMrVdnPIXjosky1xpaMDV44cDcHjRzHReUFEuedOxsluGAdMXG0yBK aSXIdRMoOHOm0lRCdqmWA13HjBAdgROEAnjEIEUuAlZPG0xNz28EahSEwaEnIJM9CqKK H4zw== X-Gm-Message-State: APjAAAVjWDwCROvVJaxD6g9SATBFXSR2tfkxxkKquEsQzt+qmpQrKkFs iP1SSr6JYOHP7ne07Qw5J2N4U6JVs8M= X-Google-Smtp-Source: APXvYqxETCq9IEX7Nvx7hiGBZJKXHCfr5U2MiADTJI9somL4zRJfuNoe6qIzpQeN9jxV6sYu42WKfw== X-Received: by 2002:ac8:38a9:: with SMTP id f38mr2558976qtc.108.1572003567130; Fri, 25 Oct 2019 04:39:27 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 04/12] linux-user/sparc: Use WREG constants in sparc/target_cpu.h Date: Fri, 25 Oct 2019 07:39:13 -0400 Message-Id: <20191025113921.9412-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191025113921.9412-1-richard.henderson@linaro.org> References: <20191025113921.9412-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::844 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.bennee@linaro.org, laurent@vivier.eu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This fixes a naming bug wherein we used "UREG_FP" to access the stack pointer. OTOH, the "UREG_FP" constant was also defined incorrectly such that it *did* reference the stack pointer. Note that the kernel legitimately uses the name "FP", because it utilizes the rolled stack window in processing the system call. Signed-off-by: Richard Henderson Reviewed-by: Laurent Vivier --- linux-user/sparc/target_cpu.h | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/linux-user/sparc/target_cpu.h b/linux-user/sparc/target_cpu.h index 1ffc0ae9f2..b30fbc72c4 100644 --- a/linux-user/sparc/target_cpu.h +++ b/linux-user/sparc/target_cpu.h @@ -41,15 +41,9 @@ static inline void cpu_set_tls(CPUSPARCState *env, targe= t_ulong newtls) env->gregs[7] =3D newtls; } =20 -#ifndef UREG_I6 -#define UREG_I6 6 -#endif -#ifndef UREG_FP -#define UREG_FP UREG_I6 -#endif - static inline abi_ulong get_sp_from_cpustate(CPUSPARCState *state) { - return state->regwptr[UREG_FP]; + return state->regwptr[WREG_SP]; } + #endif --=20 2.17.1 From nobody Sat May 18 18:02:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1572003728; cv=none; d=zoho.com; s=zohoarc; b=IaGISs3qjA7E7DzTCteX9tV5WIhxtTVUPp0NjF24FXtD3w4N5h81jIJG8FHXoC8QmqsHFn8PlBJsHhliCGMM1K/NHC84Znq8k+Xk7WWL3Yh4p1BUrBdsI6V7jUCHOv6OtAktBBD5o0oRlN5dZoPcTZn7TnP458llf3bP52liVs8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572003728; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=sAjHl90QxJmdMfN37RnYdKMoSO6lq1wA1h9GjJJcTfo=; b=JBrNwlIt/sI8ZimzG+zOFsolKpL2zh/j+t/wrnm5u0DP8T4sxrPANAFd4FnL3JCkkGan8LqDqe+MBrdsamiZIzFhzr7sIw+V8NEk5SdqjbDAjpyJB1ezYTy9mC6SEAYANsfNsTJF7U8wI8eRNGtbG5wuLwKo5xoZjcxiSyBrGrs= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 157200372870265.89919484574693; Fri, 25 Oct 2019 04:42:08 -0700 (PDT) Received: from localhost ([::1]:58924 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNxyp-00028h-7V for importer@patchew.org; Fri, 25 Oct 2019 07:42:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45079) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNxwO-0006gL-Vf for qemu-devel@nongnu.org; Fri, 25 Oct 2019 07:39:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNxwK-0006dL-FR for qemu-devel@nongnu.org; Fri, 25 Oct 2019 07:39:34 -0400 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]:39021) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNxwJ-0006bH-Ej for qemu-devel@nongnu.org; Fri, 25 Oct 2019 07:39:31 -0400 Received: by mail-qt1-x843.google.com with SMTP id t8so2716641qtc.6 for ; Fri, 25 Oct 2019 04:39:28 -0700 (PDT) Received: from localhost.localdomain (rrcs-172-254-253-50.nyc.biz.rr.com. [172.254.253.50]) by smtp.gmail.com with ESMTPSA id x38sm1473335qtc.64.2019.10.25.04.39.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2019 04:39:27 -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=sAjHl90QxJmdMfN37RnYdKMoSO6lq1wA1h9GjJJcTfo=; b=u1l7sRS4g3EMkqrK54XJ+/4NVBFCzVGt2T7AO/qeTJGQ5smVtgv/3vgTUDUj+rSuV+ ysl6JWWDh6XjpvfJchE52uBHzfG5Tgas/A53OPOI/GmBzLuO5XoEiJpnWrSNpF9iPb8G +RDvgQOgz9nIndqlfV6zTM0l+PsLWOSqJ4qctZuhjFMMMCtn8wHE82jp3s6AGuLEhiB0 g7kEIr31HTKa1aO10BaN2kwoRGKCFiHDLLFV1RscGDJ5hMTbGfyPdTEF9Foafk+cLCxt iOmcFdCrFK5usIL7W+RJZ4fwoR+IYATqXVqTytZdSsGytGy8Sw/hM7PRXqTk2cLto6O2 CyfA== 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=sAjHl90QxJmdMfN37RnYdKMoSO6lq1wA1h9GjJJcTfo=; b=N+l+X3t8Qd4pBJ29GUPD0f8OLwO5FNlwttLyKUkIPe7U7NbKIzuxib0vjG1x/AQtRL pA9ZaOhuyg9BXHaN1l+mxHbCzkTiSCRLPAIna2yxjqIqhyDAJt+qNz33KJTBrIDHk7Qk JrLCZNsH3v4DEq9/Eah8oIZwWJUhwkN75axlDGEnUuJuLRLDc3keAv9k2Iud8844G78r QgnmO7EhS4PU+z7xICHXrOA2GNAlq1wVWvnQyLj7mYX+xWGzQXYuG0ZkUDMjcVYnPO1w IITIrsF2CrxD7EAua9ep4R53N5OEUlbmz7ry0sTDJj7niO+pTeoxJQokaAyu52D6j8Kx +8ng== X-Gm-Message-State: APjAAAWDeIQ+KVErpxeWDp2tC2HyksPflKNkgtP3VwPMarCafsDYseT9 TUFusVNH72Xy+13LHDBkgkCO7FBakKw= X-Google-Smtp-Source: APXvYqwVNR5YQphJlyAfKx1Sh2mZa0AmPJ32MqozMymkj2+8g/pFkTl2y2JgLY6YJ1QGbeihw1pyGg== X-Received: by 2002:aed:3c67:: with SMTP id u36mr2504489qte.142.1572003568137; Fri, 25 Oct 2019 04:39:28 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 05/12] linux-user/sparc: Begin using WREG constants in sparc/signal.c Date: Fri, 25 Oct 2019 07:39:14 -0400 Message-Id: <20191025113921.9412-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191025113921.9412-1-richard.henderson@linaro.org> References: <20191025113921.9412-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::843 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.bennee@linaro.org, laurent@vivier.eu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This is non-obvious because the UREG constants are in fact wrong. s/UREG_I/WREG_O/g s/UREG_O/WREG_I/g s/UREG_L/WREG_L/g These substitutions have identical integer values. Signed-off-by: Richard Henderson Reviewed-by: Laurent Vivier --- linux-user/sparc/signal.c | 93 ++++++++++++++------------------------- 1 file changed, 32 insertions(+), 61 deletions(-) diff --git a/linux-user/sparc/signal.c b/linux-user/sparc/signal.c index ead169fbaa..a967e2db73 100644 --- a/linux-user/sparc/signal.c +++ b/linux-user/sparc/signal.c @@ -104,19 +104,8 @@ struct target_rt_signal_frame { qemu_siginfo_fpu_t fpu_state; }; =20 -#define UREG_O0 16 -#define UREG_O6 22 -#define UREG_I0 0 -#define UREG_I1 1 -#define UREG_I2 2 -#define UREG_I3 3 -#define UREG_I4 4 -#define UREG_I5 5 -#define UREG_I6 6 -#define UREG_I7 7 -#define UREG_L0 8 -#define UREG_FP UREG_I6 -#define UREG_SP UREG_O6 +#define UREG_FP WREG_O6 +#define UREG_SP WREG_I6 =20 static inline abi_ulong get_sigframe(struct target_sigaction *sa,=20 CPUSPARCState *env, @@ -159,30 +148,12 @@ setup___siginfo(__siginfo_t *si, CPUSPARCState *env, = abi_ulong mask) __put_user(env->gregs[i], &si->si_regs.u_regs[i]); } for (i=3D0; i < 8; i++) { - __put_user(env->regwptr[UREG_I0 + i], &si->si_regs.u_regs[i+8]); + __put_user(env->regwptr[WREG_O0 + i], &si->si_regs.u_regs[i+8]); } __put_user(mask, &si->si_mask); return err; } =20 -#if 0 -static int -setup_sigcontext(struct target_sigcontext *sc, /*struct _fpstate *fpstate,= */ - CPUSPARCState *env, unsigned long mask) -{ - int err =3D 0; - - __put_user(mask, &sc->sigc_mask); - __put_user(env->regwptr[UREG_SP], &sc->sigc_sp); - __put_user(env->pc, &sc->sigc_pc); - __put_user(env->npc, &sc->sigc_npc); - __put_user(env->psr, &sc->sigc_psr); - __put_user(env->gregs[1], &sc->sigc_g1); - __put_user(env->regwptr[UREG_O0], &sc->sigc_o0); - - return err; -} -#endif #define NF_ALIGNEDSZ (((sizeof(struct target_signal_frame) + 7) & (~7))) =20 void setup_frame(int sig, struct target_sigaction *ka, @@ -221,20 +192,20 @@ void setup_frame(int sig, struct target_sigaction *ka, } =20 for (i =3D 0; i < 8; i++) { - __put_user(env->regwptr[i + UREG_L0], &sf->ss.locals[i]); + __put_user(env->regwptr[i + WREG_L0], &sf->ss.locals[i]); } for (i =3D 0; i < 8; i++) { - __put_user(env->regwptr[i + UREG_I0], &sf->ss.ins[i]); + __put_user(env->regwptr[i + WREG_O0], &sf->ss.ins[i]); } if (err) goto sigsegv; =20 /* 3. signal handler back-trampoline and parameters */ env->regwptr[UREG_FP] =3D sf_addr; - env->regwptr[UREG_I0] =3D sig; - env->regwptr[UREG_I1] =3D sf_addr + + env->regwptr[WREG_O0] =3D sig; + env->regwptr[WREG_O1] =3D sf_addr + offsetof(struct target_signal_frame, info); - env->regwptr[UREG_I2] =3D sf_addr + + env->regwptr[WREG_O2] =3D sf_addr + offsetof(struct target_signal_frame, info); =20 /* 4. signal handler */ @@ -242,11 +213,11 @@ void setup_frame(int sig, struct target_sigaction *ka, env->npc =3D (env->pc + 4); /* 5. return to kernel instructions */ if (ka->ka_restorer) { - env->regwptr[UREG_I7] =3D ka->ka_restorer; + env->regwptr[WREG_O7] =3D ka->ka_restorer; } else { uint32_t val32; =20 - env->regwptr[UREG_I7] =3D sf_addr + + env->regwptr[WREG_O7] =3D sf_addr + offsetof(struct target_signal_frame, insns) - 2 * 4; =20 /* mov __NR_sigreturn, %g1 */ @@ -316,7 +287,7 @@ long do_sigreturn(CPUSPARCState *env) __get_user(env->gregs[i], &sf->info.si_regs.u_regs[i]); } for (i=3D0; i < 8; i++) { - __get_user(env->regwptr[i + UREG_I0], &sf->info.si_regs.u_regs[i+8= ]); + __get_user(env->regwptr[i + WREG_O0], &sf->info.si_regs.u_regs[i+8= ]); } =20 /* FIXME: implement FPU save/restore: @@ -433,7 +404,7 @@ void sparc64_set_context(CPUSPARCState *env) abi_ulong fp, i7, w_addr; unsigned int i; =20 - ucp_addr =3D env->regwptr[UREG_I0]; + ucp_addr =3D env->regwptr[WREG_O0]; if (!lock_user_struct(VERIFY_READ, ucp, ucp_addr, 1)) { goto do_sigsegv; } @@ -443,7 +414,7 @@ void sparc64_set_context(CPUSPARCState *env) if ((pc | npc) & 3) { goto do_sigsegv; } - if (env->regwptr[UREG_I1]) { + if (env->regwptr[WREG_O1]) { target_sigset_t target_set; sigset_t set; =20 @@ -474,19 +445,19 @@ void sparc64_set_context(CPUSPARCState *env) __get_user(env->gregs[5], (&(*grp)[SPARC_MC_G5])); __get_user(env->gregs[6], (&(*grp)[SPARC_MC_G6])); __get_user(env->gregs[7], (&(*grp)[SPARC_MC_G7])); - __get_user(env->regwptr[UREG_I0], (&(*grp)[SPARC_MC_O0])); - __get_user(env->regwptr[UREG_I1], (&(*grp)[SPARC_MC_O1])); - __get_user(env->regwptr[UREG_I2], (&(*grp)[SPARC_MC_O2])); - __get_user(env->regwptr[UREG_I3], (&(*grp)[SPARC_MC_O3])); - __get_user(env->regwptr[UREG_I4], (&(*grp)[SPARC_MC_O4])); - __get_user(env->regwptr[UREG_I5], (&(*grp)[SPARC_MC_O5])); - __get_user(env->regwptr[UREG_I6], (&(*grp)[SPARC_MC_O6])); - __get_user(env->regwptr[UREG_I7], (&(*grp)[SPARC_MC_O7])); + __get_user(env->regwptr[WREG_O0], (&(*grp)[SPARC_MC_O0])); + __get_user(env->regwptr[WREG_O1], (&(*grp)[SPARC_MC_O1])); + __get_user(env->regwptr[WREG_O2], (&(*grp)[SPARC_MC_O2])); + __get_user(env->regwptr[WREG_O3], (&(*grp)[SPARC_MC_O3])); + __get_user(env->regwptr[WREG_O4], (&(*grp)[SPARC_MC_O4])); + __get_user(env->regwptr[WREG_O5], (&(*grp)[SPARC_MC_O5])); + __get_user(env->regwptr[WREG_O6], (&(*grp)[SPARC_MC_O6])); + __get_user(env->regwptr[WREG_O7], (&(*grp)[SPARC_MC_O7])); =20 __get_user(fp, &(ucp->tuc_mcontext.mc_fp)); __get_user(i7, &(ucp->tuc_mcontext.mc_i7)); =20 - w_addr =3D TARGET_STACK_BIAS+env->regwptr[UREG_I6]; + w_addr =3D TARGET_STACK_BIAS+env->regwptr[WREG_O6]; if (put_user(fp, w_addr + offsetof(struct target_reg_window, ins[6]), abi_ulong) !=3D 0) { goto do_sigsegv; @@ -534,7 +505,7 @@ void sparc64_get_context(CPUSPARCState *env) target_sigset_t target_set; sigset_t set; =20 - ucp_addr =3D env->regwptr[UREG_I0]; + ucp_addr =3D env->regwptr[WREG_O0]; if (!lock_user_struct(VERIFY_WRITE, ucp, ucp_addr, 0)) { goto do_sigsegv; } @@ -580,16 +551,16 @@ void sparc64_get_context(CPUSPARCState *env) __put_user(env->gregs[5], &((*grp)[SPARC_MC_G5])); __put_user(env->gregs[6], &((*grp)[SPARC_MC_G6])); __put_user(env->gregs[7], &((*grp)[SPARC_MC_G7])); - __put_user(env->regwptr[UREG_I0], &((*grp)[SPARC_MC_O0])); - __put_user(env->regwptr[UREG_I1], &((*grp)[SPARC_MC_O1])); - __put_user(env->regwptr[UREG_I2], &((*grp)[SPARC_MC_O2])); - __put_user(env->regwptr[UREG_I3], &((*grp)[SPARC_MC_O3])); - __put_user(env->regwptr[UREG_I4], &((*grp)[SPARC_MC_O4])); - __put_user(env->regwptr[UREG_I5], &((*grp)[SPARC_MC_O5])); - __put_user(env->regwptr[UREG_I6], &((*grp)[SPARC_MC_O6])); - __put_user(env->regwptr[UREG_I7], &((*grp)[SPARC_MC_O7])); + __put_user(env->regwptr[WREG_O0], &((*grp)[SPARC_MC_O0])); + __put_user(env->regwptr[WREG_O1], &((*grp)[SPARC_MC_O1])); + __put_user(env->regwptr[WREG_O2], &((*grp)[SPARC_MC_O2])); + __put_user(env->regwptr[WREG_O3], &((*grp)[SPARC_MC_O3])); + __put_user(env->regwptr[WREG_O4], &((*grp)[SPARC_MC_O4])); + __put_user(env->regwptr[WREG_O5], &((*grp)[SPARC_MC_O5])); + __put_user(env->regwptr[WREG_O6], &((*grp)[SPARC_MC_O6])); + __put_user(env->regwptr[WREG_O7], &((*grp)[SPARC_MC_O7])); =20 - w_addr =3D TARGET_STACK_BIAS+env->regwptr[UREG_I6]; + w_addr =3D TARGET_STACK_BIAS+env->regwptr[WREG_O6]; fp =3D i7 =3D 0; if (get_user(fp, w_addr + offsetof(struct target_reg_window, ins[6]), abi_ulong) !=3D 0) { --=20 2.17.1 From nobody Sat May 18 18:02:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1572004126; cv=none; d=zoho.com; s=zohoarc; b=myONwLm+LiWvfE/oziy/YL40vhXkVQlWB1SC8WZv/Ws2lpg95WxMTMbxFCMTm2BLnhtLzHjVoFtMWJNQt74pE5kdu9bqC6A8W5oU4/tXM4YXIfsFMl75iPkQJLF6cepLdqNvH+M3cDF2zuGTmd0hWntmjOYYVdvJBCxVb7T+QdA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572004126; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=s0q1vqFGnAcsw/qw8CdtCPCtjm1BmD/+WvFX3Z3uxE4=; b=bh/tLlrodHdM8q8Ln3J6eJYt9c5/nDhKL7Zzk3dJxosHfVjPoT5/tyOvYtQ5ccjM1P7zkEGO9zj6cml5XvTmWzlx2wUeJ6ZXK4O1yj+dqxWD9oYKLmCfnmnGUMzgtvoSwIwo7muSiZb6hRblVMzODeJTHlEif1UVs8ibSXT7npc= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1572004126756627.2694861699923; Fri, 25 Oct 2019 04:48:46 -0700 (PDT) Received: from localhost ([::1]:59028 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNy5F-0001ji-0r for importer@patchew.org; Fri, 25 Oct 2019 07:48:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45077) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNxwP-0006gF-2K for qemu-devel@nongnu.org; Fri, 25 Oct 2019 07:39:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNxwK-0006dP-FL for qemu-devel@nongnu.org; Fri, 25 Oct 2019 07:39:34 -0400 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]:43147) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNxwJ-0006bg-Ex for qemu-devel@nongnu.org; Fri, 25 Oct 2019 07:39:31 -0400 Received: by mail-qk1-x741.google.com with SMTP id a194so1390358qkg.10 for ; Fri, 25 Oct 2019 04:39:30 -0700 (PDT) Received: from localhost.localdomain (rrcs-172-254-253-50.nyc.biz.rr.com. [172.254.253.50]) by smtp.gmail.com with ESMTPSA id x38sm1473335qtc.64.2019.10.25.04.39.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2019 04:39:28 -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=s0q1vqFGnAcsw/qw8CdtCPCtjm1BmD/+WvFX3Z3uxE4=; b=rI/Usq5OenuuvTlRkFeZwBOfcZNf9ytXpIcywXy9m/M8IZ2mPyUS50ReGVbqmJTGcK 6SdGdFYeIdaAAnG/RXVWxBx4cI6SA6/8sNcdVlorKPbVgH9k1iA9QMAz3W7sXNNxoVk0 48Za501PLhL7T45dHqHyex6UmTH95Nf5KJujwROOeK/iWUTLjVzuIZJ8z7xAwFI+z780 Bx6S5fiMefqedeKM+B2hr3NewIbGkj24iHwCR5KdkoPAej8hkEQbMloCvQtnDsSSpeU1 1tKN8epoJCIODXYFWSNibNSYI/uPIYDrLe+y2Lw+VKtb7dg0OkaCMFc+UmpwRz1TE++s eQ/w== 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=s0q1vqFGnAcsw/qw8CdtCPCtjm1BmD/+WvFX3Z3uxE4=; b=SRlf3p2HixRdQxfEWxaY0+gSFXbY7KdYYbImctVJgaZDKPvTbhpkLsR2aYYoMnoHTH FgAex1+LTmy88W6+MS8sIn+jdMqc1PhxB5S2yyFuZlTNKlzteCh7xw0BFk0ZI6g7OaKf Z9rwTq1JJ+pY6VW10KWMA93MR1eJayFEnMIhiEyluqXBVrmcEkbIslWx6sFw+e4uHyUa NI8GW/8ZrtctldwZxdITy83maVwDER6JdS4dUzQHIS3/zcX6MMM9SLa8AFI6g1k2eSlM 6r+BVT0uIm4GDinLmJbiJI8D1uC2ejd/MrTxflFFguTDW6bFQzV8TNh41l/UH7bO1Har YIMQ== X-Gm-Message-State: APjAAAUHa0HNr3vrXkjn47uWd1DK/3+5KS948pwFUyu1e1GFtuljCmOg jUM1wnjYMOpbjBhx/KwOI4VDQ5ghUXQ= X-Google-Smtp-Source: APXvYqwng05J8eA2QXskL8IGIoydiKvqPSwJY3peuZwGomX5CnrahBUbtHWG8D33cJUODw75m/tSRw== X-Received: by 2002:a37:816:: with SMTP id 22mr2479620qki.454.1572003569270; Fri, 25 Oct 2019 04:39:29 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 06/12] linux-user/sparc: Use WREG_SP constant in sparc/signal.c Date: Fri, 25 Oct 2019 07:39:15 -0400 Message-Id: <20191025113921.9412-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191025113921.9412-1-richard.henderson@linaro.org> References: <20191025113921.9412-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::741 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.bennee@linaro.org, laurent@vivier.eu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" s/UREG_FP/WREG_SP/g This is non-obvious because the UREG_FP constant is fact wrong. However, the previous search-and-replace patch made it clear that UREG_FP expands to WREG_O6, and we can see from the enumeration in target/sparc/cpu.h that WREG_O6 is in fact WREG_SP, the stack pointer. The UREG_SP define is unused; remove it. Signed-off-by: Richard Henderson Reviewed-by: Laurent Vivier --- linux-user/sparc/signal.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/linux-user/sparc/signal.c b/linux-user/sparc/signal.c index a967e2db73..0db4c5f84f 100644 --- a/linux-user/sparc/signal.c +++ b/linux-user/sparc/signal.c @@ -104,9 +104,6 @@ struct target_rt_signal_frame { qemu_siginfo_fpu_t fpu_state; }; =20 -#define UREG_FP WREG_O6 -#define UREG_SP WREG_I6 - static inline abi_ulong get_sigframe(struct target_sigaction *sa,=20 CPUSPARCState *env, unsigned long framesize) @@ -201,7 +198,7 @@ void setup_frame(int sig, struct target_sigaction *ka, goto sigsegv; =20 /* 3. signal handler back-trampoline and parameters */ - env->regwptr[UREG_FP] =3D sf_addr; + env->regwptr[WREG_SP] =3D sf_addr; env->regwptr[WREG_O0] =3D sig; env->regwptr[WREG_O1] =3D sf_addr + offsetof(struct target_signal_frame, info); @@ -255,7 +252,7 @@ long do_sigreturn(CPUSPARCState *env) sigset_t host_set; int i; =20 - sf_addr =3D env->regwptr[UREG_FP]; + sf_addr =3D env->regwptr[WREG_SP]; trace_user_do_sigreturn(env, sf_addr); if (!lock_user_struct(VERIFY_READ, sf, sf_addr, 1)) { goto segv_and_exit; --=20 2.17.1 From nobody Sat May 18 18:02:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1572003918; cv=none; d=zoho.com; s=zohoarc; b=PlltaZCnmENBRgJweaH6odWe49XcTVAFpLNsVXSaSQXY+EC3oeVD31WbIKQBTBnnjBXv6XMMffJdmNMtC9QyXeFzB2AxF27357Wu/cv6lXtdTPWbhJNDVqsV5EoDuwkkwpooySTnCTEBI48T/Cs7XZShPTfGy/qtwGHKKQ6OjBY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572003918; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=DlXXOhTdrM3bVVr6VG88KwpML+EyXMPXZ3h5425yg7c=; b=aGWcWeniMRcRUTi37MyaYgGJEbh2p1fQvuo+PAlthCltjHBKQxNbSSXy+GJ1Q6i/FBzhPdu+VLvBTOUZ9Pn7wyjR0eCAnV2nfqUnz3DSNOqhZjFK+cvuAv/vvVPO/sBw7VSM9rIOgtneaue8w3fJ7ExJ2oK3TshvjFNUbZW7c9M= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1572003918209836.4035222447567; Fri, 25 Oct 2019 04:45:18 -0700 (PDT) Received: from localhost ([::1]:58970 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNy1s-0006Mw-RA for importer@patchew.org; Fri, 25 Oct 2019 07:45:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45070) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNxwN-0006XP-0C for qemu-devel@nongnu.org; Fri, 25 Oct 2019 07:39:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNxwK-0006dS-FR for qemu-devel@nongnu.org; Fri, 25 Oct 2019 07:39:33 -0400 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]:45247) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNxwJ-0006cV-9j for qemu-devel@nongnu.org; Fri, 25 Oct 2019 07:39:31 -0400 Received: by mail-qk1-x741.google.com with SMTP id q70so1373453qke.12 for ; Fri, 25 Oct 2019 04:39:31 -0700 (PDT) Received: from localhost.localdomain (rrcs-172-254-253-50.nyc.biz.rr.com. [172.254.253.50]) by smtp.gmail.com with ESMTPSA id x38sm1473335qtc.64.2019.10.25.04.39.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2019 04:39:29 -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=DlXXOhTdrM3bVVr6VG88KwpML+EyXMPXZ3h5425yg7c=; b=ZKOCAS0zDwnYBsA1VAnnjCkenRE6kQmZiPNdzlupEPL4+IjEq4rlAJ5nEd3/TW7qsC tWtfA+9n9ojS9NGxZi0f/H0QlmLPKITQSMdm+aNaQKJi81RsprZrMzdhyUdzdSjDGFWW eJFvk8nnxgl6G9SZKN2DvSb5W9G3ne0p/Xzxm/gvi2TVwWvfGd/f1xdYeA63rG02pIWk vHYbenEs/VyTuInmprNfuq7F80XgQOh9bEi+J4cUVj7Ps6FUhUzW2/j5vgy5g+ymu/ZO /59mzCwx7Qd7Uwhwl98nR3+VXph94aiWNg4V5lPKShlKhqw+RbiIdYZphFUlPZfJf5+r ueOw== 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=DlXXOhTdrM3bVVr6VG88KwpML+EyXMPXZ3h5425yg7c=; b=NfEhwBw+eK9cipl1gz9IxLuxU7dfkmJcN6auOOgzy7R5TjPpVolD9DBn2DHScOFcg6 Y45OaOMkpwMtqKctBitQmkY48ThvtOy2PQpijtwT1zBEw0WGGkHsNjmQdpxI381mGw+j vXMUiJ4j9qZNO/ustBbtsobZrz/OaZSnRkoYLpFb0qYa++PKIhNpEVTCwB+vtM4WYl3C nD1m8qx7P4yP7BhHwnCwfX13CW4AyjeRfO1CdWmNCRxfQ99UYqP5zcuhYUDiZxqXuZkN YIWu/vzh/sOzQJaJPhZT922v3Hw4yxFgDocPvMBL3MQpAEc7ne8HiIDeHWclQ7UmqrwO RkAw== X-Gm-Message-State: APjAAAUJeuoGECvO+EpjIZGdRvep2YiVwE6Q4T96wEu7usTTCR8FBQOe XUXuV0wSiC+VYlRuNJJJ49gRMyu4K+U= X-Google-Smtp-Source: APXvYqwSXT6R/VMFAdSfkmeVTS9NB/EcMQ/xmEBPdmqqBTsNa+rzAq8mJ7f+nejRgl/Tvi7xdVkuqw== X-Received: by 2002:a37:e407:: with SMTP id y7mr2242107qkf.77.1572003570488; Fri, 25 Oct 2019 04:39:30 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 07/12] linux-user/sparc: Fix WREG usage in setup_frame Date: Fri, 25 Oct 2019 07:39:16 -0400 Message-Id: <20191025113921.9412-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191025113921.9412-1-richard.henderson@linaro.org> References: <20191025113921.9412-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::741 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.bennee@linaro.org, laurent@vivier.eu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Use WREG_I0 not WREG_O0 in order to properly save the "ins". The "outs" were saved separately in setup___siginfo. Signed-off-by: Richard Henderson --- linux-user/sparc/signal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/sparc/signal.c b/linux-user/sparc/signal.c index 0db4c5f84f..efb0df7e2b 100644 --- a/linux-user/sparc/signal.c +++ b/linux-user/sparc/signal.c @@ -192,7 +192,7 @@ void setup_frame(int sig, struct target_sigaction *ka, __put_user(env->regwptr[i + WREG_L0], &sf->ss.locals[i]); } for (i =3D 0; i < 8; i++) { - __put_user(env->regwptr[i + WREG_O0], &sf->ss.ins[i]); + __put_user(env->regwptr[i + WREG_I0], &sf->ss.ins[i]); } if (err) goto sigsegv; --=20 2.17.1 From nobody Sat May 18 18:02:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1572003928; cv=none; d=zoho.com; s=zohoarc; b=RfGUv4rY+QwW1A+Xbm6wBJYe6Ps5TZojLC8wxn2BpPUxjj8FI4SNkrYFpLE4PYrigyiQjw8VV0cLuTk3LcEXhyKMDKwDiDrZXA/l6EeMqTiYVL8cK21ZaYljFh0whJxP+9L3ijF8m+Ay/xh83oFeX5ECJC6Z07tx7Y/Z9tsJzkw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572003928; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=m328r1FYSeCQVBFpcE1l4M4AliU0R8Zo7qDrsYY6RNg=; b=iY8xWDPoeeYTX38blJW4u37Y6NW/QSyT4Neo+LcY2VtVeRnuaqBOa0zNb2QQDEyLJNZdkuh5NbCr6fO9i2tlHHJ88MVJqxmNyl9dh/1E7DAfMnnguLdDUj0tRbaijwHfHHNlu4GVBzg69iRbGnh6PK3a8prqK16c9UqY+p8hN0Y= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1572003928076275.7347151658148; Fri, 25 Oct 2019 04:45:28 -0700 (PDT) Received: from localhost ([::1]:58974 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNy22-0006V4-8G for importer@patchew.org; Fri, 25 Oct 2019 07:45:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45078) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNxwP-0006gG-0m for qemu-devel@nongnu.org; Fri, 25 Oct 2019 07:39:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNxwK-0006dn-Tb for qemu-devel@nongnu.org; Fri, 25 Oct 2019 07:39:34 -0400 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]:38737) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNxwK-0006de-QC for qemu-devel@nongnu.org; Fri, 25 Oct 2019 07:39:32 -0400 Received: by mail-qk1-x743.google.com with SMTP id p4so1403638qkf.5 for ; Fri, 25 Oct 2019 04:39:32 -0700 (PDT) Received: from localhost.localdomain (rrcs-172-254-253-50.nyc.biz.rr.com. [172.254.253.50]) by smtp.gmail.com with ESMTPSA id x38sm1473335qtc.64.2019.10.25.04.39.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2019 04:39:30 -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=m328r1FYSeCQVBFpcE1l4M4AliU0R8Zo7qDrsYY6RNg=; b=t+CH6D1q+c6ybGFyc7uqbCqi3hmT+rWYMs3PBalQ17bvjwt2XR5A0nuC/zb1+wdhXo d2zy3tbXaUWICq5RcIm1WN0h8Pfj2b8d6Nk4ATlFLTVACTuoYB58p52TKz1vPg1HRLoo mf5b/HO+FjffDsUrjfCXrCv/QoO5wPdcTnn8bED5rRkkD8LwSqUeD+hwaA9D1YS7dCyj jcxjzCXZs6NqEsUcVIxujx+U05gUueav1vPE+HAB2my8RmkEdHmrbmFFTN3DR8C/taOp l5IzK24lzXGVwnk0Cfzxz2s3NAUsEad+9A9ztP41/xYELs5MAkRfwBmRZCfmkA3VzZ+X yWrA== 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=m328r1FYSeCQVBFpcE1l4M4AliU0R8Zo7qDrsYY6RNg=; b=nXWslMshUHa/Uq0KTALGwb3VmHTdE8HS9TsgesCH01jlDsbp9XfefrWMDCVe1qvQyY Zzzu3c3M6vzqaVjlYU6IJ24IrPxs7roVJRG38YV54WHrVj21CjQzaDKAG1Dd11E9vM0d hHJAL5w/CiOMV3+DTnXTQsaQVj3fcnJ+xQGEC5NY3I+l9m/WEyP2ThqWECBkwrAr+LsA +Bv4YRj20tDXvLyzBpYCwa3H2cMjtohZs/sAp50Q/QIYxz6rMkrSfqyDhsrH7gLtEMJ3 jghqb4RIjbpqzeyC7MJHUYlk8NCqzC8+TpKc4U/psKcyqor9+O8YJQjHfwlx+2KhPHT9 AzFA== X-Gm-Message-State: APjAAAWUxHb8dj8Qkb4s8qAyUp+W4oO4/kRCNabEZCtK61xLSzGgyj07 D6Al4BNAjzG0CT1X14/IYzxMEIaSKB8= X-Google-Smtp-Source: APXvYqyWlgK3HEosAj+fc/Dj08EFwl8zjoxnnDyu5SEKJ6q/W+DMJo2QBFuFy6LnUFOZgQvXLatVgg== X-Received: by 2002:a37:6442:: with SMTP id y63mr2331654qkb.31.1572003571500; Fri, 25 Oct 2019 04:39:31 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 08/12] linux-user/sparc64: Fix target_signal_frame Date: Fri, 25 Oct 2019 07:39:17 -0400 Message-Id: <20191025113921.9412-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191025113921.9412-1-richard.henderson@linaro.org> References: <20191025113921.9412-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::743 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.bennee@linaro.org, laurent@vivier.eu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Instructions are always 4 bytes; use uint32_t not abi_ulong. Signed-off-by: Richard Henderson Reviewed-by: Laurent Vivier --- linux-user/sparc/signal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux-user/sparc/signal.c b/linux-user/sparc/signal.c index efb0df7e2b..ecfdf937e4 100644 --- a/linux-user/sparc/signal.c +++ b/linux-user/sparc/signal.c @@ -87,7 +87,7 @@ struct target_signal_frame { struct sparc_stackf ss; __siginfo_t info; abi_ulong fpu_save; - abi_ulong insns[2] __attribute__ ((aligned (8))); + uint32_t insns[2] __attribute__ ((aligned (8))); abi_ulong extramask[TARGET_NSIG_WORDS - 1]; abi_ulong extra_size; /* Should be 0 */ qemu_siginfo_fpu_t fpu_state; @@ -98,7 +98,7 @@ struct target_rt_signal_frame { abi_ulong regs[20]; sigset_t mask; abi_ulong fpu_save; - unsigned int insns[2]; + uint32_t insns[2]; stack_t stack; unsigned int extra_size; /* Should be 0 */ qemu_siginfo_fpu_t fpu_state; --=20 2.17.1 From nobody Sat May 18 18:02:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1572004131; cv=none; d=zoho.com; s=zohoarc; b=jJcLrwdbDaSimvo2Rp/vPKgd0T/w7t6952KKzN2pqRsHlByhypWKmgqvDGDU3fHXaLaFm9AysyfrxkG+4ZwC1odtjd58HJswmydc8xKukW+oEq8YGOk7R7NgSa/t40qpLKKat1Dm3rd22/V7DGbNw9I2B75QDW9tKTirJ2ak9Nc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572004131; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=RnDViLSDat0OoWx7qqWpvg/5kMhAgwG0svm/xGueM9k=; b=Agir/XKdvRhXmmw3sQNoWvGQybGS+2XwiRnAM5OjWMEvWBUkZyWfH7pIV6oZH6e/9JeJRLCD4p15cF3OebBBsngWpAp1luaqTZ8isaqHJN2CO4RQ4iUVTlLbuCTmZEqo2bhPDonfKcFxRgIqt1UZRHi7Yup3/Uzslv554IElNeg= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1572004131635853.0496273772063; Fri, 25 Oct 2019 04:48:51 -0700 (PDT) Received: from localhost ([::1]:59024 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNy5G-0001jC-Og for importer@patchew.org; Fri, 25 Oct 2019 07:48:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45132) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNxwV-0006qY-Uu for qemu-devel@nongnu.org; Fri, 25 Oct 2019 07:39:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNxwP-0006fV-0r for qemu-devel@nongnu.org; Fri, 25 Oct 2019 07:39:41 -0400 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]:41647) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNxwN-0006eB-W9 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 07:39:36 -0400 Received: by mail-qk1-x741.google.com with SMTP id p10so1397698qkg.8 for ; Fri, 25 Oct 2019 04:39:33 -0700 (PDT) Received: from localhost.localdomain (rrcs-172-254-253-50.nyc.biz.rr.com. [172.254.253.50]) by smtp.gmail.com with ESMTPSA id x38sm1473335qtc.64.2019.10.25.04.39.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2019 04:39:31 -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=RnDViLSDat0OoWx7qqWpvg/5kMhAgwG0svm/xGueM9k=; b=FJ5MJc/LQoBQp1FtnIgd+b2Fq0eEAiWSK84BjM+/iY6MJCuvtOzmApqpNogysI2Rwl BZ6wwSDwS9W13snWoWaKv381WsEoIO/5WVp1u3uF3QzurpGmjM0xGa9hIjKp40YFGbjO 3bvuS2zd6GX24xDHp9lRVCZDpFZrP88YfxXSOrE7BjpiFJ0p1DZ//w7jCwGWORbhAgm9 4WDkN3x4Ka8wOfiD4iUut7WFlGKkMJy9ZZIG/YDlqDCG2b8xrr0uO232MTAtRbTWLCYv JnO6CRulhp2e0LKl4m9HS0WhBJ72TchUbmtUIIwrcZkLuWpYZEowvGEQPvwWt1PhEL05 /ZKQ== 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=RnDViLSDat0OoWx7qqWpvg/5kMhAgwG0svm/xGueM9k=; b=WdhWaXlBs+Y6QWjAmQIHK3Uyr7ewQVZc54GqsI1UtbIE+oKfPVATpHtE2KSZi8WUKY I+a3z5+WWdrexH2/HUBTr1bdY7F5zVTaJK44Xx+5T4luKtKtfKyhUAdcGoVPgK3L45/O G4+1PL0HJpY5rT5XqPTtDkq8GA5OgzYKCUrN/WQ9LMD7WQIrf/NySH58eK4QA1+NqSPZ +iPq2oKwJwuWsU2/AmqgCit0mLWMEh5oSOdhPnTJfCVt0xitr78M1pksUQiHg+m+vLoy YJA9RAETf6khfJcnlx1Ifgj0uyBy1MHp4/r9JQw9aiF2r6fdiwmbLNTP4racrgRURo7w 0JHw== X-Gm-Message-State: APjAAAXXOmuNSghANq79muolLTyvMUzdkJR9PAPKKn0bQ8OJzjNtE2Z+ ZcA4RO8Tpk3meLSWAOx4wZALegO9jDo= X-Google-Smtp-Source: APXvYqy8JTzhPgx06Wfwb4WF1ridN/IlXL3FBMC3ooACuKCA98I5ScWg+gg1uiB98NQLK2gi6nBAMg== X-Received: by 2002:a37:c40d:: with SMTP id d13mr2381529qki.371.1572003572498; Fri, 25 Oct 2019 04:39:32 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 09/12] linux-user: Rename cpu_clone_regs to cpu_clone_regs_child Date: Fri, 25 Oct 2019 07:39:18 -0400 Message-Id: <20191025113921.9412-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191025113921.9412-1-richard.henderson@linaro.org> References: <20191025113921.9412-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::741 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.bennee@linaro.org, laurent@vivier.eu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" We will need a target-specific hook for adjusting registers in the parent during clone. To avoid confusion, rename the one we have to make it clear it affects the child. At the same time, pass in the flags from the clone syscall. We will need them for correct behaviour for Sparc. Reviewed-by: Laurent Vivier Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- v2: Add flags parameter. --- linux-user/aarch64/target_cpu.h | 3 ++- linux-user/alpha/target_cpu.h | 3 ++- linux-user/arm/target_cpu.h | 3 ++- linux-user/cris/target_cpu.h | 3 ++- linux-user/hppa/target_cpu.h | 3 ++- linux-user/i386/target_cpu.h | 3 ++- linux-user/m68k/target_cpu.h | 3 ++- linux-user/microblaze/target_cpu.h | 3 ++- linux-user/mips/target_cpu.h | 3 ++- linux-user/nios2/target_cpu.h | 3 ++- linux-user/openrisc/target_cpu.h | 4 +++- linux-user/ppc/target_cpu.h | 3 ++- linux-user/riscv/target_cpu.h | 3 ++- linux-user/s390x/target_cpu.h | 3 ++- linux-user/sh4/target_cpu.h | 3 ++- linux-user/sparc/target_cpu.h | 3 ++- linux-user/tilegx/target_cpu.h | 3 ++- linux-user/xtensa/target_cpu.h | 4 +++- linux-user/syscall.c | 4 ++-- 19 files changed, 40 insertions(+), 20 deletions(-) diff --git a/linux-user/aarch64/target_cpu.h b/linux-user/aarch64/target_cp= u.h index a021c95fa4..cd012e0dc1 100644 --- a/linux-user/aarch64/target_cpu.h +++ b/linux-user/aarch64/target_cpu.h @@ -19,7 +19,8 @@ #ifndef AARCH64_TARGET_CPU_H #define AARCH64_TARGET_CPU_H =20 -static inline void cpu_clone_regs(CPUARMState *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUARMState *env, target_ulong new= sp, + unsigned flags) { if (newsp) { env->xregs[31] =3D newsp; diff --git a/linux-user/alpha/target_cpu.h b/linux-user/alpha/target_cpu.h index ac4d255ae7..37ba00cf41 100644 --- a/linux-user/alpha/target_cpu.h +++ b/linux-user/alpha/target_cpu.h @@ -19,7 +19,8 @@ #ifndef ALPHA_TARGET_CPU_H #define ALPHA_TARGET_CPU_H =20 -static inline void cpu_clone_regs(CPUAlphaState *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUAlphaState *env, target_ulong n= ewsp, + unsigned flags) { if (newsp) { env->ir[IR_SP] =3D newsp; diff --git a/linux-user/arm/target_cpu.h b/linux-user/arm/target_cpu.h index 3f79356a07..6e2ba8ad4b 100644 --- a/linux-user/arm/target_cpu.h +++ b/linux-user/arm/target_cpu.h @@ -41,7 +41,8 @@ static inline unsigned long arm_max_reserved_va(CPUState = *cs) } #define MAX_RESERVED_VA arm_max_reserved_va =20 -static inline void cpu_clone_regs(CPUARMState *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUARMState *env, target_ulong new= sp, + unsigned flags) { if (newsp) { env->regs[13] =3D newsp; diff --git a/linux-user/cris/target_cpu.h b/linux-user/cris/target_cpu.h index 2309343979..eacc4d8d13 100644 --- a/linux-user/cris/target_cpu.h +++ b/linux-user/cris/target_cpu.h @@ -20,7 +20,8 @@ #ifndef CRIS_TARGET_CPU_H #define CRIS_TARGET_CPU_H =20 -static inline void cpu_clone_regs(CPUCRISState *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUCRISState *env, target_ulong ne= wsp, + unsigned flags) { if (newsp) { env->regs[14] =3D newsp; diff --git a/linux-user/hppa/target_cpu.h b/linux-user/hppa/target_cpu.h index 1c539bdbd6..f250770790 100644 --- a/linux-user/hppa/target_cpu.h +++ b/linux-user/hppa/target_cpu.h @@ -19,7 +19,8 @@ #ifndef HPPA_TARGET_CPU_H #define HPPA_TARGET_CPU_H =20 -static inline void cpu_clone_regs(CPUHPPAState *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUHPPAState *env, target_ulong ne= wsp, + unsigned flags) { if (newsp) { env->gr[30] =3D newsp; diff --git a/linux-user/i386/target_cpu.h b/linux-user/i386/target_cpu.h index ece04d0966..1fadbf57c3 100644 --- a/linux-user/i386/target_cpu.h +++ b/linux-user/i386/target_cpu.h @@ -20,7 +20,8 @@ #ifndef I386_TARGET_CPU_H #define I386_TARGET_CPU_H =20 -static inline void cpu_clone_regs(CPUX86State *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUX86State *env, target_ulong new= sp, + unsigned flags) { if (newsp) { env->regs[R_ESP] =3D newsp; diff --git a/linux-user/m68k/target_cpu.h b/linux-user/m68k/target_cpu.h index bc7446fbaf..57b647bc07 100644 --- a/linux-user/m68k/target_cpu.h +++ b/linux-user/m68k/target_cpu.h @@ -21,7 +21,8 @@ #ifndef M68K_TARGET_CPU_H #define M68K_TARGET_CPU_H =20 -static inline void cpu_clone_regs(CPUM68KState *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUM68KState *env, target_ulong ne= wsp, + unsigned flags) { if (newsp) { env->aregs[7] =3D newsp; diff --git a/linux-user/microblaze/target_cpu.h b/linux-user/microblaze/tar= get_cpu.h index 73e139938c..e9bc0fce65 100644 --- a/linux-user/microblaze/target_cpu.h +++ b/linux-user/microblaze/target_cpu.h @@ -19,7 +19,8 @@ #ifndef MICROBLAZE_TARGET_CPU_H #define MICROBLAZE_TARGET_CPU_H =20 -static inline void cpu_clone_regs(CPUMBState *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUMBState *env, target_ulong news= p, + unsigned flags) { if (newsp) { env->regs[R_SP] =3D newsp; diff --git a/linux-user/mips/target_cpu.h b/linux-user/mips/target_cpu.h index 02cf5eeff7..8601f712e0 100644 --- a/linux-user/mips/target_cpu.h +++ b/linux-user/mips/target_cpu.h @@ -19,7 +19,8 @@ #ifndef MIPS_TARGET_CPU_H #define MIPS_TARGET_CPU_H =20 -static inline void cpu_clone_regs(CPUMIPSState *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUMIPSState *env, target_ulong ne= wsp, + unsigned flags) { if (newsp) { env->active_tc.gpr[29] =3D newsp; diff --git a/linux-user/nios2/target_cpu.h b/linux-user/nios2/target_cpu.h index 5596c05c9c..fe5de7a9e3 100644 --- a/linux-user/nios2/target_cpu.h +++ b/linux-user/nios2/target_cpu.h @@ -20,7 +20,8 @@ #ifndef NIOS2_TARGET_CPU_H #define NIOS2_TARGET_CPU_H =20 -static inline void cpu_clone_regs(CPUNios2State *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUNios2State *env, target_ulong n= ewsp, + unsigned flags) { if (newsp) { env->regs[R_SP] =3D newsp; diff --git a/linux-user/openrisc/target_cpu.h b/linux-user/openrisc/target_= cpu.h index 32ff135089..309cf3eeb7 100644 --- a/linux-user/openrisc/target_cpu.h +++ b/linux-user/openrisc/target_cpu.h @@ -20,7 +20,9 @@ #ifndef OPENRISC_TARGET_CPU_H #define OPENRISC_TARGET_CPU_H =20 -static inline void cpu_clone_regs(CPUOpenRISCState *env, target_ulong news= p) +static inline void cpu_clone_regs_child(CPUOpenRISCState *env, + target_ulong newsp, + unsigned flags) { if (newsp) { cpu_set_gpr(env, 1, newsp); diff --git a/linux-user/ppc/target_cpu.h b/linux-user/ppc/target_cpu.h index c4641834e7..028b28312c 100644 --- a/linux-user/ppc/target_cpu.h +++ b/linux-user/ppc/target_cpu.h @@ -19,7 +19,8 @@ #ifndef PPC_TARGET_CPU_H #define PPC_TARGET_CPU_H =20 -static inline void cpu_clone_regs(CPUPPCState *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUPPCState *env, target_ulong new= sp, + unsigned flags) { if (newsp) { env->gpr[1] =3D newsp; diff --git a/linux-user/riscv/target_cpu.h b/linux-user/riscv/target_cpu.h index 90f9a4171e..26dcafab1c 100644 --- a/linux-user/riscv/target_cpu.h +++ b/linux-user/riscv/target_cpu.h @@ -1,7 +1,8 @@ #ifndef RISCV_TARGET_CPU_H #define RISCV_TARGET_CPU_H =20 -static inline void cpu_clone_regs(CPURISCVState *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPURISCVState *env, target_ulong n= ewsp, + unsigned flags) { if (newsp) { env->gpr[xSP] =3D newsp; diff --git a/linux-user/s390x/target_cpu.h b/linux-user/s390x/target_cpu.h index aa181ceaee..0b19e42f75 100644 --- a/linux-user/s390x/target_cpu.h +++ b/linux-user/s390x/target_cpu.h @@ -19,7 +19,8 @@ #ifndef S390X_TARGET_CPU_H #define S390X_TARGET_CPU_H =20 -static inline void cpu_clone_regs(CPUS390XState *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUS390XState *env, target_ulong n= ewsp, + unsigned flags) { if (newsp) { env->regs[15] =3D newsp; diff --git a/linux-user/sh4/target_cpu.h b/linux-user/sh4/target_cpu.h index b0be9a2c1b..857af43ee3 100644 --- a/linux-user/sh4/target_cpu.h +++ b/linux-user/sh4/target_cpu.h @@ -19,7 +19,8 @@ #ifndef SH4_TARGET_CPU_H #define SH4_TARGET_CPU_H =20 -static inline void cpu_clone_regs(CPUSH4State *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUSH4State *env, target_ulong new= sp, + unsigned flags) { if (newsp) { env->gregs[15] =3D newsp; diff --git a/linux-user/sparc/target_cpu.h b/linux-user/sparc/target_cpu.h index b30fbc72c4..029b0fc547 100644 --- a/linux-user/sparc/target_cpu.h +++ b/linux-user/sparc/target_cpu.h @@ -20,7 +20,8 @@ #ifndef SPARC_TARGET_CPU_H #define SPARC_TARGET_CPU_H =20 -static inline void cpu_clone_regs(CPUSPARCState *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUSPARCState *env, target_ulong n= ewsp, + unsigned flags) { if (newsp) { env->regwptr[22] =3D newsp; diff --git a/linux-user/tilegx/target_cpu.h b/linux-user/tilegx/target_cpu.h index d1aa5824f2..0523dc414c 100644 --- a/linux-user/tilegx/target_cpu.h +++ b/linux-user/tilegx/target_cpu.h @@ -19,7 +19,8 @@ #ifndef TILEGX_TARGET_CPU_H #define TILEGX_TARGET_CPU_H =20 -static inline void cpu_clone_regs(CPUTLGState *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUTLGState *env, target_ulong new= sp, + unsigned flags) { if (newsp) { env->regs[TILEGX_R_SP] =3D newsp; diff --git a/linux-user/xtensa/target_cpu.h b/linux-user/xtensa/target_cpu.h index e31efe3ea0..84f67d469e 100644 --- a/linux-user/xtensa/target_cpu.h +++ b/linux-user/xtensa/target_cpu.h @@ -4,7 +4,9 @@ #ifndef XTENSA_TARGET_CPU_H #define XTENSA_TARGET_CPU_H =20 -static inline void cpu_clone_regs(CPUXtensaState *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUXtensaState *env, + target_ulong newsp, + unsigned flags) { if (newsp) { env->regs[1] =3D newsp; diff --git a/linux-user/syscall.c b/linux-user/syscall.c index f1ab81b917..a07d4b4774 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -5718,7 +5718,7 @@ static int do_fork(CPUArchState *env, unsigned int fl= ags, abi_ulong newsp, /* we create a new CPU instance. */ new_env =3D cpu_copy(env); /* Init regs that differ from the parent. */ - cpu_clone_regs(new_env, newsp); + cpu_clone_regs_child(new_env, newsp, flags); new_cpu =3D env_cpu(new_env); new_cpu->opaque =3D ts; ts->bprm =3D parent_ts->bprm; @@ -5797,7 +5797,7 @@ static int do_fork(CPUArchState *env, unsigned int fl= ags, abi_ulong newsp, ret =3D fork(); if (ret =3D=3D 0) { /* Child Process. */ - cpu_clone_regs(env, newsp); + cpu_clone_regs_child(env, newsp, flags); fork_end(1); /* There is a race condition here. The parent process could theoretically read the TID in the child process before the = child --=20 2.17.1 From nobody Sat May 18 18:02:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1572004300; cv=none; d=zoho.com; s=zohoarc; b=MPZ25UX8IAaFlC024EBXTYlWW5bcMZbzcw12HtjtD+lbfIL+ROXKikUtBWguH2m3FmTRYDZeD/nHgrHjBbeqNvsoBRxCfH48m9uF7KFawAFM/sF+gkPdnC4F5VsYL3JHFNjQwjweHKMOXDcwzYoYba9hF2jX4ZKIBvViKatiGos= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572004300; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=Vn70UJTo0fstge9Ke9wJC+Kr4lifWc+iunKsVrVX6Oo=; b=Ifs9ISq4HerXzV6oUKeh+uDl6eU0ZHIY69A/SM6AQve8+UBQdveymQ5uH0l9QfINS8qot+LrgODzuvO7C0BNCaq8CmG5sTxYD1cLo8PhFVClsH6y0jziNTR7e6x2fr9dtZhKV1rNSaRkTh7jc/66LLV1F0jjFhjngmehqLNIgVI= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1572004300641713.5859008637907; Fri, 25 Oct 2019 04:51:40 -0700 (PDT) Received: from localhost ([::1]:59068 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNy82-0005sY-AR for importer@patchew.org; Fri, 25 Oct 2019 07:51:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45131) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNxwV-0006qX-Um for qemu-devel@nongnu.org; Fri, 25 Oct 2019 07:39:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNxwP-0006fl-2s for qemu-devel@nongnu.org; Fri, 25 Oct 2019 07:39:41 -0400 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]:36796) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNxwO-0006eV-U6 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 07:39:37 -0400 Received: by mail-qk1-x744.google.com with SMTP id y189so1414701qkc.3 for ; Fri, 25 Oct 2019 04:39:34 -0700 (PDT) Received: from localhost.localdomain (rrcs-172-254-253-50.nyc.biz.rr.com. [172.254.253.50]) by smtp.gmail.com with ESMTPSA id x38sm1473335qtc.64.2019.10.25.04.39.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2019 04:39:32 -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=Vn70UJTo0fstge9Ke9wJC+Kr4lifWc+iunKsVrVX6Oo=; b=bM3TJ03b9fHB0OAVP9OvNj+ONB000mTRXgCt5VoknLpNKKO78Pb7v73tIiW4g/e10B OSN50aqIQwbjR/bKhFOwnmMsrMuFu5txbbOlNuR2D/hYIl73pHSLj8heTW9WcYbUgOPI bTdlOxGIK7lwvdFH4vJDq1MbkG6EqRwQ0Hq103vUruHBO/Ga2T4kpTlJ7YivsIOs42Uu LNuk5l81wj6Q0cZZUVV4ZIZjPOcvmK362pL2Oo3mT7BNrBQfjMiyEq4PGH0jmunbUYEk 55oKxIYCJ0Qqt1spfXsbi+/RHi/wByJVu3zEGFMEuNI+Is0dgrS25Ppo9A2Zy+v+DHJ0 tKyw== 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=Vn70UJTo0fstge9Ke9wJC+Kr4lifWc+iunKsVrVX6Oo=; b=e2gcJBKJwOC2CbJrYUikseCvScu3DzB3rOfWXAU0sIPC80LE5WJqF+bAPYMJiA7u4z DDsdRawDFCRizHirZO9LvZRJs0QXlq7hZkLTYJZl+IsNpbXTIUfb4aQOyBRjpI8ksHQm wo1CnpDgHfHKkyNuMJoz+k/OnSb3xF79jEos+LKFHIy7oUpBuoBl3mMfGga7c6Z3wlgw 2IWksuOK8JovWsqqXYFP+QchfQ/MkA+/w69xbVQyLMl1YQROTdCtanh6DUftKBgrC8RL BU2L/f59BjcPScu28eD4Yi9HbA8yK+ukyZACAaFbA2nmf8K+Qw32I+z5dcOiSWRi6uv0 KAeQ== X-Gm-Message-State: APjAAAWunITzP93ypK2sMdjpKYmU3TMQC2pFER6qvaEhLkGX0MXyuMgc K6UshbwebbKtasc6rlmVFiQcqF03qL8= X-Google-Smtp-Source: APXvYqw4qOM1DESoye6OJ6RzBMSCAXxpE6qnBDSmp61NgZJTdKw9UNqYJE2cvd4baXoluMz/2vpZLA== X-Received: by 2002:a05:620a:1374:: with SMTP id d20mr2458240qkl.229.1572003573458; Fri, 25 Oct 2019 04:39:33 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 10/12] linux-user: Introduce cpu_clone_regs_parent Date: Fri, 25 Oct 2019 07:39:19 -0400 Message-Id: <20191025113921.9412-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191025113921.9412-1-richard.henderson@linaro.org> References: <20191025113921.9412-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::744 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.bennee@linaro.org, laurent@vivier.eu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" We will need a target-specific hook for adjusting registers in the parent during clone. Add an empty inline function for each target, and invoke it from the proper places. Reviewed-by: Laurent Vivier Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- linux-user/aarch64/target_cpu.h | 4 ++++ linux-user/alpha/target_cpu.h | 4 ++++ linux-user/arm/target_cpu.h | 4 ++++ linux-user/cris/target_cpu.h | 4 ++++ linux-user/hppa/target_cpu.h | 4 ++++ linux-user/i386/target_cpu.h | 4 ++++ linux-user/m68k/target_cpu.h | 4 ++++ linux-user/microblaze/target_cpu.h | 4 ++++ linux-user/mips/target_cpu.h | 4 ++++ linux-user/nios2/target_cpu.h | 4 ++++ linux-user/openrisc/target_cpu.h | 4 ++++ linux-user/ppc/target_cpu.h | 4 ++++ linux-user/riscv/target_cpu.h | 4 ++++ linux-user/s390x/target_cpu.h | 4 ++++ linux-user/sh4/target_cpu.h | 4 ++++ linux-user/sparc/target_cpu.h | 4 ++++ linux-user/tilegx/target_cpu.h | 4 ++++ linux-user/xtensa/target_cpu.h | 4 ++++ linux-user/syscall.c | 2 ++ 19 files changed, 74 insertions(+) diff --git a/linux-user/aarch64/target_cpu.h b/linux-user/aarch64/target_cp= u.h index cd012e0dc1..6cc02e7dcd 100644 --- a/linux-user/aarch64/target_cpu.h +++ b/linux-user/aarch64/target_cpu.h @@ -28,6 +28,10 @@ static inline void cpu_clone_regs_child(CPUARMState *env= , target_ulong newsp, env->xregs[0] =3D 0; } =20 +static inline void cpu_clone_regs_parent(CPUARMState *env, unsigned flags) +{ +} + static inline void cpu_set_tls(CPUARMState *env, target_ulong newtls) { /* Note that AArch64 Linux keeps the TLS pointer in TPIDR; this is diff --git a/linux-user/alpha/target_cpu.h b/linux-user/alpha/target_cpu.h index 37ba00cf41..dd25e18f47 100644 --- a/linux-user/alpha/target_cpu.h +++ b/linux-user/alpha/target_cpu.h @@ -29,6 +29,10 @@ static inline void cpu_clone_regs_child(CPUAlphaState *e= nv, target_ulong newsp, env->ir[IR_A3] =3D 0; } =20 +static inline void cpu_clone_regs_parent(CPUAlphaState *env, unsigned flag= s) +{ +} + static inline void cpu_set_tls(CPUAlphaState *env, target_ulong newtls) { env->unique =3D newtls; diff --git a/linux-user/arm/target_cpu.h b/linux-user/arm/target_cpu.h index 6e2ba8ad4b..2747211b24 100644 --- a/linux-user/arm/target_cpu.h +++ b/linux-user/arm/target_cpu.h @@ -50,6 +50,10 @@ static inline void cpu_clone_regs_child(CPUARMState *env= , target_ulong newsp, env->regs[0] =3D 0; } =20 +static inline void cpu_clone_regs_parent(CPUARMState *env, unsigned flags) +{ +} + static inline void cpu_set_tls(CPUARMState *env, target_ulong newtls) { if (access_secure_reg(env)) { diff --git a/linux-user/cris/target_cpu.h b/linux-user/cris/target_cpu.h index eacc4d8d13..74ead55c81 100644 --- a/linux-user/cris/target_cpu.h +++ b/linux-user/cris/target_cpu.h @@ -29,6 +29,10 @@ static inline void cpu_clone_regs_child(CPUCRISState *en= v, target_ulong newsp, env->regs[10] =3D 0; } =20 +static inline void cpu_clone_regs_parent(CPUCRISState *env, unsigned flags) +{ +} + static inline void cpu_set_tls(CPUCRISState *env, target_ulong newtls) { env->pregs[PR_PID] =3D (env->pregs[PR_PID] & 0xff) | newtls; diff --git a/linux-user/hppa/target_cpu.h b/linux-user/hppa/target_cpu.h index f250770790..71654b3cd4 100644 --- a/linux-user/hppa/target_cpu.h +++ b/linux-user/hppa/target_cpu.h @@ -32,6 +32,10 @@ static inline void cpu_clone_regs_child(CPUHPPAState *en= v, target_ulong newsp, env->iaoq_b =3D env->gr[31] + 4; } =20 +static inline void cpu_clone_regs_parent(CPUHPPAState *env, unsigned flags) +{ +} + static inline void cpu_set_tls(CPUHPPAState *env, target_ulong newtls) { env->cr[27] =3D newtls; diff --git a/linux-user/i386/target_cpu.h b/linux-user/i386/target_cpu.h index 1fadbf57c3..0b44530854 100644 --- a/linux-user/i386/target_cpu.h +++ b/linux-user/i386/target_cpu.h @@ -29,6 +29,10 @@ static inline void cpu_clone_regs_child(CPUX86State *env= , target_ulong newsp, env->regs[R_EAX] =3D 0; } =20 +static inline void cpu_clone_regs_parent(CPUX86State *env, unsigned flags) +{ +} + #if defined(TARGET_ABI32) abi_long do_set_thread_area(CPUX86State *env, abi_ulong ptr); =20 diff --git a/linux-user/m68k/target_cpu.h b/linux-user/m68k/target_cpu.h index 57b647bc07..c3f288dfe8 100644 --- a/linux-user/m68k/target_cpu.h +++ b/linux-user/m68k/target_cpu.h @@ -30,6 +30,10 @@ static inline void cpu_clone_regs_child(CPUM68KState *en= v, target_ulong newsp, env->dregs[0] =3D 0; } =20 +static inline void cpu_clone_regs_parent(CPUM68KState *env, unsigned flags) +{ +} + static inline void cpu_set_tls(CPUM68KState *env, target_ulong newtls) { CPUState *cs =3D env_cpu(env); diff --git a/linux-user/microblaze/target_cpu.h b/linux-user/microblaze/tar= get_cpu.h index e9bc0fce65..ce7b22ece7 100644 --- a/linux-user/microblaze/target_cpu.h +++ b/linux-user/microblaze/target_cpu.h @@ -28,6 +28,10 @@ static inline void cpu_clone_regs_child(CPUMBState *env,= target_ulong newsp, env->regs[3] =3D 0; } =20 +static inline void cpu_clone_regs_parent(CPUMBState *env, unsigned flags) +{ +} + static inline void cpu_set_tls(CPUMBState *env, target_ulong newtls) { env->regs[21] =3D newtls; diff --git a/linux-user/mips/target_cpu.h b/linux-user/mips/target_cpu.h index 8601f712e0..758ae4d933 100644 --- a/linux-user/mips/target_cpu.h +++ b/linux-user/mips/target_cpu.h @@ -29,6 +29,10 @@ static inline void cpu_clone_regs_child(CPUMIPSState *en= v, target_ulong newsp, env->active_tc.gpr[2] =3D 0; } =20 +static inline void cpu_clone_regs_parent(CPUMIPSState *env, unsigned flags) +{ +} + static inline void cpu_set_tls(CPUMIPSState *env, target_ulong newtls) { env->active_tc.CP0_UserLocal =3D newtls; diff --git a/linux-user/nios2/target_cpu.h b/linux-user/nios2/target_cpu.h index fe5de7a9e3..50f0381067 100644 --- a/linux-user/nios2/target_cpu.h +++ b/linux-user/nios2/target_cpu.h @@ -29,6 +29,10 @@ static inline void cpu_clone_regs_child(CPUNios2State *e= nv, target_ulong newsp, env->regs[R_RET0] =3D 0; } =20 +static inline void cpu_clone_regs_parent(CPUNios2State *env, unsigned flag= s) +{ +} + static inline void cpu_set_tls(CPUNios2State *env, target_ulong newtls) { /* diff --git a/linux-user/openrisc/target_cpu.h b/linux-user/openrisc/target_= cpu.h index 309cf3eeb7..74370d67c4 100644 --- a/linux-user/openrisc/target_cpu.h +++ b/linux-user/openrisc/target_cpu.h @@ -30,6 +30,10 @@ static inline void cpu_clone_regs_child(CPUOpenRISCState= *env, cpu_set_gpr(env, 11, 0); } =20 +static inline void cpu_clone_regs_parent(CPUOpenRISCState *env, unsigned f= lags) +{ +} + static inline void cpu_set_tls(CPUOpenRISCState *env, target_ulong newtls) { cpu_set_gpr(env, 10, newtls); diff --git a/linux-user/ppc/target_cpu.h b/linux-user/ppc/target_cpu.h index 028b28312c..76b67d2882 100644 --- a/linux-user/ppc/target_cpu.h +++ b/linux-user/ppc/target_cpu.h @@ -28,6 +28,10 @@ static inline void cpu_clone_regs_child(CPUPPCState *env= , target_ulong newsp, env->gpr[3] =3D 0; } =20 +static inline void cpu_clone_regs_parent(CPUPPCState *env, unsigned flags) +{ +} + static inline void cpu_set_tls(CPUPPCState *env, target_ulong newtls) { #if defined(TARGET_PPC64) diff --git a/linux-user/riscv/target_cpu.h b/linux-user/riscv/target_cpu.h index 26dcafab1c..9c642367a3 100644 --- a/linux-user/riscv/target_cpu.h +++ b/linux-user/riscv/target_cpu.h @@ -11,6 +11,10 @@ static inline void cpu_clone_regs_child(CPURISCVState *e= nv, target_ulong newsp, env->gpr[xA0] =3D 0; } =20 +static inline void cpu_clone_regs_parent(CPURISCVState *env, unsigned flag= s) +{ +} + static inline void cpu_set_tls(CPURISCVState *env, target_ulong newtls) { env->gpr[xTP] =3D newtls; diff --git a/linux-user/s390x/target_cpu.h b/linux-user/s390x/target_cpu.h index 0b19e42f75..7cd71e2dba 100644 --- a/linux-user/s390x/target_cpu.h +++ b/linux-user/s390x/target_cpu.h @@ -28,6 +28,10 @@ static inline void cpu_clone_regs_child(CPUS390XState *e= nv, target_ulong newsp, env->regs[2] =3D 0; } =20 +static inline void cpu_clone_regs_parent(CPUS390XState *env, unsigned flag= s) +{ +} + static inline void cpu_set_tls(CPUS390XState *env, target_ulong newtls) { env->aregs[0] =3D newtls >> 32; diff --git a/linux-user/sh4/target_cpu.h b/linux-user/sh4/target_cpu.h index 857af43ee3..5114f19424 100644 --- a/linux-user/sh4/target_cpu.h +++ b/linux-user/sh4/target_cpu.h @@ -28,6 +28,10 @@ static inline void cpu_clone_regs_child(CPUSH4State *env= , target_ulong newsp, env->gregs[0] =3D 0; } =20 +static inline void cpu_clone_regs_parent(CPUSH4State *env, unsigned flags) +{ +} + static inline void cpu_set_tls(CPUSH4State *env, target_ulong newtls) { env->gbr =3D newtls; diff --git a/linux-user/sparc/target_cpu.h b/linux-user/sparc/target_cpu.h index 029b0fc547..8ff706adce 100644 --- a/linux-user/sparc/target_cpu.h +++ b/linux-user/sparc/target_cpu.h @@ -37,6 +37,10 @@ static inline void cpu_clone_regs_child(CPUSPARCState *e= nv, target_ulong newsp, #endif } =20 +static inline void cpu_clone_regs_parent(CPUSPARCState *env, unsigned flag= s) +{ +} + static inline void cpu_set_tls(CPUSPARCState *env, target_ulong newtls) { env->gregs[7] =3D newtls; diff --git a/linux-user/tilegx/target_cpu.h b/linux-user/tilegx/target_cpu.h index 0523dc414c..316b7a639c 100644 --- a/linux-user/tilegx/target_cpu.h +++ b/linux-user/tilegx/target_cpu.h @@ -28,6 +28,10 @@ static inline void cpu_clone_regs_child(CPUTLGState *env= , target_ulong newsp, env->regs[TILEGX_R_RE] =3D 0; } =20 +static inline void cpu_clone_regs_parent(CPUTLGState *env, unsigned flags) +{ +} + static inline void cpu_set_tls(CPUTLGState *env, target_ulong newtls) { env->regs[TILEGX_R_TP] =3D newtls; diff --git a/linux-user/xtensa/target_cpu.h b/linux-user/xtensa/target_cpu.h index 84f67d469e..0c77bafd66 100644 --- a/linux-user/xtensa/target_cpu.h +++ b/linux-user/xtensa/target_cpu.h @@ -16,6 +16,10 @@ static inline void cpu_clone_regs_child(CPUXtensaState *= env, env->regs[2] =3D 0; } =20 +static inline void cpu_clone_regs_parent(CPUXtensaState *env, unsigned fla= gs) +{ +} + static inline void cpu_set_tls(CPUXtensaState *env, target_ulong newtls) { env->uregs[THREADPTR] =3D newtls; diff --git a/linux-user/syscall.c b/linux-user/syscall.c index a07d4b4774..ed18bcc825 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -5719,6 +5719,7 @@ static int do_fork(CPUArchState *env, unsigned int fl= ags, abi_ulong newsp, new_env =3D cpu_copy(env); /* Init regs that differ from the parent. */ cpu_clone_regs_child(new_env, newsp, flags); + cpu_clone_regs_parent(env, flags); new_cpu =3D env_cpu(new_env); new_cpu->opaque =3D ts; ts->bprm =3D parent_ts->bprm; @@ -5815,6 +5816,7 @@ static int do_fork(CPUArchState *env, unsigned int fl= ags, abi_ulong newsp, if (flags & CLONE_CHILD_CLEARTID) ts->child_tidptr =3D child_tidptr; } else { + cpu_clone_regs_parent(env, flags); fork_end(0); } } --=20 2.17.1 From nobody Sat May 18 18:02:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1572004124; cv=none; d=zoho.com; s=zohoarc; b=G20vpLTpkIfN1R5HteIptZqSoakBfaVZ3Ue7LqyaSnTJ8OHT6j/bsROQDFGczWLlRp4KYdoPmXRmqtDupI5n3SbtfhrV5Pm6BQxW8v8tp3+hGhc4w55712AdxlkIBw4MeyQ5vRdW+wkXt2QyGia+8EsyD4uLGNN5r5/T235Sct0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572004124; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=JmqIvZXJ/Mi2RAVnN1+8tsju3fqmNrpX/0K0AAbqa0w=; b=JNtkXRP+Xnk97gVlPYNRw/IMhdQpne3K/q+m92zmM7WMGTiYZQPyvk4Lwu2jpGy6I75JKFpujSBeRkrBfVl60KiExLaD/BKygpETlwmXEf5491UCRO9SAxgXwSVcjU1/ctsqiV84qfOICaccHCtlplUAJ9ii0rIKQIzpm/ANTx0= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1572004124828757.718908631463; Fri, 25 Oct 2019 04:48:44 -0700 (PDT) Received: from localhost ([::1]:59016 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNy59-0001dd-Gy for importer@patchew.org; Fri, 25 Oct 2019 07:48:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45129) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNxwV-0006qU-VL for qemu-devel@nongnu.org; Fri, 25 Oct 2019 07:39:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNxwP-0006fz-5E for qemu-devel@nongnu.org; Fri, 25 Oct 2019 07:39:40 -0400 Received: from mail-qt1-x841.google.com ([2607:f8b0:4864:20::841]:43269) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNxwO-0006et-VU for qemu-devel@nongnu.org; Fri, 25 Oct 2019 07:39:37 -0400 Received: by mail-qt1-x841.google.com with SMTP id t20so2674389qtr.10 for ; Fri, 25 Oct 2019 04:39:35 -0700 (PDT) Received: from localhost.localdomain (rrcs-172-254-253-50.nyc.biz.rr.com. [172.254.253.50]) by smtp.gmail.com with ESMTPSA id x38sm1473335qtc.64.2019.10.25.04.39.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2019 04:39:33 -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=JmqIvZXJ/Mi2RAVnN1+8tsju3fqmNrpX/0K0AAbqa0w=; b=ozOmE6t8mQEVMKWSKssY6MJpkE306wwcipCWm7YPvjKlPZShJc5dyAFlKIMvt2sCzx 7ZL5adq5lrl/RrcnG8wBLc2TUdyCVYKiSrGojTnb4NvtmCDNb2YZHOBMfDEQP3Jj4oon z7UobQjtqsCUtUBbk1CV7asmxHtD6tazX9BwmdfS3wj0ol/j2kL5P7zRpvih6CcV7T4e MUq/2zsoz2WVNQpspB9J+rvIOnpWMDRQ961JmuJ1Z5hN/ZJMHHxUAY9oSADOjnkV+d5E 5+8x9fLUDW1qZLmFznjUdv87BNVl8FXmlxGfZ8VbkB0GN7vysWDppu77n0kWRrTO/t1G vHbg== 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=JmqIvZXJ/Mi2RAVnN1+8tsju3fqmNrpX/0K0AAbqa0w=; b=CZCFV1y8YPW7u/xN94OTvV24CBOyqf0LabAKLee/Uqwn+0dtvVX6qcvk+yPrtBEVt5 vbED9wnOLZcTJmJJERhNIzgXzhUum3ikC8zw0FOrVvnp+rHmYLdbSy2EqRVblI++yL3J 8UZXjcZL1WcCdKUrU7LYtZrS6yQwkHQBkq9d3H5NlhXGizVeNC2aVzYEb9ogYWnUOgbh nOVIMF86hJfOdDWQm+PUtdPxoA7/dVHTFf3I3I8/GpiBoBg/1bBPlVmAixRkHXEns94X 6BakgrhnATLTL51zDKYWmfoiblrcgUcfhOOhQHNJ9MvXnCL15Xx76yaQvUePZotnfLkj RTbQ== X-Gm-Message-State: APjAAAXiOcxhAEDT85+s+Ous+wlA48Gx1kEYKWjRVz+V2U0Lba76M1ZP CLVB9uQzbZ4z7aZrIBSzHY+vev3a3qY= X-Google-Smtp-Source: APXvYqxZPEIf9oVUuk50PUQq7NTii7BjgFItV2f/bsjKNAegDUUfxgXtJBNNON3HGkVm88FZDw+MSw== X-Received: by 2002:ac8:65cf:: with SMTP id t15mr2535078qto.357.1572003574981; Fri, 25 Oct 2019 04:39:34 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 11/12] linux-user/sparc: Fix cpu_clone_regs_* Date: Fri, 25 Oct 2019 07:39:20 -0400 Message-Id: <20191025113921.9412-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191025113921.9412-1-richard.henderson@linaro.org> References: <20191025113921.9412-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::841 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.bennee@linaro.org, laurent@vivier.eu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" We failed to set the secondary return value in %o1 we failed to advance the PC past the syscall, we failed to adjust regwptr into the new structure, we stored the stack pointer into the wrong register. Signed-off-by: Richard Henderson --- v2: Take CLONE_VM into account when performing syscall return. --- linux-user/sparc/target_cpu.h | 47 ++++++++++++++++++++++++++++------- 1 file changed, 38 insertions(+), 9 deletions(-) diff --git a/linux-user/sparc/target_cpu.h b/linux-user/sparc/target_cpu.h index 8ff706adce..14b2158969 100644 --- a/linux-user/sparc/target_cpu.h +++ b/linux-user/sparc/target_cpu.h @@ -23,22 +23,51 @@ static inline void cpu_clone_regs_child(CPUSPARCState *env, target_ulong n= ewsp, unsigned flags) { - if (newsp) { - env->regwptr[22] =3D newsp; - } - /* syscall return for clone child: 0, and clear CF since - * this counts as a success return value. + /* + * After cpu_copy, env->regwptr is pointing into the old env. + * Update the new cpu to use its own register window. */ - env->regwptr[0] =3D 0; -#if defined(TARGET_SPARC64) && !defined(TARGET_ABI32) - env->xcc &=3D ~PSR_CARRY; + env->regwptr =3D env->regbase + (env->cwp * 16); + + if (newsp) { + /* When changing stacks, do it with clean register windows. */ +#ifdef TARGET_SPARC64 + env->cansave =3D env->nwindows - 2; + env->cleanwin =3D env->nwindows - 2; + env->canrestore =3D 0; #else - env->psr &=3D ~PSR_CARRY; + env->wim =3D 1 << env->cwp; #endif + /* ??? The kernel appears to copy one stack frame to the new stack= . */ + /* ??? The kernel force aligns the new stack. */ + env->regwptr[WREG_SP] =3D newsp; + } + + if (flags & CLONE_VM) { + /* + * Syscall return for clone child: %o0 =3D 0 and clear CF since th= is + * counts as a success return value. Advance the PC past the sysc= all. + * For fork child, all of this happens in cpu_loop, and we must not + * do the pc advance twice. + */ + env->regwptr[WREG_O0] =3D 0; +#if defined(TARGET_SPARC64) && !defined(TARGET_ABI32) + env->xcc &=3D ~PSR_CARRY; +#else + env->psr &=3D ~PSR_CARRY; +#endif + env->pc =3D env->npc; + env->npc =3D env->npc + 4; + } + + /* Set the second return value for the child: %o1 =3D 1. */ + env->regwptr[WREG_O1] =3D 1; } =20 static inline void cpu_clone_regs_parent(CPUSPARCState *env, unsigned flag= s) { + /* Set the second return value for the parent: %o1 =3D 0. */ + env->regwptr[WREG_O1] =3D 0; } =20 static inline void cpu_set_tls(CPUSPARCState *env, target_ulong newtls) --=20 2.17.1 From nobody Sat May 18 18:02:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1572003916; cv=none; d=zoho.com; s=zohoarc; b=HhmkEL/HC3t+KFt5nLe3btjR20plqICEAp3Y70SXbvhpV5R80Smisw9l7V07K/MjMMhi1Co7NCV+1LH+fxZVAINqCkYcipSHXuA/cGb0XkbSlHhn9A/A/Oz0sBnX9/o+D1puN+PsY2VX+oSRSrt1nUK76fS49cOFCFDoiY52BPE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572003916; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=gyTalvpUNKSJ73L+c2LcfOwC3yCRl3XSXEKw11FCS20=; b=XJhimY6oKgo56nMqj82QuBsamPBjo2dYWBlpbsmRpyG3ElBiAr1Bqdwd0JnSRrlJ+rztOEjy2GP4ZwM0wId8n1xILnWBazThK5TUSWE4aFVwvqHMcZOkz2Y88UjzMXDsObfd86ilnT+0Iy+DGVbTvOYXkz6hTSWSJNJd+W8VJ6Q= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1572003916558706.773947407936; Fri, 25 Oct 2019 04:45:16 -0700 (PDT) Received: from localhost ([::1]:58966 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNy1r-0006M3-2r for importer@patchew.org; Fri, 25 Oct 2019 07:45:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45130) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNxwV-0006qW-UM for qemu-devel@nongnu.org; Fri, 25 Oct 2019 07:39:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNxwQ-0006gc-Pw for qemu-devel@nongnu.org; Fri, 25 Oct 2019 07:39:41 -0400 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]:39897) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNxwP-0006fB-1v for qemu-devel@nongnu.org; Fri, 25 Oct 2019 07:39:37 -0400 Received: by mail-qk1-x742.google.com with SMTP id 15so1401379qkh.6 for ; Fri, 25 Oct 2019 04:39:37 -0700 (PDT) Received: from localhost.localdomain (rrcs-172-254-253-50.nyc.biz.rr.com. [172.254.253.50]) by smtp.gmail.com with ESMTPSA id x38sm1473335qtc.64.2019.10.25.04.39.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2019 04:39:35 -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=gyTalvpUNKSJ73L+c2LcfOwC3yCRl3XSXEKw11FCS20=; b=tARXIZaf6JD0O9SZZCu7GP4auGvVhv7DjA+9hKeRokTMaCXYJDGn31BbcZXum3Y+cO diDAadMmFfFRj2KDve28ON0J+vUV4+qm51pB1rYwTMYLJI8mIcUtA/icikTKVzd2rd0P j0S9QZ6v5PC2En32z4VLUhrNkaONv89wWwXsAyQXyX5aXL5t0ricm3bfU5SYF3cq1M1x qErQJGO0312iSn8lfYidXV/OKJkkTVJFijsRoeewtqNbC9F6OQ1MuP2bujEaN97oaGla ZXiR/R9bG5DHRODjU+SB2UflrnuJwTyERG6RQ4tSW3XFjHrAk6FwzhLAQYsbG6GSNbgD YHNw== 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=gyTalvpUNKSJ73L+c2LcfOwC3yCRl3XSXEKw11FCS20=; b=bhSNrpy+MSYOUBYJyUa1yE1ocs45vjNe7ltvZEmRh2gGhqb8o286m0cTQpvAmTkjHv BSQYaOnMlM4BnVfY6yRhEiikJjOnDwAClZSspIvpBM6fii7YFX6m45+uPlOJWcdYdNbW HdtqsPGyGG7melgbJwcgL9tvIcha0raJgojNv+JJ6QFJFHbZiQO80BvFNkOAMr1BSBd3 gCMeckd8TG1xHB8EIFN2HZkMqXZMwmghbYydt7RKTRw1KgCDneRoHxyiTxdgCVE2yPDO 7MCEIVBs/8xjVTUX+1rOnCfQWs7FVKEqBIiJvkO8B5Nws6SFxgUCplMctv2OWvKskkum 6U4Q== X-Gm-Message-State: APjAAAU54oEDSiEBFvTh4xK1SKugZ97stJ6NLJg9gG3SQKxOCtOcjgMx 8xRGUShmrbhafhSpU211xyOD8H2x8Qo= X-Google-Smtp-Source: APXvYqwNfSIPuSrnweJE5Z6p+WWVkVtcnvb9CUDeJST5WzUMThmvHZvWKiafLfQkGyXt4LD8aWBJBg== X-Received: by 2002:a37:507:: with SMTP id 7mr2378216qkf.107.1572003576108; Fri, 25 Oct 2019 04:39:36 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 12/12] linux-user/alpha: Set r20 secondary return value Date: Fri, 25 Oct 2019 07:39:21 -0400 Message-Id: <20191025113921.9412-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191025113921.9412-1-richard.henderson@linaro.org> References: <20191025113921.9412-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::742 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.bennee@linaro.org, laurent@vivier.eu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This value is not, as far as I know, used by any linux software, but it is set by the kernel and is part of the ABI. Signed-off-by: Richard Henderson Reviewed-by: Laurent Vivier --- v2: Do not set the parent secondary return if SETTLS. --- linux-user/alpha/target_cpu.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/linux-user/alpha/target_cpu.h b/linux-user/alpha/target_cpu.h index dd25e18f47..ad408ab5cc 100644 --- a/linux-user/alpha/target_cpu.h +++ b/linux-user/alpha/target_cpu.h @@ -27,10 +27,19 @@ static inline void cpu_clone_regs_child(CPUAlphaState *= env, target_ulong newsp, } env->ir[IR_V0] =3D 0; env->ir[IR_A3] =3D 0; + env->ir[IR_A4] =3D 1; /* OSF/1 secondary return: child */ } =20 static inline void cpu_clone_regs_parent(CPUAlphaState *env, unsigned flag= s) { + /* + * OSF/1 secondary return: parent + * Note that the kernel does not do this if SETTLS, because the + * settls argument register is still live after copy_thread. + */ + if (!(flags & CLONE_SETTLS)) { + env->ir[IR_A4] =3D 0; + } } =20 static inline void cpu_set_tls(CPUAlphaState *env, target_ulong newtls) --=20 2.17.1