]> Git Repo - qemu.git/commitdiff
target-ppc: force update of msr bits in cpu_post_load
authorMark Cave-Ayland <[email protected]>
Mon, 9 Feb 2015 22:40:48 +0000 (22:40 +0000)
committerAlexander Graf <[email protected]>
Mon, 9 Mar 2015 14:00:05 +0000 (15:00 +0100)
Since env->msr has already been restored by the time cpu_post_load is called,
make sure that ppc_store_msr() is explicitly called with all msr bits except
MSR_TGPR marked as invalid.

This solves the issue where MSR flags aren't set correctly when restoring a VM
snapshot, in particular the internal env->excp_prefix value when MSR_EP has
been altered by a guest.

Signed-off-by: Mark Cave-Ayland <[email protected]>
Signed-off-by: Alexander Graf <[email protected]>
target-ppc/machine.c

index c801b822c905c752b109627f95a1d9080fb2c8b7..392101206366466f159cbdc76c08ae64a2f5f6a3 100644 (file)
@@ -159,6 +159,7 @@ static int cpu_post_load(void *opaque, int version_id)
     PowerPCCPU *cpu = opaque;
     CPUPPCState *env = &cpu->env;
     int i;
+    target_ulong msr;
 
     /*
      * We always ignore the source PVR. The user or management
@@ -190,7 +191,12 @@ static int cpu_post_load(void *opaque, int version_id)
         /* Restore htab_base and htab_mask variables */
         ppc_store_sdr1(env, env->spr[SPR_SDR1]);
     }
-    hreg_compute_hflags(env);
+
+    /* Mark msr bits except MSR_TGPR invalid before restoring */
+    msr = env->msr;
+    env->msr ^= ~(1ULL << MSR_TGPR);
+    ppc_store_msr(env, msr);
+
     hreg_compute_mem_idx(env);
 
     return 0;
This page took 0.026375 seconds and 4 git commands to generate.