From nobody Thu Mar 28 13:43:37 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; 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 ARC-Seal: i=1; a=rsa-sha256; t=1573045640; cv=none; d=zoho.com; s=zohoarc; b=XHVJB2/7qfEKiqcbtsw2UemLGypJmcanVhbYX8P3J0NicxUYDhrN07nstl3Wp0aK9CzppAmMs+l8HiMTkzSi25e2E9HM9i38zYYNfVHheBEqywJ7AIQsaN+P+CxoPqMrgqP3UfGa3MIih9Bv9VsUIheQNGlgMG7Z/iab5M+/Vvw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573045640; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=4Kq59VjUCzyIvxltl9Ga+PqUWXRzG5A3UKqkLFbLggg=; b=io0hMo+4anc8PHqR9lWGjmx8IZwCengQY/jR1g8uWKPJeGwaPgOT1YDLPt7lNrm7CpxKsYa3Qh/+4BTTgQe0t8SbiYZFFReQE0d6L0BNWVP66e5Ymrb4eHwc4bgx0aDWO7ccTEjlxiZOCrNhwLqRmPGpcuT6eg1yJvMUrTdf5O4= ARC-Authentication-Results: i=1; mx.zoho.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1573045640011175.35102514968548; Wed, 6 Nov 2019 05:07:20 -0800 (PST) Received: from localhost ([::1]:57840 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSL1p-0005Fp-JR for importer@patchew.org; Wed, 06 Nov 2019 08:07:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36413) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSKzr-0003P4-By for qemu-devel@nongnu.org; Wed, 06 Nov 2019 08:05:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iSKzq-0002u1-2c for qemu-devel@nongnu.org; Wed, 06 Nov 2019 08:05:15 -0500 Received: from mout.kundenserver.de ([212.227.126.135]:46969) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iSKzp-0002sz-P6 for qemu-devel@nongnu.org; Wed, 06 Nov 2019 08:05:14 -0500 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N95mR-1hpPN60MND-0167ti; Wed, 06 Nov 2019 14:05:07 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL v2 01/13] linux-user: Support for NETLINK socket options Date: Wed, 6 Nov 2019 14:04:44 +0100 Message-Id: <20191106130456.6176-2-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191106130456.6176-1-laurent@vivier.eu> References: <20191106130456.6176-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:51GPOKoHdGDAfJRNkhsy5hwU7LDAAJEiZenK2teK9K2fBwmSp8t JdgtMsR1PCMFA0P78nn6Dxu8YicazD7AHXeW7PQvLMfjdoTL5mrP4O3umvF1FKk5gfncgpy Vh9VEaJlipaxSJu6MOXotRauBHjqW2otcB3Trr/lTNIoRd4v6F80X9Trmt9eJrmMUEP76zk Iv+XNuXIY8EHmuPdb7G6w== X-UI-Out-Filterresults: notjunk:1;V03:K0:PHzZl8154RE=:y0Kbyy6LPrjbmpfwSrBAZg XyiPEBG7Q4p1lHiF7YMbf0mH8pIa8YloIGCv/ai6ldKZr6z8TebyEkofJt9YX2j59SyqDCdPF OIOJNY9/jQrigRi1mhG+X+dpV9Sk5XBmJCazxnGwZfGJ070oVPFnxO+S9PzkHCgEKimhopbNr ViJljsNqePNYAgi8fcmXEiHfMx7zoL0fwHDAFDnSjXD1mL2wtsaE2F/vrw2S+4bq1mBzm722W Nq4pwe45uWJSsz/MJkaTuis1G9K6citjMPdeGYoCy0ax0G0slgWbX3YdpVqq+n5ueeDRCUlSL KN6FXNhZeqT+N96gnUpTFGTkmvkU+vGXFS60YPlDSPicQ1Og3xAYFoTMbuqey6SZp58K9oIm+ kze7fb6alMY+wWhjCJZDLc+ibGsntSFAOr4xtBPIfcKYTdD4OtT4QaqzjVKhOBq5LlhNtj6hJ Vy3/5uTSzfEjMNxF7z2KMCrv9B7d+eDvVgVQokIblyhXhqS9ozrcwbIX7fhvThTKlSpc23gxC umHJVDwagQLL71FijtkFGNiUaUeTOkI0Il9ka9T0rU7hDFGy/m4CLh0K+K6HtofUVbShpvM1+ 8cr+m7RkzLTOAubFcu98RGJgi1mwEuYR28j7HYouH9R+ZY8tyXv3ctUSrC9P4OF5Rn9suXZsR srcLeIi1mV96QN5/aF7CyF5/OAtBCataVlNI66tUwScXyvitj8h+RoVa1TN9FKDyGBmeRoVGF xXCT7byWUjXuqp0kX1NZD77v2WeLngXVOWvv1+en+lpERB3l+kMpJCmLT6wBm5fRXp7TqML94 exwQa0bYdTT0aBU1Wkyy51Jy5pCTmnydz+hh4dhhWF53HWVNKK4T87nuTirkcG67vJsB+lFe5 71JJ6EenB2Spjyu4lp9w== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.135 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: Riku Voipio , Mark Cave-Ayland , Laurent Vivier , Josh Kunz , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Artyom Tarasenko Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Josh Kunz This change includes support for all AF_NETLINK socket options up to about kernel version 5.4 (5.4 is not formally released at the time of writing). Socket options that were introduced in kernel versions before the oldest currently stable kernel version are guarded by kernel version macros. This change has been built under gcc 8.3, and clang 9.0, and it passes `make check`. The netlink options have been tested by emulating some non-trival software that uses NETLINK socket options, but they have not been exaustively verified. Signed-off-by: Josh Kunz Message-Id: <20191029224310.164025-1-jkz@google.com> [lv: updated patch according to CODING_STYLE] Signed-off-by: Laurent Vivier --- linux-user/syscall.c | 101 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index f6751eecb78c..247883292ce5 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -2248,6 +2248,39 @@ set_timeout: return -TARGET_EFAULT; ret =3D get_errno(setsockopt(sockfd, SOL_SOCKET, optname, &val, sizeof(va= l))); break; +#ifdef SOL_NETLINK + case SOL_NETLINK: + switch (optname) { + case NETLINK_PKTINFO: + case NETLINK_ADD_MEMBERSHIP: + case NETLINK_DROP_MEMBERSHIP: + case NETLINK_BROADCAST_ERROR: + case NETLINK_NO_ENOBUFS: +#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(4, 2, 0) + case NETLINK_LISTEN_ALL_NSID: + case NETLINK_CAP_ACK: +#endif /* LINUX_VERSION_CODE >=3D KERNEL_VERSION(4, 2, 0) */ +#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(4, 12, 0) + case NETLINK_EXT_ACK: +#endif /* LINUX_VERSION_CODE >=3D KERNEL_VERSION(4, 12, 0) */ +#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(4, 20, 0) + case NETLINK_GET_STRICT_CHK: +#endif /* LINUX_VERSION_CODE >=3D KERNEL_VERSION(4, 12, 0) */ + break; + default: + goto unimplemented; + } + val =3D 0; + if (optlen < sizeof(uint32_t)) { + return -TARGET_EINVAL; + } + if (get_user_u32(val, optval_addr)) { + return -TARGET_EFAULT; + } + ret =3D get_errno(setsockopt(sockfd, SOL_NETLINK, optname, &val, + sizeof(val))); + break; +#endif /* SOL_NETLINK */ default: unimplemented: gemu_log("Unsupported setsockopt level=3D%d optname=3D%d\n", level= , optname); @@ -2532,6 +2565,74 @@ static abi_long do_getsockopt(int sockfd, int level,= int optname, break; } break; +#ifdef SOL_NETLINK + case SOL_NETLINK: + switch (optname) { + case NETLINK_PKTINFO: + case NETLINK_BROADCAST_ERROR: + case NETLINK_NO_ENOBUFS: +#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(4, 2, 0) + case NETLINK_LISTEN_ALL_NSID: + case NETLINK_CAP_ACK: +#endif /* LINUX_VERSION_CODE >=3D KERNEL_VERSION(4, 2, 0) */ +#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(4, 12, 0) + case NETLINK_EXT_ACK: +#endif /* LINUX_VERSION_CODE >=3D KERNEL_VERSION(4, 12, 0) */ +#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(4, 20, 0) + case NETLINK_GET_STRICT_CHK: +#endif /* LINUX_VERSION_CODE >=3D KERNEL_VERSION(4, 12, 0) */ + if (get_user_u32(len, optlen)) { + return -TARGET_EFAULT; + } + if (len !=3D sizeof(val)) { + return -TARGET_EINVAL; + } + lv =3D len; + ret =3D get_errno(getsockopt(sockfd, level, optname, &val, &lv= )); + if (ret < 0) { + return ret; + } + if (put_user_u32(lv, optlen) + || put_user_u32(val, optval_addr)) { + return -TARGET_EFAULT; + } + break; +#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(4, 2, 0) + case NETLINK_LIST_MEMBERSHIPS: + { + uint32_t *results; + int i; + if (get_user_u32(len, optlen)) { + return -TARGET_EFAULT; + } + if (len < 0) { + return -TARGET_EINVAL; + } + results =3D lock_user(VERIFY_WRITE, optval_addr, len, 1); + if (!results) { + return -TARGET_EFAULT; + } + lv =3D len; + ret =3D get_errno(getsockopt(sockfd, level, optname, results, = &lv)); + if (ret < 0) { + unlock_user(results, optval_addr, 0); + return ret; + } + /* swap host endianess to target endianess. */ + for (i =3D 0; i < (len / sizeof(uint32_t)); i++) { + results[i] =3D tswap32(results[i]); + } + if (put_user_u32(lv, optlen)) { + return -TARGET_EFAULT; + } + unlock_user(results, optval_addr, 0); + break; + } +#endif /* LINUX_VERSION_CODE >=3D KERNEL_VERSION(4, 2, 0) */ + default: + goto unimplemented; + } +#endif /* SOL_NETLINK */ default: unimplemented: gemu_log("getsockopt level=3D%d optname=3D%d not yet supported\n", --=20 2.21.0 From nobody Thu Mar 28 13:43:37 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; 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 ARC-Seal: i=1; a=rsa-sha256; t=1573046007; cv=none; d=zoho.com; s=zohoarc; b=eLRTL1aQ2zaOP3JKbBn/itwp6vw/KlUonhZKIOgdRlrPmfGRXz6dEwQ3JCSeBf393Y5J4iMq8nEIVR7Qn12h+KtxwODLAZy1f+hp6xjMQVU/lkeFfComGZTciGvKaDoGULRD0L0TAFgI4wObyh9zXEqeqCKaoxDz6SDzHlFN6mQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573046007; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=GzUWm5zwCL87XKp/TFGwynROGezvpJumXOstIOJFrbE=; b=frOF+gFwbc/bbzpD9TFBu1Boz7HhiSfgeB9vOWplEwgxU6wB2ZM28XrLXPCnzMUDMhzm5fjJuSq3td/IFD6bkqp7clQblAR+oxMVwvw7jdILc15AAurRTEwJFM+qPOhljm0r9YMQklOvqBd6gll+H6BFzbnTb8rWP5W9EIZxalc= ARC-Authentication-Results: i=1; mx.zoho.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1573046007745371.5614577164148; Wed, 6 Nov 2019 05:13:27 -0800 (PST) Received: from localhost ([::1]:57908 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSL7h-0005Nc-Hw for importer@patchew.org; Wed, 06 Nov 2019 08:13:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36505) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSKzx-0003ZE-JQ for qemu-devel@nongnu.org; Wed, 06 Nov 2019 08:05:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iSKzw-0002zW-9w for qemu-devel@nongnu.org; Wed, 06 Nov 2019 08:05:21 -0500 Received: from mout.kundenserver.de ([212.227.126.135]:54809) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iSKzv-0002xK-Vv for qemu-devel@nongnu.org; Wed, 06 Nov 2019 08:05:20 -0500 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N7iKo-1ho2SX3WhW-014kzH; Wed, 06 Nov 2019 14:05:08 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL v2 02/13] scripts/qemu-binfmt-conf: Update for sparc64 Date: Wed, 6 Nov 2019 14:04:45 +0100 Message-Id: <20191106130456.6176-3-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191106130456.6176-1-laurent@vivier.eu> References: <20191106130456.6176-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:29FaE8sJaX1qozk7sgHcC/zAlzd/QEjuyGuOCJjSD0qBg4hPMah L6ga9223uRSC/1JR96+W2yGjOq5ZLkswTE5s1frALs6BE6s8ZLe7MqbhEciI9O07cTcPC0e FsUldhk0pWFoctaVadxMpP31tWQLmeg2CjB7E2ZQXfQWvkjXPA3rfEt+CJKmDdqwK5x3SVH AjxS+t2ZNcgcysGQfnMCg== X-UI-Out-Filterresults: notjunk:1;V03:K0:DeOFobTDgto=:g7so14xaY974d6zD1lwhIY Bn5K9O06EP013HubIqxmopL7no3Vl+uafarvxkWerUkDeGpDEXgJ2BYn+f4a07HFH2H/tJr1f sU36CfSJJjXUf0Yzx5SleqBme8Amb3iMbM+3/grNjoZrVlCQ1nDZb1ZzBIJX9i8TS/u//vr0A udCvMPVJUbuPPFabduKBcKcUVtZ9ljL2LvN2mUcrp7ET65dzdAXqA8sIV+v09oCZpLujpKV7W ChiyXp5TwcxSroe8Ia2zTg82cP08/KQ37nwC7f/HJt/qw11v0cbvhfx1YFGbL+pHydsrS7CLA YWRPpUCp9OVLHrvHN75MrfBlOz/cLSvZR+o2/Z/Q7+tSdVMm352zjq7amHsFkF6YrKuowMxvA g1YyDrzGY5YWQk6GRSYksWwB78CQd2hwHUPrJW9aR35yMXv9NtvhPH0lb1lC3F1cRZ3aSxSmb MXGYVKrBomIpyuIjbt5uJKcEIvX/pgVPCfAI5pmCaid9ADnmhfgEew+/UX8ooT9x+zHRaQY3+ vzjCGZG5FqOIb3Kmq98KGPR9FI/io1OFTV3HjPUmC1eOvNfAe7FZoI7xVM+UczkPne0HLYQfH rBcep3rYDAMvl90sbulVKwi1MqM7QLTbe1UyfWLp/gTi9IP8nqV7w/VeqBuJ44z46Pe4PZQeD e5ve8wpIq0bVRCizrN4A2J8Rclph09ZUjLZBXPt3sgEvgJ/9LCF7G8KsuvT4aTSadkr3dBkQn L8H9Y5vCfddgAq4/BNoFUvujULAJ4s9QEfuAF98oQqhz7g+/JhdfOCGCTgv21NS9UaNXeIN3o QnwB3tn4gpldltQdJwl8FRGtehhTzMWXdjeUAGt0q/yT3LwbAsI1j+/CWR/lS7BC8wz40PGvI DPaPNl2PzBzqFg9WBRBA== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.135 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: Richard Henderson , Riku Voipio , Mark Cave-Ayland , Laurent Vivier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Artyom Tarasenko Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Richard Henderson 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 Message-Id: <20191106113318.10226-2-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- 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 b5a16742a149..9f1580a91c7d 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.21.0 From nobody Thu Mar 28 13:43:37 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; 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 ARC-Seal: i=1; a=rsa-sha256; t=1573045644; cv=none; d=zoho.com; s=zohoarc; b=NYLyIS7g+AuWGAmUntSsyCQAm2ZNwlkprBAIlEZUNQipVMW7rbYZJ2lqKJ8i0pwSHz223qOQQ7CJuE8quTiooe5gPreqJtm4Y5+U0AFx3sL8PjRwv9v+eC8yRejZ7uwa2MUIz00pSN/uWKnpPidGWtcr1VtNIf1gIxcnRLfqW6w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573045644; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Pft8K4rg6npcQqfz5dief5yIu3/lUG8QnT4Cfc+2QfM=; b=kJmwQscGX51zj12Gn7LGzjPulCmDvsDSMZD6P8UScp82h79FpDeVB3Bcur6CddY7kRj7voEVjAs8vlu3gsCRN7+53IwX8h791ibkitkbfJ+eI2vni1LSA6IBrGdAdpT0y+Ffp2RsWLEYGQWFtCryiGbU0ZhccB0pltGKKhck8gU= ARC-Authentication-Results: i=1; mx.zoho.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1573045644013101.33641277274637; Wed, 6 Nov 2019 05:07:24 -0800 (PST) Received: from localhost ([::1]:57842 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSL1u-0005LW-Fr for importer@patchew.org; Wed, 06 Nov 2019 08:07:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36449) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSKzt-0003S2-HD for qemu-devel@nongnu.org; Wed, 06 Nov 2019 08:05:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iSKzs-0002wU-Dv for qemu-devel@nongnu.org; Wed, 06 Nov 2019 08:05:17 -0500 Received: from mout.kundenserver.de ([212.227.126.133]:43641) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iSKzs-0002vZ-4L for qemu-devel@nongnu.org; Wed, 06 Nov 2019 08:05:16 -0500 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N63NQ-1hqnLo2u8u-016Pwb; Wed, 06 Nov 2019 14:05:08 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL v2 03/13] tests/tcg/multiarch/linux-test: Fix error check for shmat Date: Wed, 6 Nov 2019 14:04:46 +0100 Message-Id: <20191106130456.6176-4-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191106130456.6176-1-laurent@vivier.eu> References: <20191106130456.6176-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:Vu1BYmduwVjJTm9simsfiMGEKoqN9w6waqLssuklMSO6JIBEGVU 9EeL0wEnC5U4DUjrnHPoocjRh3N4mKrdkynjbqqV7i3Orom2/BvPyfmOQ5vqCV3P/vG0jAx UDJJzkliQ2XEw7La3Ac0XAaAf5SeFxxLxG0PoageV1T/TwWa+zRAU1XBqtDcGcpekxcVVHZ IyTtU4J+13UVQsSKoRrvQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:xROpSsYcRq8=:7mHkMJ+n9Ny8JVJpwk4VwW fsVRVxbvzqdQyPXu1WDM/B2zkWyGNbyjM53mr/x5lC2OImt0+tGEjqaNtagvXo4uoHn7xfyLB vNHOZU2jn7f45inIZdR4cHrRofVU+ZGioCjTbjcAEmeN5FD5O8/D4DKu54bNaYhgO6lD/I20k 880f7Sfs3zx/1tZWbBoy/yMuZlKpEFzFMDw5hqopomWFj7+TDPeWons4yva1Zf7Kf96BACA0P CXpxdUvmW5tTKHKhPKLkZKstEHTNjSF4eXX53SSsMO0MM59ylzCMdFdN8h5zNAxW1H2glTPL6 NJaJ8hdT6phqTnnCzw2NdTGzBUEgq4YI5aepBnU0Q9+W6XfZm8xkR6MJ5nAQ3OkVtIB4vnwj3 dqpz8fnV2SlCbevGx5xEdNkkixBWpgUQI+GaIDIk/JqwRyZA95GmtmAKwsGJ6WKMfAsioV4h+ wYM1gq2OBkOeROQIzuW0LV+ho+DIlQEb2D+EVJ9cvL7JczLrw3Kx0aAcgiDISDczFrl4zUI8b Q0V4XHBDiR1wPXlqXxmMDehl4iDi425yIC+FTDwOuoEHXtxAvDM2xDFH68gZuko+ZMusP27YH ATWt7ewG7sYwEVnmL1ncDrBl/Y2dsf7cuAX1PbeastECVVu6TXl79u+7fy+0c5QbHOM/UWcMX Gw1qWgUeNF7TVXzn/o3t622LaK4+B6ee5Z/09U8NxxaYHDD6PetDciDIhnUcDD1FBrF2+QJjS 7ekJ4oEQIlqRSAxRgoXgMKsDGPB8p6OzPr24zOsRlWIbkJJTAJol0k1hc0uo2k9fd9Y3orYTF rREHohLKSpyeI9ML7CJq2jM4iyb4mcDEue07EMewFoWFpQ7f4hjHQSEbt9ME2452PgQ+AYwRM ocMhAFrjy61HvbxUAIkA== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.133 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: Richard Henderson , Riku Voipio , Mark Cave-Ayland , Laurent Vivier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Artyom Tarasenko Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson The error indicator for this syscall is -1, not 0. Fixes: e374bfa35bfb ("shm tests - disabled clone test") Reviewed-by: Laurent Vivier Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20191106113318.10226-3-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- 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 fa4243fc0426..673d7c8a1c25 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.21.0 From nobody Thu Mar 28 13:43:37 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; 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 ARC-Seal: i=1; a=rsa-sha256; t=1573046160; cv=none; d=zoho.com; s=zohoarc; b=DwxN3ILWwMfLtLiyLKEVaKAsgJeg62Lz0uHZKEOHPO0fthoslabXJdpaoigWdlY4/kfVHjmavzZAZjStgvQVQHOJK0g0bTYmIDEYkbRhVBUCYMF6sSItlh8LLdPBycrZUgx9SYxzzanO7K5uisEtsyCE0dkAdJp9pOxH9U/kq6s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573046160; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=k/mqF7l/v+2mSxsinDFMgi1FUCN4+tTnlqMkltZteuA=; b=RbnL84lRy81uI+WSN+nxwHa7cHT/QrmBRXwv4XAsnp0LWNuNy+aSHrSwzHcQ9YyvfrQeq4vANJ3stv5VIqkxeBo271Hd1yhSEMJte2pT9gMbY/LeajB9U6yVN/KOzFo2i8/SJskS2SDUrYm0+bd8X3zbKBmo7B+UPmkBt3Y/ewc= ARC-Authentication-Results: i=1; mx.zoho.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1573046160502105.78109045105191; Wed, 6 Nov 2019 05:16:00 -0800 (PST) Received: from localhost ([::1]:57940 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSLAF-0001Mc-67 for importer@patchew.org; Wed, 06 Nov 2019 08:15:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36540) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSL01-0003gU-0q for qemu-devel@nongnu.org; Wed, 06 Nov 2019 08:05:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iSKzz-00031y-UP for qemu-devel@nongnu.org; Wed, 06 Nov 2019 08:05:24 -0500 Received: from mout.kundenserver.de ([212.227.126.187]:33041) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iSKzz-00031L-L4 for qemu-devel@nongnu.org; Wed, 06 Nov 2019 08:05:23 -0500 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N79q8-1hrtHN2L2y-017Vs9; Wed, 06 Nov 2019 14:05:09 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL v2 04/13] target/sparc: Define an enumeration for accessing env->regwptr Date: Wed, 6 Nov 2019 14:04:47 +0100 Message-Id: <20191106130456.6176-5-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191106130456.6176-1-laurent@vivier.eu> References: <20191106130456.6176-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:fmn0GkGUhoRW+ItSR4J23aKZ1sR0YtmytPGBgNf7xAzK4yFXa3p 5UblQzAHRRnL//CV610/dtH43eQwIPJLamHeW8aJXywGApX62L8uFzUVe2jgxwhFlxUoDtF pSJjDSMq6LTzdJ+sXbCxkRhJVhq6t+qmsPEzlvRsX7bkfpLXYOI2dEVLVvfEuFN4oe3//uz RKrBcx2X98cavm59/C9iQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:JUoqpHlXQuQ=:rjrtQuBSYNvnkj/P7s2r3l i7pBr2tCdwVRcq1j0R0n1aiH3QNL1fzM/rIwS/5Jlw9qKnDtC5qviX6QkEft3Eq/zHgzRhIia 9coCvqN9FtP/ybNIc/f8qdkLno+yRZX8oBirUpXRi4NSdBV1yioM/VvsJyQSKFiMBe4dsBVE7 4ckgu/8dTZCLZzEtumf5hhxZkkXwmNAsIW9jCz/rA+1ufEqL9nwsuEEuZ8cnT+DfuyXAGI3Dk r4Cw6uG5tk+twr9y2vhIAnnax7ZtelayCwXFYAzuBAO98W4QTzoNUbnATwAjBBLh3xoSpdOAi Sh5ZdbcbhZxl7DFw+uh4Ui9knRAC3KGpr9M4EfM1UD06ZQCmgS53H+pLiXoFTrgntMW2rAqt/ dQg04MpZPXCp5w7Vq+Wpe42UZuuggBmUPqZtOa8cWj52gfeXnC8po5iqm+8h1PVVA8udfe/Pf Zfg8XUq1kWNIdARC1hUmYVy7T2pBC80KIldLPvK2bptyu0ekvkevuPdG+Q5k11adurS4Oe9+4 rBHihqZ8217cEPZGk50phRuNPyNtYQavQRRSpopDDD4FcOvH9djz2VCgnMDZa3HbKEXW+ah4O 6VeGH6/qNgSsI24AQey2RQdlOXG8nAj7aE1YorEPsiv8Ik/imXBoY4EuMrlganAjdZ9YWnSIg Pgd5GNzRLMJYRQiT91xyxQ762ikLYe9O1d5p45vugGAxQL/dSBdNo9JBrelTzA2lxS2RyjhYm wCrcmNw9uLutRSNRB3GXCVZQ+/Jep6gp1kmkR7f8MH/xG8lsHiL9rKS1DnxWShjcbyTGOEEtU erqUdk3AHwfA533SloPqQMRZbTg6AslhmH3eHy0U8kQI6dWjb5WOiPayDXrnO0hCvKVUqGgo1 ZED3QtbUeecPaA/uCX/Q== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.187 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: Richard Henderson , Riku Voipio , Mark Cave-Ayland , Laurent Vivier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Artyom Tarasenko Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Richard Henderson Signed-off-by: Richard Henderson Message-Id: <20191106113318.10226-4-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- target/sparc/cpu.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h index 778aa8e073c7..ae97c7d9f799 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.21.0 From nobody Thu Mar 28 13:43:37 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; 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 ARC-Seal: i=1; a=rsa-sha256; t=1573045870; cv=none; d=zoho.com; s=zohoarc; b=CeeKKZ//7ig/KaEaeiembmE8g7Qc6doclW2EbPx+X9sfUqOZ4QmQeHLWLCIkBQL7GMy78F/xuh2/ByKY+5846QXkWnjm63PWpaXhSKxpJYJEnjCwDD06yupZvIPfxhUUoJardyFdrftni+17vKJxflNwcxGHWSKSgZGKJ9+jQtw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573045870; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Z/ZwozH3rjs3ve+ASBDKmMI6P0/gKJPVZj+97ipT9eQ=; b=B+fpesk66G7slqDNYDfTppUx56f/k8AQqQ5Ht0xhWCYR0/UsVJ4uIJhQ6oyGn8+m95cES6OLgMcs55+ZPU1ZotRz6KomWaD9J0tjnczPMZqntN7ATa3nfdg1MEqGC/GPj5fW3WP/Y6jZ3ngJfUOBzhl4ZIVo0TmHr715ssi9lVo= ARC-Authentication-Results: i=1; mx.zoho.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1573045870831857.4177950034953; Wed, 6 Nov 2019 05:11:10 -0800 (PST) Received: from localhost ([::1]:57878 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSL5Z-0001hR-7K for importer@patchew.org; Wed, 06 Nov 2019 08:11:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36536) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSL00-0003fm-Lb for qemu-devel@nongnu.org; Wed, 06 Nov 2019 08:05:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iSKzz-00031f-Em for qemu-devel@nongnu.org; Wed, 06 Nov 2019 08:05:24 -0500 Received: from mout.kundenserver.de ([212.227.126.187]:46979) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iSKzz-000310-5O for qemu-devel@nongnu.org; Wed, 06 Nov 2019 08:05:23 -0500 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MkpjD-1i4rov2Kcx-00mHgo; Wed, 06 Nov 2019 14:05:10 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL v2 05/13] linux-user/sparc: Use WREG constants in sparc/target_cpu.h Date: Wed, 6 Nov 2019 14:04:48 +0100 Message-Id: <20191106130456.6176-6-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191106130456.6176-1-laurent@vivier.eu> References: <20191106130456.6176-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:MhlD5dVVZ7dtnCdYUPRmKP25QXNwXDN6lyKD4g0G1XO5VAFwss4 cWAz8NkDxJqW8m/c8QpLJLT1JM/ro7c/zd6ai9TJGR3iYwQYmE+T/YgE3KOAHT4QdtKaPLg 37doHcSjGhD3XI+KL9IPwasUjOMlmOAWzJHtjOESsIs7h4IxQdMa6T+3AI+Fxqnrx2eXoK3 bZoSXnm4cOHANj/9ZMrOw== X-UI-Out-Filterresults: notjunk:1;V03:K0:xkGsBVyoy+4=:bOXgfNrSiZ9CadHSqeQCxd e8WqA9Dixy24nCBYaqXpPBNJNEi6LCFzfsYkaDT1CFF8W+fbQLsGMd2iggOmMNJdBN4WgXZlk S9FlzDIbgvTsatt/VmeSbv5gJ2PiwDgmbWOjTPp6vtizRX+y/oiaSHiP650KKwO8k9ZVpN+Le gfinaToEDVBzulmOHCH493Lpu5NZ2czailDKelT3gTGXyVkuglv5a6NQJTivz34HTPX4o32ep xhUrrJbYWk9at04w3C5ag4CwaPbHiiVA50SrOhyqIiKhu4t/66J5w3aOWB7NcEooy5ptUw9zL qNohoH25iGMAMtuE2U8b5zruSS+eISFtMpKDWE5JRHjGJgk/sCDgXLuXcpp8J80+LX7TKLjaH jwuhN6KbR6UTHRmG4iTwKAlfgMTrBquZRglleH2Su4W9r4ywJ6Rx/mC6EVFoF9IJagK0yGfR6 p4VaKL1WbhjpwIk9Ex7Ot/1bjxcp210cP5Xi7/I4GHUpqzoVze0lm6CSQ9WU+6nCxzSOCQ7Vj h0u2H7UTYVi3a0beVC3u/egh+o9+7w+2Cq0v1x9J6sgH2CMvl2LD49JcZeAZfXpdEMwhynikV oJ6U4FAFK2G1q+qiGULfzX2A7LWIZ5Nb5XENa9NrhcgWuXF3yBXEp+KwEzpm3t3K1NAXORP5w ahrQqDSaFY08l+pI+SJxvk0KF/tTGbtcVfWg3+2yvKbScvV/1ZDK8HYEJaZjQsCsptlsqFN0q ZLsJW7lcScUVm6nb4oHXN3kf2JZ5qLAWO00K2A9ki1UT7NNJUye7aiLPBJAMIjEGoVK72/bHG EanAPDGfOkCuKjTYF35skvtGtaT98lFOiTOlO9JRw5QJpkOL1AJeKQ5LOEtvBH2Oi4UepqxaG amB8GK/53Py3rPnLaOFA== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.187 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: Richard Henderson , Riku Voipio , Mark Cave-Ayland , Laurent Vivier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Artyom Tarasenko Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Richard Henderson 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 Message-Id: <20191106113318.10226-5-richard.henderson@linaro.org> Signed-off-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 1ffc0ae9f2ec..b30fbc72c43b 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.21.0 From nobody Thu Mar 28 13:43:37 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; 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 ARC-Seal: i=1; a=rsa-sha256; t=1573045817; cv=none; d=zoho.com; s=zohoarc; b=GLYRMTZAaw6I7nrK2l+Tw1wabuxCs4B9sHUz+FnZPYi51eKEmZTddJl5y/QXlqus4ymIVmMKPBySMDWPG5itM03SI/z6LDx3hozjtNkKN/aCYr2CztHNqWBtRETcztTbxOTTrlegoCYxxObn/s3+teCE5OQMp8RKSJtCKCNHqlQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573045817; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=krqbwxRafu0SCqY50OMGiElBB80q+ISuAgB3pQt7Vdk=; b=hzaSUIK9scb6XdPCCt6fqoyMrzVFsGXMRi7+bOYy+djXBCTU9mwD11R3ibJvpyk/T7ANmhrU3yiNkB57XZo1VoqFYFAD7ESZTGEYshMFhmbL/LzotqEBbSlF8wZMIHZ33DjDFXZZomWfXp5gie7WOEQYOzikRoehEJ3HZVBATmw= ARC-Authentication-Results: i=1; mx.zoho.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1573045817206912.6782376382569; Wed, 6 Nov 2019 05:10:17 -0800 (PST) Received: from localhost ([::1]:57876 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSL4h-0000Sv-21 for importer@patchew.org; Wed, 06 Nov 2019 08:10:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36480) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSKzw-0003X6-5p for qemu-devel@nongnu.org; Wed, 06 Nov 2019 08:05:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iSKzu-0002xq-Fx for qemu-devel@nongnu.org; Wed, 06 Nov 2019 08:05:20 -0500 Received: from mout.kundenserver.de ([212.227.126.134]:48433) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iSKzu-0002x9-6O for qemu-devel@nongnu.org; Wed, 06 Nov 2019 08:05:18 -0500 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MXp1Q-1iRE1z0uZY-00YB7Z; Wed, 06 Nov 2019 14:05:11 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL v2 06/13] linux-user/sparc: Begin using WREG constants in sparc/signal.c Date: Wed, 6 Nov 2019 14:04:49 +0100 Message-Id: <20191106130456.6176-7-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191106130456.6176-1-laurent@vivier.eu> References: <20191106130456.6176-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:or0UTK77VSjZt9enkydS3C5H4YSLm8PPhqPV6TUFsKFu8RDy5Dc 5h8x2PZX6TZr51+ISXC1Wmw+nPRlVj/A0gRnomYuhscIrTGk7y6MN3NI26Lx1a9tzC/zlYx loLSpz3GSjyh/zreRFBbjQ0ELLwwaculR0ej32vY1/Du1p/YApQW1m9Mp+tyQd866mrnEON hhzqAvLuL7N0fILPYrY6g== X-UI-Out-Filterresults: notjunk:1;V03:K0:QAsLTu2KgeM=:JOQUI1GUDx75A26tTNNLkl ZbunOi0HAHcr0+qSsAY7x1KDPQW/9lp6OqCj9UCMxS5B0QThAlYYnQdXyu3QFsgSyjR+b2AVt oSzAR/uruYa7N6EAQU0TpalhskuNdCzLnpx7+awTDt6BS3DKDO+kG2atTN2sygib7NIPYM9nT b5EXFG8hJLvgYRQDBP6KLT9yDD2Es01cx4OazC61im3eWu97sImTDOs+1a5vKZ5KzkG+ZthvO rMYUrI/DrukCGBnxSD+88oOzyqGDvE3Kd8B9bekxmzyxFU9aEdS1u/b56TtJ2gWhBtQmhNMKl kk5A1pVy/ASkALGmV6I24WBn3cbS+OmFFDyJ2/bpZvIuNvnE5Mui3rTcSAdpmi7OQ35yWm7r7 VXM3LpmM31nWcOYFYcgbqHeluNkQ9WKsXrCTs30k8VRDYNdGQWcSA2DjjiAm+qBZ3GlJ9fXT8 Iy0frLgGtKuYB8AchkMqn2HAV+UPeSkjdKaI5EFZtUg0gVKLMqqPstoS9inzfU4b+eWyf/AsT 6IZwO02Oi7qSy78/JKYNnOqo3rqSGRGkFqtfYwmLSeEbzUYUBqNFxnGvom4XTvaogA3BJBLSI 2fJwtSfR49rSDMs1OzY9wITC6rz4C+nwMoSzFTaeZnQBJG1nu/GI6/CylurdbzzuZ+6hsJWE5 tGRkYsJE1zmSsYhJs6e3TgLAf+MFWenw45ZrZ9phpA8YN8PJ7KssULCUOOVcHprq9dEbJx80Y 776oK4YM1h4TL0ldU5ug0sGfZLYIWxQiRQs/PEb7Sk8JsnkbA3huAblJz/2bJ9SgnUCXTzCG7 N/32dutA4unKEBnyH4ipNFYW2f9CDfLstzIRyoyZ0snsNrVWIvgMIrk1hJg1VoFyBbX415noa puLARgXGgJA8a5PwbA7Q== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.134 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: Richard Henderson , Riku Voipio , Mark Cave-Ayland , Laurent Vivier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Artyom Tarasenko Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Richard Henderson 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 Message-Id: <20191106113318.10226-6-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/sparc/signal.c | 95 ++++++++++++++------------------------- 1 file changed, 33 insertions(+), 62 deletions(-) diff --git a/linux-user/sparc/signal.c b/linux-user/sparc/signal.c index ead169fbaa26..aac37da239c1 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])); - - w_addr =3D TARGET_STACK_BIAS+env->regwptr[UREG_I6]; + __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])); + + 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.21.0 From nobody Thu Mar 28 13:43:37 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; 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 ARC-Seal: i=1; a=rsa-sha256; t=1573046022; cv=none; d=zoho.com; s=zohoarc; b=Dm2+c6mws0tNK6EgKb1sJbF5I8NhsPDHHSEEYfoOIv67mG4JKQ5opDTVEkqChXfeh6uEn9DPUwXxR48ec/+5/TghT+UhGwOD50a13epz0u9mBCR9DwF5IZcwviJx9Plde03Lb5EyjF/+U4ZnpO0awi/XD+XgyL2/qT69W5EYwqM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573046022; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7NG0Wd3aMUGYnuwRuRQR8Vk7jRkePwxxu8T0Min3+Co=; b=LpAq5JT5L6NCj5zzS0FnPpzYIpceFvZJQDsG9ORhLYNegRhsvK7ipO8XMEjDCrfj+itsUAFjLAETMMXEAYHuZdMpzxKHy6Jng5AUBr1ZU/IYLcZ/1WgLKQTmJQMWCVXf+peYmpT/mgizuubihY67bG5yHILKwNkdZYb30n+VZ7s= ARC-Authentication-Results: i=1; mx.zoho.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1573046022654345.4334506912387; Wed, 6 Nov 2019 05:13:42 -0800 (PST) Received: from localhost ([::1]:57910 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSL80-0006Tj-B0 for importer@patchew.org; Wed, 06 Nov 2019 08:13:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36553) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSL01-0003hv-Md for qemu-devel@nongnu.org; Wed, 06 Nov 2019 08:05:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iSL00-00032u-Io for qemu-devel@nongnu.org; Wed, 06 Nov 2019 08:05:25 -0500 Received: from mout.kundenserver.de ([212.227.126.134]:52297) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iSL00-00031m-8Q for qemu-devel@nongnu.org; Wed, 06 Nov 2019 08:05:24 -0500 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MLi4W-1iAfcW0fNA-00Hj6j; Wed, 06 Nov 2019 14:05:12 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL v2 07/13] linux-user/sparc: Use WREG_SP constant in sparc/signal.c Date: Wed, 6 Nov 2019 14:04:50 +0100 Message-Id: <20191106130456.6176-8-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191106130456.6176-1-laurent@vivier.eu> References: <20191106130456.6176-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:F93e5yo2DqTObT6L78NjVj8t1cit52FlwUIZxym5DRzQHRL3uwU Cf4foVC6eKSHJOe5z4GecDZyArENAjnWmNHPJm5NH66AoGzYBFviAC0EP5ii+VieL/yIYVU vvynRKbd9EgUttwqlf6RCRqRcl4017FMM3/ImJjBQM1fHjYsn+9iG8PdJMZfKotrYbWCXWO GFJfi8Jz7j3qe3x2ZA2DA== X-UI-Out-Filterresults: notjunk:1;V03:K0:vRZ2ozsTQoE=:Xr3bffh2H56nYZNHwYjnTZ /hipQrfP0yE957VAG9XZdCG/2F6+3LPbNwcQnFK/vNN4jBOGkQtMxmNTQl0AgSfB/DhxAGc0y MxzITP2nlwkmX5FZXQLZuDNI/6w4iSkgdDsQ4GTa1aOqcij5nRCtndX9wl6zZUHPs8eeBTw13 GXqPcz+XojdJ1tdVGpybl9HdUYifLK9+7v+Srcxn5WKQYLCC1Vp5vO8woDliuVktTol++1j3I xVEV0wFXFVEFP/ExKOCBbQPjxfnhg6gKw59yM+bOMBSe7B8L9yTgdB+nMk2ty1ohGwNryFnaE 4+ZBQZeGgWYhqN+TPWqpdpqr7uXPlHlimlPd3JfwB3mxKu1OX/NeaWNwIxSC4CElb1ESP6lkT hrg7gI9OU9UU1ApRG9VTvPkANe3fs51SGefu9pBXYeYWegqo2NYofmwFcPzI/U82dw5pz5rcS elSPtAwfBeh7HhbG+KSNviNdyI60A6op8M06dkNv4eTNmuPOqhXl94sesvJK8oYAwfwgs4V5C qVKUwmJVVJhZjk7iA2h0FvBglSzw8jqX2tsUZz7RuKlNhC18cGQmVNYXHzPx9PluMZZ0ricnC wDLDKnh77yMS2bWPe7ZPw03bA6GOvOluzqvoZRHoepVXHgwoYhKMhVN1BRkKHI8T7VTzG/H9f VnnsUnaXSiOKhFxo4c3IPinWuGpXTx9HLCLjg8q04GoK2EPhxZKkA8wVbyMRNmRd8C84dAhxP +lUa1vWht7IMNxhoc1/sA6vAoGydqz3hjs7tw5TzxluK7zM2taDQfoosNKVi4ki1GbOnUaCu4 ZVBrUeZZWZmLNo0IbbDCucyJwCfJPn8FPZvTEZrfc9uu9NP8MploLjl65V0pnR/MHdI8Fl83c gBMdiOkE2+MUlz3CiXiA== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.134 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: Richard Henderson , Riku Voipio , Mark Cave-Ayland , Laurent Vivier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Artyom Tarasenko Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Richard Henderson 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 Message-Id: <20191106113318.10226-7-richard.henderson@linaro.org> Signed-off-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 aac37da239c1..e05693f20432 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.21.0 From nobody Thu Mar 28 13:43:37 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; 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 ARC-Seal: i=1; a=rsa-sha256; t=1573045691; cv=none; d=zoho.com; s=zohoarc; b=jt+HHr/53W95hIFo1p4pn6aqOJQvAOmrrNeXgoFyDHUFPvWOG9rIfFR/swlGATDhYT0QDOyzJxQvTi+oulmHPmfAfC/q5Ctz690LSMxwSjPISJ8m585TVnX0/c/bjPcMiXJUXpWIub4shq4I6WKWD+WuErfQGiRwvJfG3sZoSB8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573045691; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=mJFycwX2aZBTmMoK9IJL4vaq49BgbSJ1Dnu2MR3pXjI=; b=MVq2USJd7k/A3jY7fQOCO++FKCE3fDwRn7FpeVVZWyXB9p9reHbi8dLBRnsljyKcLjTMw/NMys6juyKS4UN4D5B/5TVkdOMwObbaox4aHkPIWqR1/4QU6O4CV0opexiIFC83GiajmMxUKEFkfvuYkLfP+/tAbJAvNlacnKx+Q80= ARC-Authentication-Results: i=1; mx.zoho.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1573045691018728.5111425411743; Wed, 6 Nov 2019 05:08:11 -0800 (PST) Received: from localhost ([::1]:57846 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSL2f-0006KK-E3 for importer@patchew.org; Wed, 06 Nov 2019 08:08:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36441) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSKzt-0003RI-0I for qemu-devel@nongnu.org; Wed, 06 Nov 2019 08:05:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iSKzr-0002w2-W8 for qemu-devel@nongnu.org; Wed, 06 Nov 2019 08:05:16 -0500 Received: from mout.kundenserver.de ([212.227.126.130]:51249) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iSKzr-0002vJ-MU for qemu-devel@nongnu.org; Wed, 06 Nov 2019 08:05:15 -0500 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MN5W9-1iC2X609bh-00J61A; Wed, 06 Nov 2019 14:05:13 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL v2 08/13] linux-user/sparc: Fix WREG usage in setup_frame Date: Wed, 6 Nov 2019 14:04:51 +0100 Message-Id: <20191106130456.6176-9-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191106130456.6176-1-laurent@vivier.eu> References: <20191106130456.6176-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:5CWl4CeXq73bml5Cudzed/f+InEB0sO39/04UZjbit9IkB9Wz4N 3/ZwMpqv5qhLHOJ+PMxGuQNTiNBg6MPuA0cn0+gEXB/ttWTQgfiIi/MLYMC1EO5BKv0VYI5 whk74Js2hdkRhB1onb5HkBvBFJHwIC4dwV0JxUncKoq3k5sNQRDUzFsaC6hE8wgLHgMnhGZ lzq+SfcihrYsWSAD9/jMw== X-UI-Out-Filterresults: notjunk:1;V03:K0:HGfjWumgTG0=:BhHS6X4HZSHpmw4nV6bSvZ dHZWFiYj7os4E4iIkAyLvARZSEjg5Y6Nv4qlg/b+UqnjPv3ndoXLe+TTGGkfuAOm8v2hy2kzT /H4wWC5Pem5Rkn9h9JQEu2mxdzDQBf87JondP0ZodXEXqTPyj03jeymk+T2Zlhkox9YznznhR IOpqE9QxlEbIYX4pcA5tXBxC30US5ADKYuQq8qgYxggfPI0h0l/TyL7gXTNZhsTBz8H+i1+Nb JoCae/gPhiG5O1fqBmbPdEVvTOR6Tm7ElzKnOsHwVZIf3j0cTNOPVZCyzz88AP3WPmfh8cwZM Q7/2P19cRpB3doCjIOXfFjFTVB828oLXVW+IVd2CoKwgjiGOlQi2U6Zi6k/phgxw4/kTMzher 2aPEyERY2l7/rVbq1ZrWZE3j4nK36r7RgDkGcTSbNdrKV7Z4nEPFtTq2JlWR3R2e0SJTS9yFw v1+D5TGnm4uQN0b2oRohAZJvQs0d7W4N/qNsWZWouGTAuECP6+mE5HEheEJo4WPdSqukaIT3x IxhbfprcDmsL3PBaU0FXngdh19YYxD4hNky9OvTsOCNBV26JEYcwcQNZwA8m5+A2/ftUPFku6 UliUNAboWbIgP4T8QQsrhGE2ArzIHHiTxzuxvFBYB7y+Ayf9rQ8c27kB6kjmxOMm7Pp9pxGH/ OHnPVO/4PURXrLmA4e0wpC30SCJVIjp8iDFy66w6rVx6ufThD9slLrhPN7UBipRGwGKmamnqq 2EmX35PUw2RY5j0VuScGWE8c76EJjK7udwUZ8krQTjq43q0peAQf1v+Ad8pv7iXE6WgkpV0zY eOV5/28EokUVbR1JCy/UX54wvAnhjRDjSzpbiMDnwFu2HXg6QV1fsQPWGlvRPd1epBWStVIxQ Ocqad7sznpRCRRCH0I4w== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.130 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: Richard Henderson , Riku Voipio , Mark Cave-Ayland , Laurent Vivier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Artyom Tarasenko Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Richard Henderson 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 Message-Id: <20191106113318.10226-8-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- 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 e05693f20432..238d0ba00c89 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.21.0 From nobody Thu Mar 28 13:43:37 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; 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 ARC-Seal: i=1; a=rsa-sha256; t=1573045885; cv=none; d=zoho.com; s=zohoarc; b=BGb4sAB1+mXvqs+92P++P1E1PWcEEJlFSaP20QYggreQx8oucvdPNcrUfwau3gGrFsmS3wvufWW0EU2ThknS6D94yEq4auIqq9iH95FfBRk0Uz3xvA9KQ9peFEKtmE6aAwAyBG0aZgrc0cUdc4d/a2MoRoJ6l4ndebmBCWra4Kk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573045885; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=too/yi4ijJc2WkIyHZCEZXIbSuvPRsnTytozXenO15k=; b=Zb5JcQt9eYZb5PLybc5lDz16jzk/6v5c9paLV94GlGk9wNnjSljN5OpgejjYiNsT9qkRBoMpvnqf/vp9XyPy2a7pbCEp7eHU6Br+p27eTneY87vAXoH+E2NkhEjA2bbqTKA2i6dEC+wb6pt4Vw835BzY7JHfmbs3xMu/DfkzuYY= ARC-Authentication-Results: i=1; mx.zoho.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1573045885611679.4050570863482; Wed, 6 Nov 2019 05:11:25 -0800 (PST) Received: from localhost ([::1]:57880 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSL5o-0002C2-4j for importer@patchew.org; Wed, 06 Nov 2019 08:11:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36498) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSKzx-0003Yr-Cx for qemu-devel@nongnu.org; Wed, 06 Nov 2019 08:05:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iSKzs-0002wO-8b for qemu-devel@nongnu.org; Wed, 06 Nov 2019 08:05:21 -0500 Received: from mout.kundenserver.de ([212.227.126.131]:59479) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iSKzr-0002vV-Vv for qemu-devel@nongnu.org; Wed, 06 Nov 2019 08:05:16 -0500 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1McpW6-1hsSHT3VCs-00ZwPn; Wed, 06 Nov 2019 14:05:14 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL v2 09/13] linux-user/sparc64: Fix target_signal_frame Date: Wed, 6 Nov 2019 14:04:52 +0100 Message-Id: <20191106130456.6176-10-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191106130456.6176-1-laurent@vivier.eu> References: <20191106130456.6176-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:jGMMA1r2VMxaPACeECkS6P/IgU0zBlIlnzfV6a8cXosdPtWUyQg x4N/+z1UmJKOW+9Ih48yCw89ez/P55xgQOo/pMISXowX7QrRIesal/Np5jqR1b+VSVM2emn ZFdaPwNiIe5vSqZGcV+7rVaUZCHXVg3KG0AHbj/+TLIA0iCm9jv1zA2R40I3Sxoe+Gmcut8 GlLp/a9VjNpdcXLF5RzTg== X-UI-Out-Filterresults: notjunk:1;V03:K0:E5EdphPDIO8=:6KRUEnGVIV54DmFbbhVujy alMHql5ziQlqAl2XrPtQ1Civ+4NkSlfoqRTEifEsPpMltDpNpDEuZy44cugLP0HZAN1ggTEfE 7VCvThP7jyWFcr17JLK32BbOGVotybSK3PBlduGcazkX7cgcSz0aueV6TSPYR8wJ4XFMiksDG lgPueqB85cyyHsyij7ntdJOI7E9zJFTqEGSRJg1Uy9dw5LARHwYt8IneyzFReisEeAUkOh/Rn aLs8AcAT2349uPRogGmtAGlgaj8drBCOOGiEpUFSj4jGQJ8cXtbwAzEP648wgW++XE5EIVs/F Qc3QY2ogeEBHVXe3UK84NYBbq6PYq6qDJHXDlQKAufUuEeK03r8tEo6A9rMb5F7K5hsr3Nu4l 3akdXVmzjXlH5YPhTL6N6+CNj75OnebngUCx6PQAoRUxQ/c3DAH6z45w3ekaBolOZz6AhEngu FLR5aBlv8YiF81Ji8Cj00W4HzIEHCSns/r/cLF8duDUXt1tD4sEg7eXq0+vX8uQmquEApMyVc PLQxxt9SnVmkMmzaajj46z4q9icgaCtnrDkrrKuTygZ5ihWQuP22MaHoZES9W9YClrHMP+LSj HhKpr1gOKrEFKaE73tnUoALcZeu+B36BxO5oX4vLmWS3sFo6478hXV0/q6o8cZwI0JoOhXO+N 6nK0x8fNTQWa/w/MydExi7y7JKB24feaKLW4zEuPYytfb6BLwPiE/6mFgFamVbg1GLr/lsHbk DC/XbulzsTQn6KPHdiDmnrH+KoyqYD5Q+ozCdDogLKJC3gQBj54nM3g2x3mqf47gnxE5KxCCT JrV29VSJUtOmpP22lt1Zr3u/YmvPbSv89H8xH2qRqL3P8KHBljpsuadVVjBgZkWmoqYP+eQw/ STNlKHryzgQiZ4VvCf/w== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.131 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: Richard Henderson , Riku Voipio , Mark Cave-Ayland , Laurent Vivier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Artyom Tarasenko Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Richard Henderson Instructions are always 4 bytes; use uint32_t not abi_ulong. Signed-off-by: Richard Henderson Reviewed-by: Laurent Vivier Message-Id: <20191106113318.10226-9-richard.henderson@linaro.org> Signed-off-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 238d0ba00c89..d796f50f665b 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] QEMU_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.21.0 From nobody Thu Mar 28 13:43:37 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; 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 ARC-Seal: i=1; a=rsa-sha256; t=1573046210; cv=none; d=zoho.com; s=zohoarc; b=i/l9KtFBHaLmw5ERyXCMe0H6cBF/HI1xrlrDqbt1nyOuL4bwsxkFScX4+i2QZ6HPZy6nhWBVUaenT6yP6oTRwlhvcQm0ba+hxyWlyh4RqpcjxzrQsDdbhvCp7laMyPdE4POTqn58Bqe4MlgDjNtIf2l1pIUhHuqvypYT8aFo8Fk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573046210; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=rl1YzhYnAgNQr+YHhprLqB449zj5ToigSSs4JDkvCJE=; b=aq5MVuU4OOM+9XEwg7k0igRmhnieQ008WlDndk1rCLcGRAOH1CivzuNxIplkzKSiRweasczrOPcLuBaV+DKeaVfAqYp6Tgt8WjIHhfple3bDSVgEQrkqRKaow7/qJ6gGO8DgR7gYnuN+VTp6pbXHwERZ7MGONON5bpVVqnNsabc= ARC-Authentication-Results: i=1; mx.zoho.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1573046210541132.77156321874008; Wed, 6 Nov 2019 05:16:50 -0800 (PST) Received: from localhost ([::1]:57944 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSLB2-0002L7-I9 for importer@patchew.org; Wed, 06 Nov 2019 08:16:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36557) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSL02-0003jQ-7R for qemu-devel@nongnu.org; Wed, 06 Nov 2019 08:05:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iSKzw-0002zR-9f for qemu-devel@nongnu.org; Wed, 06 Nov 2019 08:05:26 -0500 Received: from mout.kundenserver.de ([212.227.126.133]:41317) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iSKzv-0002yK-UV for qemu-devel@nongnu.org; Wed, 06 Nov 2019 08:05:20 -0500 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N8onW-1hp8OK3Fmo-015qup; Wed, 06 Nov 2019 14:05:15 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL v2 10/13] linux-user: Rename cpu_clone_regs to cpu_clone_regs_child Date: Wed, 6 Nov 2019 14:04:53 +0100 Message-Id: <20191106130456.6176-11-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191106130456.6176-1-laurent@vivier.eu> References: <20191106130456.6176-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:FXfcdPTd2hzC6VOsshb9jMT9yfOwVzfr9gIeb6tPyS5XZbhFj8i E6s1uG8HUp5pnGPe10DVMBV/BbcCWS0n0e2NhwXHT5F5oHYCm0vBMG0294vIa9jFWNi9iDc v1GFXtd7Cw2icEP9RoQplG9yPxHn9RWDWec2NDxrN7O/7bzB7w5mIvHmq7DDXApSf6XUd3K yK+HMCuVIoAlPpAXvOPHw== X-UI-Out-Filterresults: notjunk:1;V03:K0:GCjazRY0YoM=:GIaohiAJWF4AotEm0AI7Hq mv/4JR6FGcOExAfGrOGuMHayxL/qAR5XRCTH9qRmyuSrIi6hYZL+f39D79gRizRWBwP1cxM8N lvktmtcqeUkmS9Ia/8m2IhZckJUeuMr4WhEJpEaiXJeB9jRlHyALjNzggb640iEu/OyaqtmLT 11U51XTBp5YbkGKyBS4kOqhxdBH4zsBgl4ytA5zZrUX/g/LnRE/ufC9kEbLnMd6m689Raq3D8 JQjhCAuXgjJwpZUEt6HapNuwf7Hg+fLnb54t/mJtBwrXom4bIWRrfHQxazKC8f5Jv0NuUgyC3 uhBsEBv2xILlPmVBPvORe1P7HovOf4mEMskroDVnyclxRSldinOn5fsJC8l/AYLBme5aOu2Rp EbsqtuWmS4yfIH85It6FkHyqsFl751Cf+d+oFw+1rZIzEVLLE3nqLLupRUAqNvIfDU9iJ5s4a fXtpoXX3ymqYC/AlZ5dEbLHj8/qgcWvVutK0RTOo0kxvy9yNlSnmp0hQDroLBz/F+1AscL+sq hglE+3RKOoGU9tpL735a71LV9ka2MyBTcaw+HgBoGkh1tW1ccxgVnoWn8RUB4qz7fqJTC86o6 dKDLms1Kvq+75xCR33qGzOQ2STMDLZU82V+ih1znPm1J1Ui0Q68Gh7afJ4hTfj9rgh87UvgNE l/eJLchkqBccVBPCO68WpL/n7O6o7lb16gnERtLx8bitlwvMevH+K8m4qFX2vGrx0TYE9jNoK I+rCPAwwY21YtrK7IY0lmJShHGe1w5i4/TLx3WeIaFJU8lNrOXG1sUe3TJ/vC9/gaEczSRmJ+ Jp6C81c5ssxzkidhfIL+uVyp/0TOqlnw/5NWXAGXqDZT4++LY/lqNuDgdiY7yxW1yxITP0fa/ A9sc9Drc2yvhX8FTt+rA== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.133 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: Richard Henderson , Riku Voipio , Mark Cave-Ayland , Laurent Vivier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Artyom Tarasenko Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson 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 Message-Id: <20191106113318.10226-10-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- 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/syscall.c | 4 ++-- linux-user/tilegx/target_cpu.h | 3 ++- linux-user/xtensa/target_cpu.h | 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 a021c95fa418..cd012e0dc1c8 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 ac4d255ae752..37ba00cf41d1 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 3f79356a07fc..6e2ba8ad4b8e 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 23093439790c..eacc4d8d13e9 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 1c539bdbd6e9..f25077079088 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 ece04d096675..1fadbf57c367 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 bc7446fbafdd..57b647bc0753 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 73e139938cc6..e9bc0fce6547 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 02cf5eeff7c2..8601f712e086 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 5596c05c9c0f..fe5de7a9e3c7 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 32ff135089e0..309cf3eeb73e 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 c4641834e794..028b28312c51 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 90f9a4171ee7..26dcafab1c77 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 aa181ceaee83..0b19e42f758b 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 b0be9a2c1bb0..857af43ee3aa 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 b30fbc72c43b..029b0fc5475a 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/syscall.c b/linux-user/syscall.c index 247883292ce5..245ed315c834 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -5820,7 +5820,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; @@ -5899,7 +5899,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 diff --git a/linux-user/tilegx/target_cpu.h b/linux-user/tilegx/target_cpu.h index d1aa5824f292..0523dc414cc5 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 e31efe3ea090..84f67d469ec0 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; --=20 2.21.0 From nobody Thu Mar 28 13:43:37 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; 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 ARC-Seal: i=1; a=rsa-sha256; t=1573046377; cv=none; d=zoho.com; s=zohoarc; b=Q45CZOoPx5/b1YsQ/Y03ZoRJH0gxIVJ76RHYshmlZx5tUt2Ek6FrMG+jO6VjRvz4bJ/L3nRY6ygCi8KHT+Or94qOBMRSgxSLGJKUMePgHAE+5VBwUAg6iHdVWnMd0fFEPSAvACOw+zTEH/XU62YkQZfIeYJobnz7ISeOqbWQSNM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573046377; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=sJFYvzGNAtG2Y10f9vNUZIRuluUY9W4idI/lmnJt/ew=; b=dDq2yp7ZaJh80AQHSvoCoWNNQLpz1oEPwNH3hr0Lv75hne9sNZutGncSLZkFEGYy99Y1Vy876nfMDolJyQAlfzxuMTRJPnIE+SllusrGn7EFq6QHU+Mi4RDOtGEDlZ8MGilI+oH6PAuKxWrMaOuOaR37eB22mzR7d3sNGfLH6N0= ARC-Authentication-Results: i=1; mx.zoho.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1573046377007199.1309123947517; Wed, 6 Nov 2019 05:19:37 -0800 (PST) Received: from localhost ([::1]:57992 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSLDi-0004rs-WD for importer@patchew.org; Wed, 06 Nov 2019 08:19:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36578) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSL06-0003qX-Mk for qemu-devel@nongnu.org; Wed, 06 Nov 2019 08:05:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iSL04-00035L-M7 for qemu-devel@nongnu.org; Wed, 06 Nov 2019 08:05:30 -0500 Received: from mout.kundenserver.de ([212.227.126.187]:38071) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iSL04-00034n-CX for qemu-devel@nongnu.org; Wed, 06 Nov 2019 08:05:28 -0500 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MG9c4-1iitPD3z9o-00GViD; Wed, 06 Nov 2019 14:05:16 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL v2 11/13] linux-user: Introduce cpu_clone_regs_parent Date: Wed, 6 Nov 2019 14:04:54 +0100 Message-Id: <20191106130456.6176-12-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191106130456.6176-1-laurent@vivier.eu> References: <20191106130456.6176-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:fqCF6jQb4Tqp7Xg/84QPi/I3oc9P5g5PkjdYffnAgrZIN8CAzbu JwA1nw8pSUPPseM0OUskbsO4QCJefBUv58KW/a9FcnEhkJH3w4ZCBMYU4aRfTGfqcq/bhjc uKZmsAwf4a6Rf8P6myjo2f0JRfA1gVnEoOCtzBEax8gxKmXqrPMKrWeLaNHhefgUaTKZURE Xd7Fl6pvAN6CQJpXkudnQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:nxemIHFpLnY=:iSVcNWT5/zaNmytBSQAzk/ qrX+YkTtVBoSdaS3aCpGu+8CP8/kerOPhwxwIRJWsi2xiF+QaRV3IRIOAtU8E8IZs1axsMiGe Dj0wk4DQoi6aNSkdt+kyrJ472nJ41F4VVEsZ+8xK9Y0FGrxSWt0XXcGblssakljz70V8BH9tp 8+NsJkA+FLncyLioXRN8qP4hgpsDP2uENL5fZrQz7fPqAMx8JvmR4Mzop9/BpES+mDixHyVm3 6UClvAvGXbQ72grILwxhJH2dFW1DDPG4PKROuEurbFC5kEJZ7yKBl353HvDWNqtuZcNyhvjmr sb9w8vyA6ySAVJYWFIF4AxNl2O2vZ/zKpdhoWNZ+y90UhUMmX202PZBwUKcdSGujSCoibWHTH k4fZYjmdn4ntEeTUDmBMcqcvaBp3OgysqDuNn/Q+Ac/9YHi1K/fz8RynsH96mlxaMAsnmBTHW 3KQEhZoH2UYcytg94bhGmEg9XtjyFiPu7L9Y+lD+MMpwYH6Qsull1eWhzdj+UgdKmX+H/1xZ7 trMDF3WbHH1ryz0I/GFl8eSspqJE+Ipcu52fROYP7Ta8tUrGaLWlRboBJp7KFdb8jUXPkg+I/ py/nkaAcL21BFuCDJ7BVMr3ZnlAAQbrJg5hqNOWZWcnGBkftG3jGuiQ8WfygiH05K/HMti5eW /bwm8q7zL/AGlp2Cl2KTwM/eTl+mEVGHrGoRxWkAJoFJYbh7tEeUx+aVdLB057s5IATjlGBVN 79TbfisBdMTpaLBJ8USA5S2bHZ0D/8jPNVN4jaeuqwmdkvQD8xLpvKgRxeCSwqm6tx9VqS9I6 FMrvkBkekvr+xOsApAn70QPFegxaZuX9ZVFaeU5GjYZCDGllQokI1NDhjNmrE/8P0P1wDx5qk EEA+vTL+QJwzN2tjDeRQ== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.187 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: Richard Henderson , Riku Voipio , Mark Cave-Ayland , Laurent Vivier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Artyom Tarasenko Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson 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 Message-Id: <20191106113318.10226-11-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- 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/syscall.c | 2 ++ linux-user/tilegx/target_cpu.h | 4 ++++ linux-user/xtensa/target_cpu.h | 4 ++++ 19 files changed, 74 insertions(+) diff --git a/linux-user/aarch64/target_cpu.h b/linux-user/aarch64/target_cp= u.h index cd012e0dc1c8..6cc02e7dcdfb 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 37ba00cf41d1..dd25e18f47fb 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 6e2ba8ad4b8e..2747211b24ab 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 eacc4d8d13e9..74ead55c8114 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 f25077079088..71654b3cd4c0 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 1fadbf57c367..0b44530854c8 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 57b647bc0753..c3f288dfe83e 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 e9bc0fce6547..ce7b22ece7c4 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 8601f712e086..758ae4d933fe 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 fe5de7a9e3c7..50f03810675a 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 309cf3eeb73e..74370d67c45d 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 028b28312c51..76b67d2882bf 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 26dcafab1c77..9c642367a362 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 0b19e42f758b..7cd71e2dbab3 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 857af43ee3aa..5114f1942482 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 029b0fc5475a..8ff706adcef7 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/syscall.c b/linux-user/syscall.c index 245ed315c834..ab9d933e53af 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -5821,6 +5821,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; @@ -5917,6 +5918,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); } } diff --git a/linux-user/tilegx/target_cpu.h b/linux-user/tilegx/target_cpu.h index 0523dc414cc5..316b7a639c3d 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 84f67d469ec0..0c77bafd66f7 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; --=20 2.21.0 From nobody Thu Mar 28 13:43:37 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; 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 ARC-Seal: i=1; a=rsa-sha256; t=1573045643; cv=none; d=zoho.com; s=zohoarc; b=aoOY2aCkbU5vofNP3FHOxy2mGnIMwo5TfYWf/QHl9YWeHIdS5cBSAntfBS9ntLqk9CGzs6VyKR+atEAgztky/2fCeklQxYOsjLnGT3v3E6jJ0esmZUsEKaR75GFqv6K8WTXwn7qugFHV+v0M8ABjHwh+Bft66NIRkVk1mz129LQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573045643; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=u8vrI7e3KAGuA1momMrq3+uxrTD/dnf99cgsCUrF9Oo=; b=Nc+LTm6CuKQr8HmgHr5mQOtc1EUp6XwbW30e5hyI/L4uWXX9RmJkHIYjDlPDrqZuBNrJMB927uAt5QR0q1/npvhJQnHn+u6q3+9+GC/5Rcze60CVbXjwM0LPyl/f7D1xoUjJhZemYGfZ7Rzqfo7Tbk6qaYQSrXeep11N6CGWaTA= ARC-Authentication-Results: i=1; mx.zoho.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1573045643340192.48221342135628; Wed, 6 Nov 2019 05:07:23 -0800 (PST) Received: from localhost ([::1]:57844 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSL1t-0005MA-Pu for importer@patchew.org; Wed, 06 Nov 2019 08:07:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36486) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSKzw-0003Xi-FJ for qemu-devel@nongnu.org; Wed, 06 Nov 2019 08:05:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iSKzv-0002yV-8E for qemu-devel@nongnu.org; Wed, 06 Nov 2019 08:05:20 -0500 Received: from mout.kundenserver.de ([212.227.126.134]:57321) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iSKzu-0002xk-VR for qemu-devel@nongnu.org; Wed, 06 Nov 2019 08:05:19 -0500 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N79q8-1hrtHE3bZ6-017Vs9; Wed, 06 Nov 2019 14:05:17 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL v2 12/13] linux-user/sparc: Fix cpu_clone_regs_* Date: Wed, 6 Nov 2019 14:04:55 +0100 Message-Id: <20191106130456.6176-13-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191106130456.6176-1-laurent@vivier.eu> References: <20191106130456.6176-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:SZJtkQFvalXdI41SeIQoMMrB0GUeVbZcriSYjspiLcEPONjOKc0 4PhKd5249RuZ/k5GjTmVj2q0Sf7IhHTkJYwTHThaH1fyYaoxK6+m2YADd46d+1WLPb8VOKz Q/CIaxNv81mAgDNhb3I2xwMYVqqe0QPudhZ51sQ6yUICnizwgCY6Sx3K+e2kx68GwmoA5OM T5J758/yldGMjXSjYuzvA== X-UI-Out-Filterresults: notjunk:1;V03:K0:UZSje5P6C2M=:9QIQB95eNWbVC/706ZRgYY qDFsYCwalhcYdDszOb85COLpSwcBbMnl5P2apBnX9u96L4oGtlhK6J+JQ4YkOXsPdOmwJ3zhk AeHVZAGzccLhwKKvsw9a5/hcEYtELGGekQDtsLgHKK2RdtH+lqIgkTkhZbyIdB8Lf8NVQVPxW vSY2h3Dzg+oWwu0/+65MYVLBNMxqKTSTwGk4UXHNB1UD7aIGoJRAQqZRsQ6FDOqRYeKi6W/7N i3bGWvQ3pW9FNu93apTtK9FwkqpxE4d6XHWEFKlI+dCZJhJtauMvxt64iIeHkaMnWH+y37j+N NsIkf6DOPaemnaAxjnJsReEUKU9NFTd2iDBK9f4Au0HNTLH/ASwah9ZPoMrUVi/YgHScuGvVn OlbMmVtmc+adooX2yyB1ofPbk9VVkFDTU/2l0pyFXKP1QPkiKZnh+mx9p37pWk7rOxwLcd1Jm QwkzGaP0tCcYkYaUW9hveifubeop81ySfsvC5RFtpnizC/qe/Se8/BONVKe4jReRaXMI5zCPv YfAhV+uwWTd6AgQcYTj6DfQgfWJsW9SDCAUyaYBL3kOgb5+j6nwLz8DR0uJQ9Km1UX06WTEZJ 4r047lJN5jZi6OBM4QulpqgmS3+W3M+JV2nV6yimVOOVIBvdoJ0mgBSu4tROv0jZl1SxXBNCU Qi5PkmgMTBF5cSsfvLnIXRu37gqafSwDwBRxsw4EKxg5crgxk9Y76D8BFnTQHKHOS8wdYbQDp LyfLG7OK2hEARjcgtjMSveqjZfEz/QarvEysB/zHJ2Qzex3gRHG7ReKE7EDjN5xf5ELtEumnM jNQ3bB9HdvfwFsBvEra5y1ArQEQsahFcFetDAPmK+j1YyYyF1Cpsb5zy0lKmA+8AV0b9Nbg+j ZJBdG9pp0Yn6AzK385eg== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.134 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: Richard Henderson , Riku Voipio , Mark Cave-Ayland , Laurent Vivier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Artyom Tarasenko Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Richard Henderson 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 Message-Id: <20191106113318.10226-12-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/sparc/target_cpu.h | 43 +++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/linux-user/sparc/target_cpu.h b/linux-user/sparc/target_cpu.h index 8ff706adcef7..14b21589699b 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) { + /* + * After cpu_copy, env->regwptr is pointing into the old env. + * Update the new cpu to use its own register window. + */ + env->regwptr =3D env->regbase + (env->cwp * 16); + if (newsp) { - env->regwptr[22] =3D 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->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; } - /* syscall return for clone child: 0, and clear CF since - * this counts as a success return value. - */ - env->regwptr[0] =3D 0; + + 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; + env->xcc &=3D ~PSR_CARRY; #else - env->psr &=3D ~PSR_CARRY; + 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.21.0 From nobody Thu Mar 28 13:43:37 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; 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 ARC-Seal: i=1; a=rsa-sha256; t=1573046034; cv=none; d=zoho.com; s=zohoarc; b=jvdkPfTqubZdirvyw8kjzgXuIqQhIm5UpGe9yemiM8LImKU0fHDDpUElRqyKqAIRjD5RB9o5k2Xx0e+0TWzPA0V35ms7g2vXwkxszzWdbWEe8wIu+b3zTU54uYaLDfvAjuXnLtBtQvDZ5N/iK5wlvxD3AjH74lpyuAoV8cZDP8c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573046034; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=p40Pa87LJUVJxYlcAWYnNeHeQq7IFVjh00J/2+b0tNQ=; b=G+kloM4bFkjUQ5sFmoPYCfiHRMZzFkXvLuJX804riHawSSeDX/kqOGWkM/7654qU4RMhYsm40xEFlCmEY/vj1+Py67S4x43/TgI2mrsq8xpqiOx7IlgllE2mEkj8uE2iseMgCt6JjrhKzsiZnyNMf/sm7WYb170OpHbwN/6SiRk= ARC-Authentication-Results: i=1; mx.zoho.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1573046034769223.12890653339923; Wed, 6 Nov 2019 05:13:54 -0800 (PST) Received: from localhost ([::1]:57912 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSL8D-0006yw-L3 for importer@patchew.org; Wed, 06 Nov 2019 08:13:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36497) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSKzx-0003Yq-D8 for qemu-devel@nongnu.org; Wed, 06 Nov 2019 08:05:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iSKzv-0002ys-Qy for qemu-devel@nongnu.org; Wed, 06 Nov 2019 08:05:21 -0500 Received: from mout.kundenserver.de ([212.227.126.135]:57175) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iSKzv-0002y3-HF for qemu-devel@nongnu.org; Wed, 06 Nov 2019 08:05:19 -0500 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N4i3j-1hkzWM2Av1-011kB0; Wed, 06 Nov 2019 14:05:17 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL v2 13/13] linux-user/alpha: Set r20 secondary return value Date: Wed, 6 Nov 2019 14:04:56 +0100 Message-Id: <20191106130456.6176-14-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191106130456.6176-1-laurent@vivier.eu> References: <20191106130456.6176-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:sT58QnB+9d3LffVxpnM5Qac7Rc7XxNgy+jbm6hcpvpCOZtG5bCa Xk0r88/fTxQXxtQGImnrI0Juy3vZimxPwTHS2X5Rbj7FeZr39RLaLdNrHDZTBrDJOzlF1lz f7lExXIb919ZyTBKXsjAAF1GGgU3+Zr3qX5SQxbrzdiekbxo9c2unQUCI9r2JHgIVNZ08NM TIgV+ouom55nFs9eoodMA== X-UI-Out-Filterresults: notjunk:1;V03:K0:85v3dB7Rzso=:aRwOqgolEVh7fzd222PCJ7 4ZIEFhuVbHwj9aaaRbm8O3+49AsBoVe3NbWBl5CtG+DWT0sCEyiyT+pueSh8JnmGvM+qR4MlH VwU8hTPhYpIoLhPyhrSgZjnO25cAbS5tEZPhf1ZtDZereh7XNaBwQ3ntozyiZU/P7nOQSvTjh fQhFhQ2uWZ2I76etvxlzmtlyaEaxbYTZiznS5IOidiksU3gnG9oul2FmC84zqyxKrW8jT5Prq c/A5hbnqwDpu4Q5u1PtEwrlJvSJDdci8WExzIo2+6FtoFtSPaH3l89mJCjOsIxCAUUN9zIXIp JhMrsKug9xRm78/HCE+diyTewdT9WTyjoSgAdO4uHCtnhn6+8zQ+vfgT8HdhqQVN7NzBOQkEf ok6ydOkFYlBs+sJVT6s3OG2Atjt3Pnf34r+a5AvHFgvl4R0hzJ0VcI6n45ZgEpFSZ0X2+eYJR NnED1yu1c28dDBkqEHdl+1z4OYD68MG5rsHZqVQa5f3zyuDPYg9dxbOSoY4IT+Pr2ADq+6rq2 /fiYfbkdAGYk80HCGt9X2keG2wIr7ZTK3Ur7L/LcBu2es7GM2LuhhGTlE4u12NZF5SP3D3zZU 4ssejeP30UeYRfKZ3W07hbWXSspYdsSiq/BIYXBtCKs9H5+WNnQlA3RC5LGHcnOia15CfdrTc Lov7WUmRgjfErsfbcK8TDGtNefGkdb7eyIGr2PVkMLYOlANQWujgepK0t58xnDwIpxid/+xKQ KcusbiSYUh80Ex/1q75PHrT9BLNcmJ538cBbc3Q5Tq20N5nq+mrCZyB/Bz8KcwFkvRJnS6yiw fvJoe5Dvr8nRLXCwiGjoK92X9jCsJY+E7kAT4TbcM+72t+lDn0rKwewEjt0Nsm67swAPi1ggA pGVyAlJyMW9a25Srebqw== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.135 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: Richard Henderson , Riku Voipio , Mark Cave-Ayland , Laurent Vivier , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Artyom Tarasenko Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Richard Henderson 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 Message-Id: <20191106113318.10226-13-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- 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 dd25e18f47fb..ad408ab5cc8e 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.21.0