From: Aurelien Jarno <aurelien@aurel32.net>
To: qemu-devel@nongnu.org
Cc: Blue Swirl <blauwirbel@gmail.com>,
Aurelien Jarno <aurelien@aurel32.net>,
Richard Henderson <rth@twiddle.net>
Subject: [Qemu-devel] [PATCH] Revert "target-sparc: Make cpu_dst local to OP=2 insns"
Date: Sat, 20 Oct 2012 16:48:28 +0200 [thread overview]
Message-ID: <1350744508-7066-1-git-send-email-aurelien@aurel32.net> (raw)
Commit 5793f2a47e201d251856c7956d6f7907ec0d9f1f causes data corruption
in system mode:
| [....] Synthesizing the initial hotplug events...udevd[291]: timeout: killing 'net.agent' [302]
| udevd[291]: 'net.agent' [302] terminated by signal 9 (Killed)
| udevd[299]: timeout: killing '/sbin/modprobe -b of:NpackagesT<NULL>' [313]
| udevd[301]: timeout: killing '/sbin/modprobe -b of:Nvirtual-memoryT<NULL>' [314]
| udevd[300]: timeout: killing '/sbin/modprobe -b of:NmemoryTmemory' [315]
| udevd[299]: '/sbin/modprobe -b of:NpackagesT<NULL>' [313] terminated by signal 9 (Killed)
| udevd[301]: '/sbin/modprobe -b of:Nvirtual-memoryT<NULL>' [314] terminated by signal 9 (Killed)
| udevd[300]: '/sbin/modprobe -b of:NmemoryTmemory' [315] terminated by signal 9 (Killed)
| udevd[290]: timeout '/sbin/blkid -o udev -p /dev/vda1'
| done.
| [ ok ] Waiting for /dev to be fully populated...done.
| [....] Activating swap...[ 44.814485] Adding 1048568k swap on /dev/vda2. Priority:-1 extents:1 across:1048568k
| done.
| [ 46.619096] EXT4-fs (vda4): re-mounted. Opts: (null)
| [....] Checking root file system...fsck from util-linux 2.20.1
| e2fsck 1.42.5 (29-Jul-2012)
| ext2fs_open2: The ext2 superblock is corrupt
| fsck.ext4: Superblock invalid, trying backup blocks...
| fsck.ext4: The ext2 superblock is corrupt while trying to open /dev/vda4
|
| The superblock could not be read or does not describe a correct ext2
| filesystem. If the device is valid and it really contains an ext2
| filesystem (and not swap or ufs or something else), then the superblock
| is corrupt, and you might try running e2fsck with an alternate superblock:
| e2fsck -b 8193 <device>
|
| fsck died with exit status 8
| udevd[332]: timeout '/sbin/blkid -o udev -p /dev/vda4'
I am not sure it is the real problem, but at least the optimization of
using the destination register as a temporary is wrong when the
instruction might trigger an exception. In that case the result is
written to the destination register while it should have not.
This reverts commit 5793f2a47e201d251856c7956d6f7907ec0d9f1f.
Cc: Blue Swirl <blauwirbel@gmail.com>
Cc: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
target-sparc/translate.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/target-sparc/translate.c b/target-sparc/translate.c
index 4321393..04f3ac4 100644
--- a/target-sparc/translate.c
+++ b/target-sparc/translate.c
@@ -48,7 +48,7 @@ static TCGv cpu_y;
#ifndef CONFIG_USER_ONLY
static TCGv cpu_tbr;
#endif
-static TCGv cpu_cond;
+static TCGv cpu_cond, cpu_dst;
#ifdef TARGET_SPARC64
static TCGv_i32 cpu_xcc, cpu_asi, cpu_fprs;
static TCGv cpu_gsr;
@@ -2525,6 +2525,7 @@ static void disas_sparc_insn(DisasContext * dc, unsigned int insn)
}
opc = GET_FIELD(insn, 0, 1);
+
rd = GET_FIELD(insn, 2, 6);
switch (opc) {
@@ -2633,7 +2634,6 @@ static void disas_sparc_insn(DisasContext * dc, unsigned int insn)
case 2: /* FPU & Logical Operations */
{
unsigned int xop = GET_FIELD(insn, 7, 12);
- TCGv cpu_dst = gen_dest_gpr(dc, rd);
TCGv cpu_tmp0;
if (xop == 0x3a) { /* generate trap */
@@ -5295,9 +5295,13 @@ static inline void gen_intermediate_code_internal(TranslationBlock * tb,
last_pc = dc->pc;
insn = cpu_ldl_code(env, dc->pc);
+ cpu_dst = tcg_temp_new();
+
disas_sparc_insn(dc, insn);
num_insns++;
+ tcg_temp_free(cpu_dst);
+
if (dc->is_br)
break;
/* if the next PC is different, we abort now */
--
1.7.10.4
next reply other threads:[~2012-10-20 14:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-20 14:48 Aurelien Jarno [this message]
2012-10-20 22:48 ` [Qemu-devel] [PATCH] Revert "target-sparc: Make cpu_dst local to OP=2 insns" Richard Henderson
2012-10-20 23:17 ` Aurelien Jarno
2012-10-21 21:29 ` Richard Henderson
2012-10-21 22:25 ` Aurelien Jarno
2012-10-22 22:15 ` Aurelien Jarno
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=1350744508-7066-1-git-send-email-aurelien@aurel32.net \
--to=aurelien@aurel32.net \
--cc=blauwirbel@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/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).