From patchwork Wed Mar 8 13:28:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 660448 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp330597wrb; Wed, 8 Mar 2023 05:35:57 -0800 (PST) X-Google-Smtp-Source: AK7set8FTh0pkNBFjoMVrecHlHLjCTUZWg+fGUmFvmsvknkkiu93yWhvq4K8Y+AB2maodSMY9z06 X-Received: by 2002:ac8:7c55:0:b0:3bf:b707:e889 with SMTP id o21-20020ac87c55000000b003bfb707e889mr32361994qtv.34.1678282557628; Wed, 08 Mar 2023 05:35:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678282557; cv=none; d=google.com; s=arc-20160816; b=p7Dun15rdUBF4HnIl51AWSMraW/bCl8gGDI3mRlVKIwSLXz0lHMUY7OtuDB3edKF1F uMkyRpHRce1VPjLuEmhWRM8FcJxySxkBnlj7/kYmpLS2mXINA8h0lfMlqogBylBNW+D6 0taqASc71ATVvSycvlyZzumFYlY/XXhzDFZMi2VdczwDdtHusQsHmEHfXEcAyUFKFU5f c+YnDmRU09IBAlcPWuu80rQ22v69hoXYHhS54DhfA+qeDOHlaswvg0X0ntiDiD+aDCND AW3Y44MhYJHtOgPAjxTbjC879hyeeVgXkR13qyV76Y2OGpwoA4zj04Ylo9nskjw7by5E 0H9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:ui-outboundreport :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=RvAczabgql2JYnv/PSf2D9vbDtURny57Sjiie80Xgqs=; b=hgugTKX6lkc8qNJY/5Di9u1lTcEl6PMw6+eFOV4aMjXvzZXX7EoPND1DjYKbTpk1w8 cfnDUAoZnr/JGP0lSTzAl4CVz3bOS/1Y/XTE893L9ilmnnaIFu+9x4y3wx7AELvW8YmP 5+6uyvk5Mh/oJJNXhhy9movKxbJwLO86u+ZQoeXQ4yFG9SFUcNPB4/lRSIx8M47QEQyy jqiCMJ4DiTybovZWXkHjZaB2ziIAAZIwR6ZLePLXz0GGpl3f5aJxceroyC+l6dj6SZTO wgJ/uW+7pU7V/pWXwTCFx9TByF9jOnQFphhmtBm65Z8aSJ5DzWwaqBgebgn+Leah7jaF 21Fg== 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 p191-20020a3742c8000000b007427117bca8si11433577qka.440.2023.03.08.05.35.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 Mar 2023 05:35:57 -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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZtrc-00020l-H7; Wed, 08 Mar 2023 08:29:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZtr5-0001kj-6q for qemu-devel@nongnu.org; Wed, 08 Mar 2023 08:29:19 -0500 Received: from mout.kundenserver.de ([217.72.192.73]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZtr2-00067e-Oz for qemu-devel@nongnu.org; Wed, 08 Mar 2023 08:29:18 -0500 Received: from quad ([82.142.8.70]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1M6VNX-1pcNlJ17X7-006v4Z; Wed, 08 Mar 2023 14:29:12 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Cc: Richard Henderson , Laurent Vivier Subject: [PULL 20/28] linux-user/sparc: Handle division by zero traps Date: Wed, 8 Mar 2023 14:28:49 +0100 Message-Id: <20230308132857.161793-21-laurent@vivier.eu> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230308132857.161793-1-laurent@vivier.eu> References: <20230308132857.161793-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:jx1dbuJkZcVQm+wcO1oYS1zmFQF0plfgeovlw/wxXRh+LqtIiRK 92mEEnGmv7EiJ6e4DFVebex56auYdZHh37yg4iomlx7ETkq1FeKeI2pf31mmMiZT5B16UsE X4akwDl4rU2BwQLThUJ3/rO5OS77lRbv+NOOpOboFrJC9+X8X4jSv9O/67GlO1BwGxHpSTR 45Q/Vqo3qHgS4k/RQ407g== UI-OutboundReport: notjunk:1;M01:P0:UOBA8DhajhQ=;nTlcw1TbnJvITwKeuoHlkmM1ZIk FYsL8QvJi3d29MukFcwKiNCfHh/P3hKnITbu3Md7b1QVJZ0H/iNQWMM/5Q/X8kGksi1bjVQjd Woc9XLgXvG8oVbVz8ChKMppDpsQMVJVRcMsLjKLIPpwJb2G7EXbz8b8spay7npN2MKkNbjX9G 4xSi3mZWiiGDHWKgaHdavAVTXZeEYQIoXYE32j6r6InEn2BSGWW0Hnz2sEzL/iJZidUP7kO1V Ld50oTnjWQ9v3dg+PCgr0lHDA708y8myBJubyEZ9F3MymIfmCxd9S7d+IGUQB76hnpVjUZRtp iirzFYFMVen7OFs7Qkg19eNVMkW/LyPwYCYlPziz4+yiSg0qy/+y01s6AXc7fY2hdT6WL+K2B cV/kfkLk3Aqbram2S4dvK220jvoHCBbs0panfiJ0IhAbs0OtcIW721QgAeFp3r5zJTx5eCQRa L2xCf0tnCYJlsunQZpCsawpp8nw+58y9HL3E1UT2DjsvQLqbiPj26Xubyx6+e0sE8JqMfzYV/ KvaKthX0QhhfzqTJtcDaBZepKqbG7ffLFvrOvel/jCIeP/tydAj45DcF3xycAgInyZKwmW1qh nZ20vaq1BptPg1bPrRk76zru/7oYAF09K2ELiT8oe0ptC0np+ZABBQOcn6YU8+tD0r1EsgReF 6Rk1Rv8/UEnnNHBbjexkyKb6bCiNb9WovjVQmYJiXw== Received-SPF: none client-ip=217.72.192.73; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson In addition to the hw trap vector, there is a software trap assigned for older sparc without hw division instructions. Signed-off-by: Richard Henderson Message-Id: <20230216054516.1267305-9-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/sparc/cpu_loop.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/linux-user/sparc/cpu_loop.c b/linux-user/sparc/cpu_loop.c index c14eaea16370..e04c84286769 100644 --- a/linux-user/sparc/cpu_loop.c +++ b/linux-user/sparc/cpu_loop.c @@ -211,6 +211,11 @@ void cpu_loop (CPUSPARCState *env) force_sig_fault(TARGET_SIGTRAP, TARGET_TRAP_BRKPT, env->pc); break; + case TT_TRAP + 0x02: /* div0 */ + case TT_DIV_ZERO: + force_sig_fault(TARGET_SIGFPE, TARGET_FPE_INTDIV, env->pc); + break; + case TT_TRAP + 0x03: /* flush windows */ flush_windows(env); /* next instruction */