From: Blue Swirl <blauwirbel@gmail.com>
To: Artyom Tarasenko <atar4qemu@googlemail.com>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: [Qemu-devel] Re: sparc32 FPU SP Invalid CEXC Test
Date: Thu, 15 Apr 2010 20:48:59 +0300 [thread overview]
Message-ID: <j2wf43fc5581004151048h67d81fe8r6aa486fa7da083dd@mail.gmail.com> (raw)
In-Reply-To: <l2xfb8d4f71004151039wdb35ec99z3807029b49b9efa3@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 631 bytes --]
On 4/15/10, Artyom Tarasenko <atar4qemu@googlemail.com> wrote:
> 2010/4/15 Artyom Tarasenko <atar4qemu@googlemail.com>:
>
> > One of LX's tests crashes pretty hard, causing qemu abort.
> > I've tried to look how does the execution flow works with -d in_asm.
> > Does the address in the log show the guest's PC register?
>
>
> It's probably sort of a "timing" issue.
>
> Can we check exceptions not just on jumps, but also on floating poit
> operations which may cause a trap?
> These traps are supposed to be syncronous.
Yes, the bug is that PC and NPC are not saved before executing FPU
instructions. Please try this patch.
[-- Attachment #2: 0001-Sparc-fix-PC-NPC-during-FPU-traps.patch --]
[-- Type: text/x-diff, Size: 1350 bytes --]
From 6c7d08b06214337f2b95d865b33c7ca188899fa4 Mon Sep 17 00:00:00 2001
From: Blue Swirl <blauwirbel@gmail.com>
Date: Thu, 15 Apr 2010 17:14:28 +0000
Subject: [PATCH] Sparc: fix PC/NPC during FPU traps
All FPU instructions can trap, so save PC/NPC state before
executing them.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
target-sparc/translate.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/target-sparc/translate.c b/target-sparc/translate.c
index 2c07385..addb1e1 100644
--- a/target-sparc/translate.c
+++ b/target-sparc/translate.c
@@ -2155,6 +2155,7 @@ static void disas_sparc_insn(DisasContext * dc)
rs1 = GET_FIELD(insn, 13, 17);
rs2 = GET_FIELD(insn, 27, 31);
xop = GET_FIELD(insn, 18, 26);
+ save_state(dc, cpu_cond);
switch (xop) {
case 0x1: /* fmovs */
tcg_gen_mov_i32(cpu_fpr[rd], cpu_fpr[rs2]);
@@ -2468,6 +2469,7 @@ static void disas_sparc_insn(DisasContext * dc)
rs1 = GET_FIELD(insn, 13, 17);
rs2 = GET_FIELD(insn, 27, 31);
xop = GET_FIELD(insn, 18, 26);
+ save_state(dc, cpu_cond);
#ifdef TARGET_SPARC64
if ((xop & 0x11f) == 0x005) { // V9 fmovsr
int l1;
--
1.5.6.5
next prev parent reply other threads:[~2010-04-15 17:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-15 16:58 [Qemu-devel] sparc32 FPU SP Invalid CEXC Test Artyom Tarasenko
2010-04-15 17:39 ` [Qemu-devel] " Artyom Tarasenko
2010-04-15 17:48 ` Blue Swirl [this message]
2010-04-15 20:53 ` Artyom Tarasenko
2010-04-16 14:37 ` Artyom Tarasenko
2010-04-20 23:28 ` Artyom Tarasenko
2010-04-21 18:11 ` Blue Swirl
2010-04-21 21:14 ` Artyom Tarasenko
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=j2wf43fc5581004151048h67d81fe8r6aa486fa7da083dd@mail.gmail.com \
--to=blauwirbel@gmail.com \
--cc=atar4qemu@googlemail.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).