From nobody Sat Apr 20 12:19:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.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 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1523618037386134.6256414584558; Fri, 13 Apr 2018 04:13:57 -0700 (PDT) Received: from localhost ([::1]:44653 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f6weS-0004uu-LV for importer@patchew.org; Fri, 13 Apr 2018 07:13:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45416) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f6wdU-0004VM-09 for qemu-devel@nongnu.org; Fri, 13 Apr 2018 07:12:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f6wdP-0002BG-3R for qemu-devel@nongnu.org; Fri, 13 Apr 2018 07:12:55 -0400 Received: from mail.ispras.ru ([83.149.199.45]:48720) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f6wdO-0002A8-RZ for qemu-devel@nongnu.org; Fri, 13 Apr 2018 07:12:51 -0400 Received: from [127.0.1.1] (unknown [85.142.117.226]) by mail.ispras.ru (Postfix) with ESMTPSA id 486A6540081; Fri, 13 Apr 2018 14:12:48 +0300 (MSK) From: Pavel Dovgalyuk To: qemu-devel@nongnu.org Date: Fri, 13 Apr 2018 14:12:45 +0300 Message-ID: <20180413111245.28627.3415.stgit@pasha-VirtualBox> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 83.149.199.45 Subject: [Qemu-devel] [PATCH] m68: fix exception stack frame for 68000 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: maria.klimushenkova@ispras.ru, dovgaluk@ispras.ru, laurent@vivier.eu, pavel.dovgaluk@ispras.ru Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 68000 CPUs do not save format in the exception stack frame. This patch adds feature checking to prevent format saving for 68000. m68k_ret() already includes this modification, this patch fixes the exception processing function too. Signed-off-by: Pavel Dovgalyuk --- target/m68k/op_helper.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/target/m68k/op_helper.c b/target/m68k/op_helper.c index 3a7f7f2..e367133 100644 --- a/target/m68k/op_helper.c +++ b/target/m68k/op_helper.c @@ -301,8 +301,11 @@ static inline void do_stack_frame(CPUM68KState *env, u= int32_t *sp, cpu_stl_kernel(env, *sp, addr); break; } - *sp -=3D 2; - cpu_stw_kernel(env, *sp, (format << 12) + (cs->exception_index << 2)); + if (m68k_feature(env, M68K_FEATURE_QUAD_MULDIV)) { + /* all except 68000 */ + *sp -=3D 2; + cpu_stw_kernel(env, *sp, (format << 12) + (cs->exception_index << = 2)); + } *sp -=3D 4; cpu_stl_kernel(env, *sp, retaddr); *sp -=3D 2;