All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
To: qemu-devel@nongnu.org
Cc: maria.klimushenkova@ispras.ru, dovgaluk@ispras.ru,
	laurent@vivier.eu, pavel.dovgaluk@ispras.ru
Subject: [Qemu-devel] [PATCH] m68: fix exception stack frame for 68000
Date: Fri, 13 Apr 2018 14:12:45 +0300	[thread overview]
Message-ID: <20180413111245.28627.3415.stgit@pasha-VirtualBox> (raw)

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 <Pavel.Dovgaluk@ispras.ru>
---
 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, uint32_t *sp,
         cpu_stl_kernel(env, *sp, addr);
         break;
     }
-    *sp -= 2;
-    cpu_stw_kernel(env, *sp, (format << 12) + (cs->exception_index << 2));
+    if (m68k_feature(env, M68K_FEATURE_QUAD_MULDIV)) {
+        /*  all except 68000 */
+        *sp -= 2;
+        cpu_stw_kernel(env, *sp, (format << 12) + (cs->exception_index << 2));
+    }
     *sp -= 4;
     cpu_stl_kernel(env, *sp, retaddr);
     *sp -= 2;

             reply	other threads:[~2018-04-13 11:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-13 11:12 Pavel Dovgalyuk [this message]
2018-04-13 12:43 ` [Qemu-devel] [PATCH] m68: fix exception stack frame for 68000 Laurent Vivier
2018-04-13 13:12   ` Pavel Dovgalyuk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180413111245.28627.3415.stgit@pasha-VirtualBox \
    --to=pavel.dovgaluk@ispras.ru \
    --cc=dovgaluk@ispras.ru \
    --cc=laurent@vivier.eu \
    --cc=maria.klimushenkova@ispras.ru \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.