From nobody Tue Feb 10 14:32:14 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1561651954; cv=none; d=zoho.com; s=zohoarc; b=i1fEeeje393SZEFBKMh3VIjC23XW1PSes1bZ9U3A/dWphIajbPf0c6DtI5zPhXI2spl9CbkhUvJujC5X0IsurLjwv3gBrIryA8wQGcShUQlWA1SSIdmMsbMt2OgcdCMvCuRP6o9Yo7t2l6+Y6omUwntaopLQGe79+r+lseWOimo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561651954; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=yOlIXcZHVeF7ySryPbs32bGkTJlhToa+hcYCLG/Ep6U=; b=mgYtExCY0q8NakJUfRCpNQ4iTvulf0Nz/mRa/yTWF2pRJV7yOZIynwZd6cevo+qeX8XashYEin6VfiuA6lljIwIJlXzWj+XGrGFCjlYEI7ciw2JI0p6jvmnL8X+8t6qQThzzbFev8sP2tfJNKbiDUp5IebnqtuBcFOaVnZmVLEA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1561651954750360.1106022762507; Thu, 27 Jun 2019 09:12:34 -0700 (PDT) Received: from localhost ([::1]:52136 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgX0g-00067d-Cd for importer@patchew.org; Thu, 27 Jun 2019 12:12:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34854) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgWOm-0001iS-2t for qemu-devel@nongnu.org; Thu, 27 Jun 2019 11:33:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hgWOj-0006k5-Rn for qemu-devel@nongnu.org; Thu, 27 Jun 2019 11:33:19 -0400 Received: from mx2.rt-rk.com ([89.216.37.149]:56715 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hgWOa-0005rf-H1 for qemu-devel@nongnu.org; Thu, 27 Jun 2019 11:33:12 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id EDAAD1A4560; Thu, 27 Jun 2019 17:32:13 +0200 (CEST) Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.13.43]) by mail.rt-rk.com (Postfix) with ESMTPSA id D0AB81A20BA; Thu, 27 Jun 2019 17:32:13 +0200 (CEST) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org, laurent@vivier.eu Date: Thu, 27 Jun 2019 17:31:50 +0200 Message-Id: <1561649510-21183-6-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561649510-21183-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1561649510-21183-1-git-send-email-aleksandar.markovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 89.216.37.149 Subject: [Qemu-devel] [PATCH v14 5/5] linux-user: Handle EXCP_FPE properly for MIPS 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: amarkovic@wavecomp.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Aleksandar Markovic Handle EXCP_FPE properly for MIPS in cpu loop. Note that a vast majority of FP instructions are not affected by the absence of the code in this patch, as they use alternative code paths for handling floating point exceptions (see, for example, invocations of update_fcr31()) - they rely on softfloat library for keeping track on exceptions that needs to be raised. However, there are few MIPS FP instructions (an example is CTC1) that use function do_raise_exception() directly, and they need the case that is added in this patch to propagate the FPE exception as designed. Reported-by: Yunqiang Su Signed-off-by: Aleksandar Markovic --- linux-user/mips/cpu_loop.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/linux-user/mips/cpu_loop.c b/linux-user/mips/cpu_loop.c index 43ba267..7d3c6b9 100644 --- a/linux-user/mips/cpu_loop.c +++ b/linux-user/mips/cpu_loop.c @@ -540,6 +540,12 @@ done_syscall: info.si_code =3D TARGET_ILL_ILLOPC; queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); break; + case EXCP_FPE: + info.si_signo =3D TARGET_SIGFPE; + info.si_errno =3D 0; + info.si_code =3D 0; + queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); + break; /* The code below was inspired by the MIPS Linux kernel trap * handling code in arch/mips/kernel/traps.c. */ --=20 2.7.4