qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Leon Alrae <leon.alrae@imgtec.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL 12/14] target-mips: fix broken snapshotting
Date: Fri, 13 Feb 2015 10:02:10 +0000	[thread overview]
Message-ID: <1423821732-22542-13-git-send-email-leon.alrae@imgtec.com> (raw)
In-Reply-To: <1423821732-22542-1-git-send-email-leon.alrae@imgtec.com>

Recently added CP0.BadInstr and CP0.BadInstrP registers ended up in cpu_load()
under different offset than in cpu_save(). These and all registers between were
incorrectly restored.

Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
---
 target-mips/machine.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/target-mips/machine.c b/target-mips/machine.c
index 0ba7d73..6c76dfb 100644
--- a/target-mips/machine.c
+++ b/target-mips/machine.c
@@ -285,6 +285,10 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id)
     qemu_get_sbe32s(f, &env->CP0_SRSConf4);
     qemu_get_sbe32s(f, &env->CP0_HWREna);
     qemu_get_betls(f, &env->CP0_BadVAddr);
+    if (version_id >= 5) {
+        qemu_get_be32s(f, &env->CP0_BadInstr);
+        qemu_get_be32s(f, &env->CP0_BadInstrP);
+    }
     qemu_get_sbe32s(f, &env->CP0_Count);
     qemu_get_betls(f, &env->CP0_EntryHi);
     qemu_get_sbe32s(f, &env->CP0_Compare);
@@ -319,8 +323,6 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id)
     qemu_get_betls(f, &env->CP0_ErrorEPC);
     qemu_get_sbe32s(f, &env->CP0_DESAVE);
     if (version_id >= 5) {
-        qemu_get_be32s(f, &env->CP0_BadInstr);
-        qemu_get_be32s(f, &env->CP0_BadInstrP);
         for (i = 0; i < MIPS_KSCRATCH_NUM; i++) {
             qemu_get_betls(f, &env->CP0_KScratch[i]);
         }
-- 
2.1.0

  parent reply	other threads:[~2015-02-13 10:03 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-13 10:01 [Qemu-devel] [PULL 00/14] target-mips queue Leon Alrae
2015-02-13 10:01 ` [Qemu-devel] [PULL 01/14] isa: add memory space parameter to isa_bus_new Leon Alrae
2015-02-13 10:02 ` [Qemu-devel] [PULL 02/14] jazz: do not explode QEMUMachineInitArgs structure Leon Alrae
2015-02-13 10:02 ` [Qemu-devel] [PULL 03/14] jazz: remove usage of isa_mem_base Leon Alrae
2015-02-13 10:02 ` [Qemu-devel] [PULL 04/14] mips: remove isa_mem_base usage Leon Alrae
2015-02-13 10:02 ` [Qemu-devel] [PULL 05/14] piix4: use PCI address space instead of system memory Leon Alrae
2015-02-13 10:02 ` [Qemu-devel] [PULL 06/14] gt64xxx: remove isa_mem_base usage Leon Alrae
2015-02-13 10:02 ` [Qemu-devel] [PULL 07/14] isa: remove isa_mem_base variable Leon Alrae
2015-02-13 10:02 ` [Qemu-devel] [PULL 08/14] target-mips: Make CP0.Status.CU1 read-only for the 5Kc and 5KEc processors Leon Alrae
2015-02-13 10:02 ` [Qemu-devel] [PULL 09/14] target-mips: fix detection of the end of the page during translation Leon Alrae
2015-02-13 10:02 ` [Qemu-devel] [PULL 10/14] target-mips: ll and lld cause AdEL exception for unaligned address Leon Alrae
2015-02-13 10:02 ` [Qemu-devel] [PULL 11/14] target-mips: use CP0EnLo_XI instead of magic number Leon Alrae
2015-02-13 10:02 ` Leon Alrae [this message]
2015-02-13 10:02 ` [Qemu-devel] [PULL 13/14] target-mips: pass 0 instead of -1 as rs in microMIPS LUI instruction Leon Alrae
2015-02-13 10:02 ` [Qemu-devel] [PULL 14/14] linux-user: correct stat structure in MIPS N32 Leon Alrae
2015-02-13 13:07 ` [Qemu-devel] [PULL 00/14] target-mips queue Peter Maydell
2015-02-13 13:46   ` Leon Alrae

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=1423821732-22542-13-git-send-email-leon.alrae@imgtec.com \
    --to=leon.alrae@imgtec.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).