From patchwork Wed Nov 6 13:04:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 178687 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp587584ilf; Wed, 6 Nov 2019 05:11:38 -0800 (PST) X-Google-Smtp-Source: APXvYqwL06hc2jrO6VVsL+w+PnlZHoF2cP2ZLvf6tQXbZv5KNU22CeNO2tXk+qT2cNPFCrS+rQS1 X-Received: by 2002:a17:906:5907:: with SMTP id h7mr34139179ejq.328.1573045898197; Wed, 06 Nov 2019 05:11:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573045898; cv=none; d=google.com; s=arc-20160816; b=OzK9ICod1mdv+2Kt54DtlLKL/4fmv0QdM9SLc5GjWD+Tn6BTA2GCM1CdJCtw0TewNo YlAtalpxoGQ5CMpmuanYkX4Vw8u831nFRxpBjo36xPKPlKYTpJgF0RgEt1atnk2fvqL7 +izEBFEL7yDuzyCrOVgx04lpkeBFjvsQpQDi56BaVeBqd7ryNcciVGh7oiL+dE5L9qLS UR0LrOhu1ctEXlMN5jZ+lKJMy+ykfRP5QE8uYECnnkfvg5HXTg3AEbEh4HdjbUruptWr rUe9Im6NU7XfBfxM7mkuYJdeXzjBde2mRwvtQsppof2FyLh/axT0U+sp2RvHUCBxQEGz CsRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=GzUWm5zwCL87XKp/TFGwynROGezvpJumXOstIOJFrbE=; b=UbR9SozbRU42IQPi9UiyKOwwvUKZOrebpmH+EYJ/eyMBeZtWaRt7QKazWTugmSvTib TEovnf8pYuzqvpdjZ8ejtmqMIzXTKzjycW2aohOiIBscg32XzkqLdBDJppKUzzUPxcaa NfEPnaa7piukvpsusGr64sP5jkdoQ9bYWK6rIwbwDOjVlklWozwGQ3YVPwGT1+T9nyof 3h7cRK5YWjxipQyCaMQMthNXtm3oUi2xxuV0L+MFZLeIk/QI8mhIo635MCKVJy8pPO9R zgKKxs44VDj/IwgW3Y67sidyDQJ3dqzQx8N7nJZRPZMhiHEDEjrFJ1IStw7b10V5aXGt Q8Cg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id s12si4705952eja.47.2019.11.06.05.11.38 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Nov 2019 05:11:38 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:57894 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSL60-0002m3-HA for patch@linaro.org; Wed, 06 Nov 2019 08:11:36 -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 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_Benn=C3=A9e?= , Artyom Tarasenko Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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(-) -- 2.21.0 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. -qemu_target_list="i386 i486 alpha arm armeb sparc32plus ppc ppc64 ppc64le m68k \ -mips mipsel mipsn32 mipsn32el mips64 mips64el \ +qemu_target_list="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" @@ -38,6 +38,10 @@ sparc32plus_magic='\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x sparc32plus_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff' sparc32plus_family=sparc +sparc64_magic='\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2b' +sparc64_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff' +sparc64_family=sparc + ppc_magic='\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14' ppc_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff' ppc_family=ppc From patchwork Wed Nov 6 13:04:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 178684 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp583493ilf; Wed, 6 Nov 2019 05:08:16 -0800 (PST) X-Google-Smtp-Source: APXvYqwiAmLL9fSFmuNsBGVwYMGYXzqROJ4QxptyXnJQ/X0CYDOmrs+I7I9XnJLqsdqa5TyHUIE2 X-Received: by 2002:a50:cd14:: with SMTP id z20mr2495066edi.226.1573045696608; Wed, 06 Nov 2019 05:08:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573045696; cv=none; d=google.com; s=arc-20160816; b=mheQ7e7aIMwebhBc+Xw1PwUvobupCf8TMbGqKGocxYnPp5xShW5ViNLeGTnQOsA7NL /QrJyEuaxl6fE9ZD4aRCeJMZ4Jp3BFQhPW3SaK1P999DVWRZkFi4vGz6AaeMoGbMvN3J izZQzRISq4fq5clbVWcw0qm6JkmEQMqXSTLeYnModbVj/BeaYxWMYST/N3aD5gu9sn6V v4dz/JNYtu/a0t5UQyiUwnXtv6C+i4PC5+474t/NuwAkNXowhRZZW+xRwDAPgLYvbgzd FWIxYvv2uPWCMniOm6riILBhPjFp1UKRtsk85GLM/YvT7j9HnprYSOkQOVUptPwszuQ8 Qr4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=Pft8K4rg6npcQqfz5dief5yIu3/lUG8QnT4Cfc+2QfM=; b=SWAhdVwZBL2HE5tn4Sl1mTKcVH5jij8yIqfiqVDLz3PGvL8Ly2KYLP5StN5wnbu1H3 4qOxlmfS4NcWQC1vMUb/ePpf++vzejng/ig0nJZmwINISeaSC5pIic8K3L2tJ5ovO3P7 IsKkk9Ikw4f++K48PTiXTjrjz22utsjdKJLZWeBt5LJbFBSm9a7EM7GHuJrr4/2w+Nqn BydiFnUoMMMGrkjT2d+XSCRaUNk2XdUL0KAd4Aag5o+JxeeVersdoTAXY5EcGveF0Cr+ iKKvLitOfltSGiepB7giH1Q5KXJHzjUENxp6zBikSCNzRw+50MhNTD1q/BiHjNfy+ayq f+Jg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y11si13436837edd.182.2019.11.06.05.08.16 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Nov 2019 05:08:16 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:57852 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSL2l-00073x-2C for patch@linaro.org; Wed, 06 Nov 2019 08:08:15 -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 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_Mathieu-Daud=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , Artyom Tarasenko Errors-To: qemu-devel-bounces+patch=linaro.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é 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(-) -- 2.21.0 diff --git a/tests/tcg/multiarch/linux-test.c b/tests/tcg/multiarch/linux-test.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) shmid = chk_error(shmget(IPC_PRIVATE, SHM_SIZE, IPC_CREAT | 0777)); ptr = shmat(shmid, NULL, 0); - if (!ptr) + if (ptr == (void *)-1) { error("shmat"); + } memset(ptr, 0, SHM_SIZE); From patchwork Wed Nov 6 13:04:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 178692 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp593857ilf; Wed, 6 Nov 2019 05:16:52 -0800 (PST) X-Google-Smtp-Source: APXvYqz3NJylLFZqa1Tib8coGDCJNgDUP95t+BTytMxqr/8Wn5QUhZScsnzDX6eVTECaM/TBsnmt X-Received: by 2002:ac8:36d2:: with SMTP id b18mr2318830qtc.172.1573046212388; Wed, 06 Nov 2019 05:16:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573046212; cv=none; d=google.com; s=arc-20160816; b=TuR3WwMQVNoHkMlgum/hbVAgkbSjEduqNCB5ueDtP3DLGMWsAatItxBNC/Qb1hQcVO wYA9UDK88HjHni0BJhakymPU2+mbtL8wEUV123e/CUzgSoXNgWbb2IbcmkFfrSmFNY9m TM+o+lsUEUSVcUf4zy7aYaqWOFuXoxgni/i4RifVEKnQx1oQngIe18gD1q8N4TbLXWdw jQF5anYz8xIJU5ouh2WGnd6Ab0FMw1FCP6WfY15nV/bSALD80+yqBf+aWW72GEEmta2u xXl99Wg2TTDPrmR/3FPS53nqSy6KNE4LnLNBzjaMTCrtC2xDqUWd3KnhFkvNZZcJZZ6g hGfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=k/mqF7l/v+2mSxsinDFMgi1FUCN4+tTnlqMkltZteuA=; b=igr4lT8OIuuesn2PZFSIsbOGYEQEGzyGR+dhtG453VtubQ82DLYP9XkK6wCUcCd6gh Uy95YTRj26DZDHNcVdgQAdXs10sD0aSs3GOyfCjLLXaac5PG3PNVIegQVsFEeotlXkAh sCHj0AGFE1ihRNmIAtw+4UeJ4GiKN3MIzk9loyjycL5bdAggEmKN1OU3UuUK+QhANgLc fhEpq9VN6iI9K7+zeBQSn+kz9vTcfL3I5qnvC2lwZ1tTKYrqXNGx4CamI0xxhuHAiBnQ 8d94GXaMsiByCbSbFzp8gLIpJ3KMW3410qlDj+3qye66uYu9fmpmyn8nCLiVOYa+Xkgw 3H7A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c31si18053591qta.238.2019.11.06.05.16.52 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Nov 2019 05:16:52 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:57958 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSLB5-0003CI-TE for patch@linaro.org; Wed, 06 Nov 2019 08:16:51 -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 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_Benn=C3=A9e?= , Artyom Tarasenko Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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(+) -- 2.21.0 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 @@ /*#define EXCP_INTERRUPT 0x100*/ +/* 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 = WREG_O6, + WREG_FP = WREG_I6, +}; + /* trap definitions */ #ifndef TARGET_SPARC64 #define TT_TFAULT 0x01 From patchwork Wed Nov 6 13:04:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 178688 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp587983ilf; Wed, 6 Nov 2019 05:11:56 -0800 (PST) X-Google-Smtp-Source: APXvYqw9ErNybQ1T6LWxg5errTQEoyoCC0VWVFVPeeYk3Fxy2opaqA8OvfDARPlud57Z6ILAve9h X-Received: by 2002:aa7:db82:: with SMTP id u2mr2524527edt.256.1573045916123; Wed, 06 Nov 2019 05:11:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573045916; cv=none; d=google.com; s=arc-20160816; b=ERloXpDZ8p0nz6CJi6YD1fUIgFbkOpEmwLM1ehrOF9/9ZzGvMON7y6zo7bdhaYDaaU 2fNsF2NT3lafsEoILqymD1fjEStOejOHyTKH6UsIK59BB4+AZc8KVwPpbdiX1holmdsz tmG4tDEIhgiqrlhAZBH1bUJMXOHSPLkkl6b961ieRnvDmzyyS52Ul2WS/86X559BHr4t qaj9sR4otIvn441yKxyihcsc24OUajieHPTCJc6GFCQgaOQaF9hf22m195Btg/No/KoM MyCPWydEWHLo26cTLExCZAhlvD3RlwoVY/RKquO4dMsgYXUisT8+bQ8C5RGkuJBL2wDW 3L9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=Z/ZwozH3rjs3ve+ASBDKmMI6P0/gKJPVZj+97ipT9eQ=; b=pWWZ2qDh4R1yvXazr6U4oaObURczhIXE0x2+ps3BtDF9Ea/CrcM8nU1aIYWsC3J8Wi x/2LhYdYBM5T05WXxUuUaIyj7GvygfnVSWaNXqOsd1tLS/0ZuksX0ux6vrOuD/zcrXQL XSsh5XKzsb9316AL8QQ/sQQliKChBWGOAjtNIJxD0i/mRhOl1AuGekMkKqR4mjzGqUyk P4g46LmSjtVjFT/7Wc44VRngc6rB7dZsZAyc3P4BwzyLXLKay0MHPClxIq53A5TCPxfG v6AolzWfUelbdGEVpDTRb2ayN3TrF/Qr/xWdZVtVprcLVlYhQ4NtBOEZIWoUhfFZX2dW 1qag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id r17si12585131edx.257.2019.11.06.05.11.55 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Nov 2019 05:11:56 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:57898 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSL6I-0003gt-Gq for patch@linaro.org; Wed, 06 Nov 2019 08:11:54 -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 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_Benn=C3=A9e?= , Artyom Tarasenko Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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(-) -- 2.21.0 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, target_ulong newtls) env->gregs[7] = newtls; } -#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 From patchwork Wed Nov 6 13:04:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 178686 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp587139ilf; Wed, 6 Nov 2019 05:11:17 -0800 (PST) X-Google-Smtp-Source: APXvYqymgXGEar8Dqx4jM2m1mN6h4W8hkIR0KjMNN4MmZnBhU2rq0tx0t9CMoMAvwd015IzkAGFs X-Received: by 2002:a05:620a:120e:: with SMTP id u14mr1884541qkj.325.1573045877097; Wed, 06 Nov 2019 05:11:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573045877; cv=none; d=google.com; s=arc-20160816; b=B1MGxA2piC7msPgtl3zHvJaRRPB3fhcAMsgkvtjDoknvOhQtP0SDIta5W30ssCf0hX HgL9c1uyeZedrbtVbu3asTvjkzCM+L0dZY0uiKyMBeI/V5T1N+fv2pPuRb8iSCIcQP4x NW9A/E+pDH6ivDY6dF7JNu7ik8c+K8QPtmHGQYAY0dW/KPMfTbFQkr4ZYz6kJgGGS6EW vbmK4DUeqCmf83yZW7mNN33yEq+uo1fAijfl+PH8dfh6rQpg76KWi4Gip9+aoLW8FJcD tpD1iorpfcOechyVrNVs+XcBZirU108JJvllpgmQ/LgWE0i5t8gcTN8yjlP8vgGAhI4W Ok2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=krqbwxRafu0SCqY50OMGiElBB80q+ISuAgB3pQt7Vdk=; b=VstA6Ay7O+veQzpfWMd1Kb91k9nZbtms/l9m0FUHEXG5ehDdgjKGc3MytcntbMbJcq oyFbIoSvSHwPdlp80XhU7HcYritiH1waBjseBTN4+VJRT1QIy8R3uQvvBDcSMhOhJLml cWoEuLZoioR6cYD37OCJXnwesLr5BMgc/z9BvA09lFVXQGX98HKen+1KhFXqAqM2ZBdZ WC5Lc0uFuFaVZIzyxkH7UjLb9tTybY6HbGA7vpCBi0JOfUGuhbP9NG1CRHoGeUMIqMqn m21wXDVQGsZnyp2h256adu5luZbEV+TIh9/y+HV404dailRI/dNck7RB6RAaGG8dD5+f oxFw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id r6si4601395qvp.98.2019.11.06.05.11.17 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Nov 2019 05:11:17 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:57886 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSL5g-0002dC-1v for patch@linaro.org; Wed, 06 Nov 2019 08:11:16 -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 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_Benn=C3=A9e?= , Artyom Tarasenko Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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(-) -- 2.21.0 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; }; -#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 static inline abi_ulong get_sigframe(struct target_sigaction *sa, 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=0; 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; } -#if 0 -static int -setup_sigcontext(struct target_sigcontext *sc, /*struct _fpstate *fpstate,*/ - CPUSPARCState *env, unsigned long mask) -{ - int err = 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))) void setup_frame(int sig, struct target_sigaction *ka, @@ -221,20 +192,20 @@ void setup_frame(int sig, struct target_sigaction *ka, } for (i = 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 = 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; /* 3. signal handler back-trampoline and parameters */ env->regwptr[UREG_FP] = sf_addr; - env->regwptr[UREG_I0] = sig; - env->regwptr[UREG_I1] = sf_addr + + env->regwptr[WREG_O0] = sig; + env->regwptr[WREG_O1] = sf_addr + offsetof(struct target_signal_frame, info); - env->regwptr[UREG_I2] = sf_addr + + env->regwptr[WREG_O2] = sf_addr + offsetof(struct target_signal_frame, info); /* 4. signal handler */ @@ -242,11 +213,11 @@ void setup_frame(int sig, struct target_sigaction *ka, env->npc = (env->pc + 4); /* 5. return to kernel instructions */ if (ka->ka_restorer) { - env->regwptr[UREG_I7] = ka->ka_restorer; + env->regwptr[WREG_O7] = ka->ka_restorer; } else { uint32_t val32; - env->regwptr[UREG_I7] = sf_addr + + env->regwptr[WREG_O7] = sf_addr + offsetof(struct target_signal_frame, insns) - 2 * 4; /* 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=0; 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]); } /* FIXME: implement FPU save/restore: @@ -433,7 +404,7 @@ void sparc64_set_context(CPUSPARCState *env) abi_ulong fp, i7, w_addr; unsigned int i; - ucp_addr = env->regwptr[UREG_I0]; + ucp_addr = 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; @@ -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])); __get_user(fp, &(ucp->tuc_mcontext.mc_fp)); __get_user(i7, &(ucp->tuc_mcontext.mc_i7)); - w_addr = TARGET_STACK_BIAS+env->regwptr[UREG_I6]; + w_addr = TARGET_STACK_BIAS + env->regwptr[WREG_O6]; if (put_user(fp, w_addr + offsetof(struct target_reg_window, ins[6]), abi_ulong) != 0) { goto do_sigsegv; @@ -534,7 +505,7 @@ void sparc64_get_context(CPUSPARCState *env) target_sigset_t target_set; sigset_t set; - ucp_addr = env->regwptr[UREG_I0]; + ucp_addr = 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 = 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 = TARGET_STACK_BIAS + env->regwptr[WREG_O6]; fp = i7 = 0; if (get_user(fp, w_addr + offsetof(struct target_reg_window, ins[6]), abi_ulong) != 0) { From patchwork Wed Nov 6 13:04:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 178689 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp588123ilf; Wed, 6 Nov 2019 05:12:02 -0800 (PST) X-Google-Smtp-Source: APXvYqwNLX/Qlr+BG3SERC+2FLTXNbeT6L+0H8LFh2g31Zrwm37VuirVQnRwVy4QK33TpkXW+Bkq X-Received: by 2002:a17:906:c7d0:: with SMTP id dc16mr6772990ejb.73.1573045922415; Wed, 06 Nov 2019 05:12:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573045922; cv=none; d=google.com; s=arc-20160816; b=BUdpsgGemlS/devrzV1h3O+MKt+q0lm3W69J4V75uAbppl/CEavC4HjpJeQCMAtRoC opctpcgN3XlA4tRzbfrkvAXfLAVDzGegoi8KV5FxeQC3x4r7HHQwuziMl2eIMAE6TWMA ixTenaane5zIgEs4VEl+7T01mcxCJC2yQUPlIwudf8wlr00xc5m4ZRWGRMoDjT/8if7h 8KSJZGVYd1tTYDomps5vKzmedZMF0obHBVMENwPVyMNXS4UrfSJps+bMiENF1fTn3zBa kAZ+dnddvS6zsvEckmbm0Icr3/e3Z6WIQPm+ncz6HdURlh+goi7EzmzB3jrKVjWeIHFX J1ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=7NG0Wd3aMUGYnuwRuRQR8Vk7jRkePwxxu8T0Min3+Co=; b=gcUxAtj1Vs4sm9pEW3LPD+hkTHL3/oDBoNqjlyP8TYWZjsgbq0ZFTFbLoKBeL9YYm2 bsfZsFFEQ7wsy5850cAAx/kMmCyZN7RHMfEuVuVZWddD5dyBD2HG75y5134Tn9l9+Hbx +tYv8JEHuKLSGHSFvk0krasJlENnJd8fIe/tm/91IBisQpaJ5mHYXIjqh+NwO7AC+wGV 60mp0bNs1RFbZ71SgGrjjHWE1XKxx1DW6yNNHBJbw+kDwsisj18tXZRhcM2Nv+p6bHSW XPGUhvovAEiDBRuvfDfRq7u9ARjz5UOeCrmxNpfN7m6cpXulo7Y1mKJ8boruTab0FP7E /6lg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f3si13347784eda.251.2019.11.06.05.12.02 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Nov 2019 05:12:02 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:57896 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSL6O-0003LG-U4 for patch@linaro.org; Wed, 06 Nov 2019 08:12:00 -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 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_Benn=C3=A9e?= , Artyom Tarasenko Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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(-) -- 2.21.0 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; }; -#define UREG_FP WREG_O6 -#define UREG_SP WREG_I6 - static inline abi_ulong get_sigframe(struct target_sigaction *sa, CPUSPARCState *env, unsigned long framesize) @@ -201,7 +198,7 @@ void setup_frame(int sig, struct target_sigaction *ka, goto sigsegv; /* 3. signal handler back-trampoline and parameters */ - env->regwptr[UREG_FP] = sf_addr; + env->regwptr[WREG_SP] = sf_addr; env->regwptr[WREG_O0] = sig; env->regwptr[WREG_O1] = sf_addr + offsetof(struct target_signal_frame, info); @@ -255,7 +252,7 @@ long do_sigreturn(CPUSPARCState *env) sigset_t host_set; int i; - sf_addr = env->regwptr[UREG_FP]; + sf_addr = 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; From patchwork Wed Nov 6 13:04:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 178685 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp584143ilf; Wed, 6 Nov 2019 05:08:50 -0800 (PST) X-Google-Smtp-Source: APXvYqwJSsiqm446DfjvmPWcuFifGqCJampdYlvAl0S1ivBOlTbhUzfYz8PsULxWWankojMGLLad X-Received: by 2002:a17:906:f154:: with SMTP id gw20mr8399464ejb.279.1573045730401; Wed, 06 Nov 2019 05:08:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573045730; cv=none; d=google.com; s=arc-20160816; b=mQwjNvkrVkuL4cZZ0ry/RSf76saRdRsG34hO9Am0no3ytcemn12gddls4NjSch/SX/ 8k1Gf0IRwr7zpwaaGRsSJB0e9uKh2gpxWjritSyrRHvoe7nElsItibdd/JNuXZP/e4+n Q9b3deTQy8LqLC0Gvd1KHMgzwjN60LbMwCwjbZbuxVsmxdq982dI+o4uOGurLuNromLm 002KxR5Zp3WpaalVk5p/R0OA4dvh92L5NjyrZeyiPye6B7M/ZqgS8+WvGBdtaSw6p+dT ILe1xSp8bASh8EslDB1l3b4stPNBu+BuA67XdcIM7kqX7/dMk8kSC4mUDHJMIXolADYv ZZVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=mJFycwX2aZBTmMoK9IJL4vaq49BgbSJ1Dnu2MR3pXjI=; b=h7rSyoWy1XvhaWQyox/QiMkOg7uOXx6KLjyjMETfeemI3QOOWEoKxYN/3Ld3IAHpnN S3hbRENxfqWe+XCSHq+LmpD/pSzGXBAfBfjBwXefNyshzDcbNmgI/bOQlFWad1KLXfNV bxxpX8+pDEg9NOgyICXZSqNO5Z0vG4imL7FRPOlW2lvRbs/mVivzmw6zM+caDja2Z9Aj w3KIw9u+iuVi+hRX+jebTY/dLx3Dr9vMPorPjgqPs9D3AN3hZYFUNs2Z7GhHAWYaolrR GqNBcMm+5CR2gL9wXq1alsN4Noy/MUhUJSIPsYnJ3c1ZClYMR7vOAv7h6uhc1qiAYung xULA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id s10si16029407ejq.255.2019.11.06.05.08.50 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Nov 2019 05:08:50 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:57860 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSL3I-0007zi-RU for patch@linaro.org; Wed, 06 Nov 2019 08:08:48 -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 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_Benn=C3=A9e?= , Artyom Tarasenko Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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(-) -- 2.21.0 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 = 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; From patchwork Wed Nov 6 13:04:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 178690 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp588297ilf; Wed, 6 Nov 2019 05:12:10 -0800 (PST) X-Google-Smtp-Source: APXvYqxt0CMx35KJuLZichj3VxAXY45NxVnV3XUSTLpSMBwORvdkYvSTXIKfntt4TroM9HL4pKGv X-Received: by 2002:a50:c2c2:: with SMTP id u2mr2586983edf.133.1573045930723; Wed, 06 Nov 2019 05:12:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573045930; cv=none; d=google.com; s=arc-20160816; b=MxrRoiS2482f068q1QP6YqI33sb/rqe2IH4WJrGCePYezSZdnYEn74bHFNTwlcyG3f iZE5iJZxZklpR4kVpYzy8CpiNrcSSqfbULgAy7/2WPQhPJFTdQymJv4dn+mRebPmfix7 yUTiJheOgzZA+ACvEE6VyuhpvnCV/+MeVBcKtHrPcCMwvQY6o6tHhMqZLGyOY7KXNvPQ 6/RxSqVaLYudd2CqckZfHSackk1vsBQnEKn1yqV3SVifegF5oqVoS3QjCxT0XR21dlTa 4Rl06eS6G12O4r0oEPeDLenjBucv5lYbJj84oBglUe3RD5gD4n3sdItTbvfY09bFjvXo 9QsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=too/yi4ijJc2WkIyHZCEZXIbSuvPRsnTytozXenO15k=; b=kJ8fGmJjFFiS2vFbTMiVKcSOOxzGpRvtec0bLeTY/AKdJafI8f1Yly/FAE8HXRBaNp YMochKjfl4pWEoboANaq5Nimm/OrNM8geiKTsW3jRUcdF3CAfttJE8gc1JoplIKTIGLN /vUqTOq2+ih2ZGYrmSygVkfD2irMxe5YcJDp75SIhqGeHkMckvT1F/IfcvsTI4PH1qRw 8n6kh5CQFW6/gol4FaOvs5QyYiDU1kvMLAfXDfhddGP5nqDr5IVuxEzfBLWQ3KkNqHv1 WEwUNnacJp6DyWuK0+Om/tH9InTohRW2c4P4WX2KLQHcHM8sBmPqXD02nCJ89awNuzl9 yiTw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c3si13530925edx.315.2019.11.06.05.12.10 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Nov 2019 05:12:10 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:57902 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSL6W-0004Ca-WA for patch@linaro.org; Wed, 06 Nov 2019 08:12:09 -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 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_Benn=C3=A9e?= , Artyom Tarasenko Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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(-) -- 2.21.0 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; From patchwork Wed Nov 6 13:04:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 178693 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp595171ilf; Wed, 6 Nov 2019 05:17:59 -0800 (PST) X-Google-Smtp-Source: APXvYqwR/mYLC7mW1yZMRq7pRN56OmqiIP9u87M+8tzGJBzDl1Ck2nVrOTUHJRoRnlMkhmCmg2IR X-Received: by 2002:a17:907:10d6:: with SMTP id rv22mr28712292ejb.331.1573046279724; Wed, 06 Nov 2019 05:17:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573046279; cv=none; d=google.com; s=arc-20160816; b=VzzIKQxGcd1ciBdxNF/XucghvqchhzK9+rzAM0FcZFGDdlOiHCwrAwGLQXrz7ETxGd A4n1aOq+QNbmBdxhpxa9WCqBS6FNSTiBWD4/JUF+AMSE6r8JGVA0ze5hnnJEwQsY0CH/ ex3PLQU5Lp6JccC+XR2DRBRXqFqgCtyiYVY0X6MRU+VRo394Sw7FURv6GdKhU4xup2GK s2D2r3WWLQxBGtgVQpLyfhRHSzkiZ1PbParPDKIGm6F8mO+dR8A5Q4lU4Y0AKiMswzuU HKDQC7L4vb+BmnvKfN4ZY9fBjGvXw7aSqUZbjzftk1/QADqyTYOgfloRrM2xCimWwzGK ttdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=rl1YzhYnAgNQr+YHhprLqB449zj5ToigSSs4JDkvCJE=; b=B2smXwSGAjrLxH4zCBZ4RkTtBX06LCf8XSpUsVPbCB+af7ONuVo0s43sB/U+nEzDDn 1gPO5NNFbfe+XpCQiI3EYVubIG10+h04viEiFHXulZObDfIkFfEsStpRceh/6eyM4VRF HCFEiacEX/xaD7rfg4Z+98cTVdDDHRIbWdIKVbuFrws/GwWwBqyZ+HQR8RSA589mgaPS 3flxKmtL5GpLd4XkkUVvWFAnGzRgBWY8RlRGNuZF5z1QpcGyYRK6bj8n51FxquZ41tow X+3kw7CyCg/sqJl2YT6mZFTeUvWQV2Ct2oxlBQncA4uDU/fLhlfL8p0dEo0JJ8Pnpvrj 4N1w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v13si16200382edb.164.2019.11.06.05.17.59 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Nov 2019 05:17:59 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:57984 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSLCA-0003qY-Et for patch@linaro.org; Wed, 06 Nov 2019 08:17:58 -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 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_Mathieu-Daud=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , Artyom Tarasenko Errors-To: qemu-devel-bounces+patch=linaro.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é 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(-) -- 2.21.0 diff --git a/linux-user/aarch64/target_cpu.h b/linux-user/aarch64/target_cpu.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 -static inline void cpu_clone_regs(CPUARMState *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUARMState *env, target_ulong newsp, + unsigned flags) { if (newsp) { env->xregs[31] = 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 -static inline void cpu_clone_regs(CPUAlphaState *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUAlphaState *env, target_ulong newsp, + unsigned flags) { if (newsp) { env->ir[IR_SP] = 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 -static inline void cpu_clone_regs(CPUARMState *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUARMState *env, target_ulong newsp, + unsigned flags) { if (newsp) { env->regs[13] = 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 -static inline void cpu_clone_regs(CPUCRISState *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUCRISState *env, target_ulong newsp, + unsigned flags) { if (newsp) { env->regs[14] = 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 -static inline void cpu_clone_regs(CPUHPPAState *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUHPPAState *env, target_ulong newsp, + unsigned flags) { if (newsp) { env->gr[30] = 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 -static inline void cpu_clone_regs(CPUX86State *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUX86State *env, target_ulong newsp, + unsigned flags) { if (newsp) { env->regs[R_ESP] = 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 -static inline void cpu_clone_regs(CPUM68KState *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUM68KState *env, target_ulong newsp, + unsigned flags) { if (newsp) { env->aregs[7] = newsp; diff --git a/linux-user/microblaze/target_cpu.h b/linux-user/microblaze/target_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 -static inline void cpu_clone_regs(CPUMBState *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUMBState *env, target_ulong newsp, + unsigned flags) { if (newsp) { env->regs[R_SP] = 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 -static inline void cpu_clone_regs(CPUMIPSState *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUMIPSState *env, target_ulong newsp, + unsigned flags) { if (newsp) { env->active_tc.gpr[29] = 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 -static inline void cpu_clone_regs(CPUNios2State *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUNios2State *env, target_ulong newsp, + unsigned flags) { if (newsp) { env->regs[R_SP] = 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 -static inline void cpu_clone_regs(CPUOpenRISCState *env, target_ulong newsp) +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 -static inline void cpu_clone_regs(CPUPPCState *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUPPCState *env, target_ulong newsp, + unsigned flags) { if (newsp) { env->gpr[1] = 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 -static inline void cpu_clone_regs(CPURISCVState *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPURISCVState *env, target_ulong newsp, + unsigned flags) { if (newsp) { env->gpr[xSP] = 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 -static inline void cpu_clone_regs(CPUS390XState *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUS390XState *env, target_ulong newsp, + unsigned flags) { if (newsp) { env->regs[15] = 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 -static inline void cpu_clone_regs(CPUSH4State *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUSH4State *env, target_ulong newsp, + unsigned flags) { if (newsp) { env->gregs[15] = 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 -static inline void cpu_clone_regs(CPUSPARCState *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUSPARCState *env, target_ulong newsp, + unsigned flags) { if (newsp) { env->regwptr[22] = 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 flags, abi_ulong newsp, /* we create a new CPU instance. */ new_env = 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 = env_cpu(new_env); new_cpu->opaque = ts; ts->bprm = parent_ts->bprm; @@ -5899,7 +5899,7 @@ static int do_fork(CPUArchState *env, unsigned int flags, abi_ulong newsp, ret = fork(); if (ret == 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 -static inline void cpu_clone_regs(CPUTLGState *env, target_ulong newsp) +static inline void cpu_clone_regs_child(CPUTLGState *env, target_ulong newsp, + unsigned flags) { if (newsp) { env->regs[TILEGX_R_SP] = 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 -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] = newsp; From patchwork Wed Nov 6 13:04:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 178694 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp597636ilf; Wed, 6 Nov 2019 05:20:01 -0800 (PST) X-Google-Smtp-Source: APXvYqz9NLMyP88OErpLsf0QR2Le1pUectvYGnznQlYxYZwgnVZ2VzQNO5mugDxybUQohEWausQc X-Received: by 2002:aa7:c44a:: with SMTP id n10mr2544433edr.282.1573046401131; Wed, 06 Nov 2019 05:20:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573046401; cv=none; d=google.com; s=arc-20160816; b=N8aV69XYmgI/Guk9vH9xzZdmhjtx1q2L/3Qpox48pq20FlXZwBbVRhmHtVG1coxbb0 7njtusJ+u7RNOMcZE6ko4pY1BLHgGyL+fuZaCKL3QPMY4NjEkbSCAE57twnUeyBt3Fyo TZ7s4BvJH5unHLLufFqFCRBT0TKJpRlis823duDvtGnrPR1FutCh2ks3I0ik6TCYN/5+ 8n5GTISKspFDQ1kHj6qEsPzMdcbLw8BCbtDpwS/fbj5OOJn+uL/7pKwR8CgLrM52ZFvy rAqOpTwPjBS/LeETIFLmxMeP6Yn7vcBGKwIAOtOwbpCrwpoXIxOKenWgjscbqBgpXpWG +SWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=sJFYvzGNAtG2Y10f9vNUZIRuluUY9W4idI/lmnJt/ew=; b=j4S5ufyhcu8yBgyQV7FuDPy7Z1HTcwnx1WsXzw5UcwcQGAfB3KFiln214gShu97wC5 FyvvfQoZMhGV0aiuwJelhq3fjYxBqqN8sbEamC7Mq7rDfY5iikT8brjwcnqwO8EfNgpN KbZdXppP8/stcwU/nExUyUB8dt2o0xXdKqTQPs1t1cv8952A4YKVKGgW1awMQOvPQ8AO 7RWQ0d5ce29/aYLiB+KvGwWV/4RNUZG9uTcrONzeFzM6nc5fIf26GBjwHHSN399RdfMY HoIH0LusPnpXFGVwtrbi+l0KFLI90l0u41cpdHXA/9UXTMwMc6wMZ5vLofntZuJUgqZi +uGA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id bi3si13427048edb.331.2019.11.06.05.20.00 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Nov 2019 05:20:01 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:57998 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSLE7-0005om-Qy for patch@linaro.org; Wed, 06 Nov 2019 08:19:59 -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 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_Mathieu-Daud=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , Artyom Tarasenko Errors-To: qemu-devel-bounces+patch=linaro.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é 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(+) -- 2.21.0 diff --git a/linux-user/aarch64/target_cpu.h b/linux-user/aarch64/target_cpu.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] = 0; } +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 *env, target_ulong newsp, env->ir[IR_A3] = 0; } +static inline void cpu_clone_regs_parent(CPUAlphaState *env, unsigned flags) +{ +} + static inline void cpu_set_tls(CPUAlphaState *env, target_ulong newtls) { env->unique = 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] = 0; } +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 *env, target_ulong newsp, env->regs[10] = 0; } +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] = (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 *env, target_ulong newsp, env->iaoq_b = env->gr[31] + 4; } +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] = 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] = 0; } +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); 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 *env, target_ulong newsp, env->dregs[0] = 0; } +static inline void cpu_clone_regs_parent(CPUM68KState *env, unsigned flags) +{ +} + static inline void cpu_set_tls(CPUM68KState *env, target_ulong newtls) { CPUState *cs = env_cpu(env); diff --git a/linux-user/microblaze/target_cpu.h b/linux-user/microblaze/target_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] = 0; } +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] = 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 *env, target_ulong newsp, env->active_tc.gpr[2] = 0; } +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 = 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 *env, target_ulong newsp, env->regs[R_RET0] = 0; } +static inline void cpu_clone_regs_parent(CPUNios2State *env, unsigned flags) +{ +} + 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); } +static inline void cpu_clone_regs_parent(CPUOpenRISCState *env, unsigned flags) +{ +} + 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] = 0; } +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 *env, target_ulong newsp, env->gpr[xA0] = 0; } +static inline void cpu_clone_regs_parent(CPURISCVState *env, unsigned flags) +{ +} + static inline void cpu_set_tls(CPURISCVState *env, target_ulong newtls) { env->gpr[xTP] = 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 *env, target_ulong newsp, env->regs[2] = 0; } +static inline void cpu_clone_regs_parent(CPUS390XState *env, unsigned flags) +{ +} + static inline void cpu_set_tls(CPUS390XState *env, target_ulong newtls) { env->aregs[0] = 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] = 0; } +static inline void cpu_clone_regs_parent(CPUSH4State *env, unsigned flags) +{ +} + static inline void cpu_set_tls(CPUSH4State *env, target_ulong newtls) { env->gbr = 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 *env, target_ulong newsp, #endif } +static inline void cpu_clone_regs_parent(CPUSPARCState *env, unsigned flags) +{ +} + static inline void cpu_set_tls(CPUSPARCState *env, target_ulong newtls) { env->gregs[7] = 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 flags, abi_ulong newsp, new_env = 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 = env_cpu(new_env); new_cpu->opaque = ts; ts->bprm = parent_ts->bprm; @@ -5917,6 +5918,7 @@ static int do_fork(CPUArchState *env, unsigned int flags, abi_ulong newsp, if (flags & CLONE_CHILD_CLEARTID) ts->child_tidptr = 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] = 0; } +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] = 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] = 0; } +static inline void cpu_clone_regs_parent(CPUXtensaState *env, unsigned flags) +{ +} + static inline void cpu_set_tls(CPUXtensaState *env, target_ulong newtls) { env->uregs[THREADPTR] = newtls; From patchwork Wed Nov 6 13:04:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 178683 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp583472ilf; Wed, 6 Nov 2019 05:08:15 -0800 (PST) X-Google-Smtp-Source: APXvYqx+CC6bQmmbMWzRTYTCEKMAx1Kc6ApjGSI2ZQPlRKBHK5N0ZKEB7XAiyjjxNpI//gsEQ34L X-Received: by 2002:a50:c2c2:: with SMTP id u2mr2563786edf.133.1573045695492; Wed, 06 Nov 2019 05:08:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573045695; cv=none; d=google.com; s=arc-20160816; b=sLn0iYWPHpgEd3hfxMh71Z+xbh6YWpe1yp22Q92S/h4iaB6kcco/We9Yl6Vm9v3j4m XaZbYZeF58nlevYfqo8EaL9pOYnsPEsmhpk46wGO2lyENps9yT3hddcCgL4EY7ehVi96 LFJZawij58bAoMGFmvl64fHQS0oMjtK/tfwuKvYB7h63HnrKgbgI3p8BhoieTAnd+Ybl Jb0EZSJYh0P3KZUopqz4w8NPy1d/WUO/2vb2vY4ZqA4unnKsrh6y+IQthxFtRV9TdPRx LhIwqfVdlpXCIQBJ0jssZCKZMMuZCb/lIFDgdrZg1iePcHxbSjQ7LvPHpI/2IcCdNAoE mL0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=u8vrI7e3KAGuA1momMrq3+uxrTD/dnf99cgsCUrF9Oo=; b=SxiBgAafXCQAqP07NjPe+ALgpFvkbwYzt6qm+wjh6mFtrMYty6lUpHWwiwbxhy25jx VOKTJtUFcliI3NmqCstNhviw6M9n20cY2Z4R0zYNZr4t+gmWlH95S9AR6Q4pdEu38T0l D0f0rx6EXS81iMJB0r9/4XueVxtmxnckForje+F7KMdt6Zd2lY2Zk6A3y7Idiz9A1t+c XYwUaTg6JYSv17u+07JMpbzeiLbsVdEuRgZXJf0sTi7fgZo4YWV0ljsT4/1M/KmU8n33 Y0uG4WChLPDAyJ+38mZU+n4G04SQh5wdzItHiQkQ69lk++imT4Re9jvxzECQKHkq5D6U yKvA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 1si16392681ejt.404.2019.11.06.05.08.15 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Nov 2019 05:08:15 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:57850 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSL2k-00072T-0s for patch@linaro.org; Wed, 06 Nov 2019 08:08:14 -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 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_Benn=C3=A9e?= , Artyom Tarasenko Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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(-) -- 2.21.0 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 newsp, 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 = env->regbase + (env->cwp * 16); + if (newsp) { - env->regwptr[22] = newsp; + /* When changing stacks, do it with clean register windows. */ +#ifdef TARGET_SPARC64 + env->cansave = env->nwindows - 2; + env->cleanwin = env->nwindows - 2; + env->canrestore = 0; +#else + env->wim = 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] = newsp; } - /* syscall return for clone child: 0, and clear CF since - * this counts as a success return value. - */ - env->regwptr[0] = 0; + + if (flags & CLONE_VM) { + /* + * Syscall return for clone child: %o0 = 0 and clear CF since this + * counts as a success return value. Advance the PC past the syscall. + * For fork child, all of this happens in cpu_loop, and we must not + * do the pc advance twice. + */ + env->regwptr[WREG_O0] = 0; #if defined(TARGET_SPARC64) && !defined(TARGET_ABI32) - env->xcc &= ~PSR_CARRY; + env->xcc &= ~PSR_CARRY; #else - env->psr &= ~PSR_CARRY; + env->psr &= ~PSR_CARRY; #endif + env->pc = env->npc; + env->npc = env->npc + 4; + } + + /* Set the second return value for the child: %o1 = 1. */ + env->regwptr[WREG_O1] = 1; } static inline void cpu_clone_regs_parent(CPUSPARCState *env, unsigned flags) { + /* Set the second return value for the parent: %o1 = 0. */ + env->regwptr[WREG_O1] = 0; } static inline void cpu_set_tls(CPUSPARCState *env, target_ulong newtls) From patchwork Wed Nov 6 13:04:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 178691 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp588419ilf; Wed, 6 Nov 2019 05:12:16 -0800 (PST) X-Google-Smtp-Source: APXvYqwy6xWpYQ97URPpjNvfwSIWm2Hy+q1IxkCOfw1bDAp/wJLsXCXIqYaYkMIODIVBb69JOSV7 X-Received: by 2002:a50:d7c9:: with SMTP id m9mr2607993edj.93.1573045936819; Wed, 06 Nov 2019 05:12:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573045936; cv=none; d=google.com; s=arc-20160816; b=kD7FokHKJxuf4EqDhXlCV0LdMUKh+dPFpiXkn8JVobmuHhIpCpfdxkcJO2gc/mvhST khUYQTryEs82aNveT+19aL9/MuWn2BJEfNvd5R2qYyKTr976In5rPWDgz8pzZ57uev8l D8oekHrVfO7lkGj9ixBFia1tmkOAIt/2Q3mBNIqlG1QcCWpQCtuqjKmv7WnzMBk9Gotw yu2w4NmT92PMiqV9BfvGpuRW4AtsZQhwDY+EW/3Z3X1owIBh52vQFuXYkJmoIws5TQWn qjYEp8gKJ04VyAXviCLD24g6wzdXZDvy+X0pmdY+kjkVLi5kFaxKmG1Zm2OnglM4c3zo W/fA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=p40Pa87LJUVJxYlcAWYnNeHeQq7IFVjh00J/2+b0tNQ=; b=cwXhWeIAarV3SGixe16a6YGM1UoifJ4SnVJ8DgNw9sluHcJyJpJGhn/qpZm1+RYZvI KeIV+hlWiLhT2vjNZ5R22DtqcTm0hffIf2eqTDM9j7ricq8u+2cs2MxrmF8QuiLTk1Da sAT8eXLE45K1HLrSGApW5W1CtTgm7EZwtqrLUbsmZvQQnVq5Ayl1tYd5Wp5ge+/mYYUP OeQ4eXU+5FtG5DqUt3rYcp6pbxytE7lpxsyyXDXvJgxmRMo0BVp58ObHDLsyHxvsVmcU 2XR4VcZ7Up+oO9nNphJGgplNP+g2vIZzfjSqhKFDJupQj+Lirz/D5YGls8VPDEa7DObL x3SA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id s24si9006069ejb.45.2019.11.06.05.12.16 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Nov 2019 05:12:16 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:57900 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSL6d-0003sD-9A for patch@linaro.org; Wed, 06 Nov 2019 08:12:15 -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 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_Benn=C3=A9e?= , Artyom Tarasenko Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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(+) -- 2.21.0 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] = 0; env->ir[IR_A3] = 0; + env->ir[IR_A4] = 1; /* OSF/1 secondary return: child */ } static inline void cpu_clone_regs_parent(CPUAlphaState *env, unsigned flags) { + /* + * 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] = 0; + } } static inline void cpu_set_tls(CPUAlphaState *env, target_ulong newtls)