From nobody Mon Sep 28 01:11:52 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1786109294; cv=none; d=zohomail.com; s=zohoarc; b=NMVTbl7itSxFAOMRpiqs6chDWMJotls2PcnjSzrimBZl3DAJCCiqaQ1kmAvp1GZpwC6GltdwCUoMxutI7qBRoeHTMQDh46Go3hIWVYCaRLMtC0XAISUEEll98B71Z3US2An+J0meikYtmOxZPKbzYoVzuhUXhyTuMtW/uaRdnnk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1786109294; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=MXiSPGD6+09XxF16dgSei5RtIuqDo4QIh9rc7D6E5Q8=; b=Rc+Te0aM04CWdMy0B39SMINJBF0h0a5331Erxk8PibJxdBNFwUxDKzMSCoN60uZAi9CMYB7EEYrImN3Vkpb6IzTiC3dnGnVg+HhNCcwlustkXnZqKKAMUE4tRRwlDohybU++sSbPExm0eN/aE7E7a/NDyyoesPQf98a3boYujj8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1786109294535348.03564554584614; Fri, 7 Aug 2026 06:28:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wsKbP-00018a-LQ; Fri, 07 Aug 2026 09:27:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wsKbF-00014j-Up for qemu-devel@nongnu.org; Fri, 07 Aug 2026 09:27:03 -0400 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wsKbE-0007gu-2I for qemu-devel@nongnu.org; Fri, 07 Aug 2026 09:27:01 -0400 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 14CE9415DD; Fri, 7 Aug 2026 13:26:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 37F961F000E9; Fri, 7 Aug 2026 13:26:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1786109218; bh=MXiSPGD6+09XxF16dgSei5RtIuqDo4QIh9rc7D6E5Q8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=B7da/mpnvi/TrldIjL10DqVf/hZSwsJZZWsKapr7wNxQ1/sXKi/uBWtnlSwcYSu9v uEtjdQxezdAi884pEe6HrilcopKZEAy9lkMCg+zeRdt/gpK/h8OeX2tSVkM9gLnuvx 7eT3Q+/n346ZMUNYCoOkkQxDtJvrEQ6Mc7ehsmBEnvajO/lYji5qiDhLj8vygl8e6O G6j3qtxp9rBIVI5ijjgRFN+aUtKC8240jR4Fal3NFDb8ZeHO1+DBIR8OGxdnn30BI0 E7zqg8EyYP6ZHru6Dnfq1oFSOL+MbwJ24VtbTFTrFIyOEWXEctcxDupQegQhHb0zOe eLuEx73Qg//xQ== From: Helge Deller To: qemu-devel@nongnu.org, Stefan Hajnoczi Cc: Pierrick Bouvier , deller@gmx.de, Laurent Vivier , Mikulas Patocka , Yoshinori Sato , Richard Henderson Subject: [PULL 1/3] linux-user/sh4: Deliver SIGILL on invalid instruction Date: Fri, 7 Aug 2026 15:26:50 +0200 Message-ID: <20260807132652.9687-2-deller@kernel.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260807132652.9687-1-deller@kernel.org> References: <20260807132652.9687-1-deller@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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=lists1p.gnu.org; Received-SPF: pass client-ip=2600:3c0a:e001:78e:0:1991:8:25; envelope-from=deller@kernel.org; helo=sea.source.kernel.org X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.238, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1786109295962158500 Content-Type: text/plain; charset="utf-8" From: Mikulas Patocka On invalid instruction, deliver SIGILL rather than crashing the whole process unconditionally. Cc: qemu-stable@nongnu.org Signed-off-by: Mikulas Patocka Reviewed-by: Yoshinori Sato Reviewed-by: Richard Henderson Signed-off-by: Helge Deller --- linux-user/sh4/cpu_loop.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/linux-user/sh4/cpu_loop.c b/linux-user/sh4/cpu_loop.c index ee2958d0d9..0815b9c9bf 100644 --- a/linux-user/sh4/cpu_loop.c +++ b/linux-user/sh4/cpu_loop.c @@ -64,6 +64,13 @@ void cpu_loop(CPUSH4State *env) cpu_exec_step_atomic(cs); arch_interrupt =3D false; break; + case 0x180: + /* Illegal instruction */ + /* fallthrough */ + case 0x1a0: + /* Illegal instruction in delay slot */ + force_sig_fault(TARGET_SIGILL, TARGET_ILL_ILLOPC, env->pc); + break; default: fprintf(stderr, "Unhandled trap: 0x%x\n", trapnr); cpu_dump_state(cs, stderr, 0); --=20 2.54.0 From nobody Mon Sep 28 01:11:52 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1786109247; cv=none; d=zohomail.com; s=zohoarc; b=OhE2m/uqZUA8pFCVuCimSMRBXHNQCguxNlyuHjk2WNcTV/7GDxaliKruVhSQ6kyu99WcEKV8NWsNB9jggLBF23I4i2Wuude2fmC5pnfWavafJ4qRtT2PEppnLDRzBHecOHOkoq9sAtP9C8n/gjDzY1Jwpp2FiaaaWo2NDa+yEU8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1786109247; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=wiInlw6k2zYuD+YRAQqnhjA7W0hWpiLsPyptXCDVL9g=; b=Ev7rryXQo5orfxRf3QFpY9rV9LfRcfgWdv86p/OlvhZ+GFdTG4oImCp+Zgda2B8eJISWNTuS7JXUob0TEX6Vus3ycRMxdhiNnYTBh5KTjAbgly020xXXjY0ks2OXcoiRrZalxnzFU5SiYo3mpowRj149nrZSpv2yvxOIooNBeTU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1786109247801663.0699327043834; Fri, 7 Aug 2026 06:27:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wsKbX-0001BJ-E2; Fri, 07 Aug 2026 09:27:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wsKbH-00014x-8O for qemu-devel@nongnu.org; Fri, 07 Aug 2026 09:27:03 -0400 Received: from tor.source.kernel.org ([172.105.4.254]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wsKbF-0007hD-Q2 for qemu-devel@nongnu.org; Fri, 07 Aug 2026 09:27:03 -0400 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 46ED0600D8; Fri, 7 Aug 2026 13:27:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 677921F000E9; Fri, 7 Aug 2026 13:26:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1786109220; bh=wiInlw6k2zYuD+YRAQqnhjA7W0hWpiLsPyptXCDVL9g=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=mFb5Fkq3+TPxgUTK5VotPSnE15t63Py5ssGRRhh3m432n7u1D9FGP2K4xMb1bqeHz qWQus/uyjUquFGOmvUs4dtT6LY0JUhnhysEC3oVbC49+dGkiyDiwD1odzEmhVTV1Xl U3+8eJo4p6unx890eol7Qx88zTEGjbd7qWMVRoTQV2jyXWN05iqhAHHhJqXfor3Nb3 dUwzhINuKp7fB8+xIgcOIB/HTbcJpAHDtf71hnu9ENLg+CJI8e9duV953pHOKFqw6V veQyJuSQns8ObRucZsahtspl9H0ApDc6GiYMnMSY4lmBXeR2x8YSl6ZfRMueWbfjjS Kcz5Oe/cCpRGg== From: Helge Deller To: qemu-devel@nongnu.org, Stefan Hajnoczi Cc: Pierrick Bouvier , deller@gmx.de, Laurent Vivier , Mikulas Patocka , Yoshinori Sato Subject: [PULL 2/3] linux-user/sh4: Initialize the FPSCR register on signal Date: Fri, 7 Aug 2026 15:26:51 +0200 Message-ID: <20260807132652.9687-3-deller@kernel.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260807132652.9687-1-deller@kernel.org> References: <20260807132652.9687-1-deller@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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=lists1p.gnu.org; Received-SPF: pass client-ip=172.105.4.254; envelope-from=deller@kernel.org; helo=tor.source.kernel.org X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.238, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1786109249562158500 Content-Type: text/plain; charset="utf-8" From: Mikulas Patocka On the SH4 architecture, the instructions that perform single precision and double precision floating point operations are encoded in the same way. The bit PR in the FPSCR register determines if the CPU performs single or double operation. According to the ABI, the PR bit must be set at function entry and function exit. GCC generates code that flips this bit as needed during function execution. If we get a signal, we must set the PR bit, so that the signal handler finds the bit in the expected state. Qemu lacked this logic, so that if the signal interrupts single-precision floating point calculation, the PR bit would be incorrectly clear at signal handler entry. If the signal handler performed some floating-point calculation, it would get incorrect result. This patch fixes the bug, by initializing the FPSCR register at signal entry. Note that we initialize the whole register, because the Linux kernel initializes the whole register too. Cc: qemu-stable@nongnu.org Signed-off-by: Mikulas Patocka Reviewed-by: Yoshinori Sato Signed-off-by: Helge Deller --- linux-user/sh4/signal.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/linux-user/sh4/signal.c b/linux-user/sh4/signal.c index 00290d6e40..7f246e750d 100644 --- a/linux-user/sh4/signal.c +++ b/linux-user/sh4/signal.c @@ -206,6 +206,8 @@ void setup_frame(int sig, struct target_sigaction *ka, __put_user(set->sig[i + 1], &frame->extramask[i]); } =20 + regs->fpscr =3D FPSCR_PR; + /* Set up to return from userspace. If provided, use a stub already in userspace. */ if (ka->sa_flags & TARGET_SA_RESTORER) { @@ -258,6 +260,8 @@ void setup_rt_frame(int sig, struct target_sigaction *k= a, __put_user(set->sig[i], &frame->uc.tuc_sigmask.sig[i]); } =20 + regs->fpscr =3D FPSCR_PR; + /* Set up to return from userspace. If provided, use a stub already in userspace. */ if (ka->sa_flags & TARGET_SA_RESTORER) { --=20 2.54.0 From nobody Mon Sep 28 01:11:53 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1786109305; cv=none; d=zohomail.com; s=zohoarc; b=NL7bjpyqZKVyWSxFMHJR9n9uwK5b7a4/g43U0BIvNG6eLGBzkjIiVwcZgpKsAXplZC/4IPdLISD7WSWBR9xUEB+YLbojjknviJ9OMOXXBEtbBziaWhZ4+wTtBRgfFa9Qo7H45POBJ3IwvsMv2sMMGiAjrZzG42k7VJGahBeEwmM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1786109305; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=RrMYKTvmx3jhoSITMt71yGt3H0mvNwE3sRAvOwuYlR4=; b=hhyPuzW5WucpJvwFmgP0KgaJ/YYKKJVWmnLOQfDhGvUEx6M2iLu4c7TrNOWxyzAOcim+WdXF8fDSpIIDswK59zUrf0NcPIEtCydce9sKPmBh3xSxZUtiJatW5nCfMUlxZ/iQKosblQ2fFlF94Y0kS2xCyprJIC+MnpmZvgLv3CY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1786109305108616.0023795243028; Fri, 7 Aug 2026 06:28:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wsKbP-00018z-Qy; Fri, 07 Aug 2026 09:27:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wsKbI-00015x-IB for qemu-devel@nongnu.org; Fri, 07 Aug 2026 09:27:07 -0400 Received: from sea.source.kernel.org ([172.234.252.31]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wsKbH-0007hU-43 for qemu-devel@nongnu.org; Fri, 07 Aug 2026 09:27:04 -0400 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 1EC8A436BB; Fri, 7 Aug 2026 13:27:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6D2E61F000E9; Fri, 7 Aug 2026 13:27:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1786109222; bh=RrMYKTvmx3jhoSITMt71yGt3H0mvNwE3sRAvOwuYlR4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=BJf3f3Pn5XgXBhC9xNcfpoSY5oK7aNsvKZGkwNSLflG79JfV8IbLVkv3FlWpfSdrM ypW7MOdsQRCwI14wQxn2c89j1snzyBBADY+3UmDU3jkbCnVoTXJxCMAEbGbwHR4rT8 kZlBB4nIzlrV1N5XsZfGXqcr7rB4rM3LeA2XxdYIoq1Gd3sGz6ME+ArfuU54oRzjeS 6J6pLjvdGkGu1LHOkJ4OMgJ/4m9osfJb3zlzbmKwl9azz4xdD20QcXPexKatlr7VDk Wh+uouM8eMTAmHAI5cRGEGnbTIPPgbcVjyq+vQL4DlgS9cnjPjbi+6/+1dtPA7Mcdw /+LbruHq7UJ7g== From: Helge Deller To: qemu-devel@nongnu.org, Stefan Hajnoczi Cc: Pierrick Bouvier , deller@gmx.de, Laurent Vivier , Mikulas Patocka , Yoshinori Sato Subject: [PULL 3/3] linux-user/sh4: Fix crashes on signal delivery in conditional delay slot Date: Fri, 7 Aug 2026 15:26:52 +0200 Message-ID: <20260807132652.9687-4-deller@kernel.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260807132652.9687-1-deller@kernel.org> References: <20260807132652.9687-1-deller@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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=lists1p.gnu.org; Received-SPF: pass client-ip=172.234.252.31; envelope-from=deller@kernel.org; helo=sea.source.kernel.org X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.238, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1786109305719158500 Content-Type: text/plain; charset="utf-8" From: Mikulas Patocka If we get a signal in the delay slot, we must roll-back the PC to the jump instruction. This was already fixed by the commit 3b894b699c9a ("linux-user/sh4: Fix crashes on signal delivery"), however this fix omits a test for TB_FLAG_DELAY_SLOT_COND. TB_FLAG_DELAY_SLOT_COND is set by the conditional delayed branches bf/s and bt/s. Qemu did not roll-back the PC in this case, resulting in incorrect program execution. This patch fixes it. Cc: qemu-stable@nongnu.org Signed-off-by: Mikulas Patocka Reviewed-by: Yoshinori Sato Signed-off-by: Helge Deller --- linux-user/sh4/signal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/sh4/signal.c b/linux-user/sh4/signal.c index 7f246e750d..047174ac8f 100644 --- a/linux-user/sh4/signal.c +++ b/linux-user/sh4/signal.c @@ -109,7 +109,7 @@ static void unwind_gusa(CPUSH4State *regs) the SP, otherwise we would be pushing the signal context to invalid memory. */ regs->gregs[15] =3D regs->gregs[1]; - } else if (regs->flags & TB_FLAG_DELAY_SLOT) { + } else if (regs->flags & (TB_FLAG_DELAY_SLOT | TB_FLAG_DELAY_SLOT_COND= )) { /* If we are in a delay slot, push the previous instruction. */ regs->pc -=3D 2; } --=20 2.54.0