[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCHv3 5/9] target-ppc: force update of msr bits in cpu_p
From: |
Mark Cave-Ayland |
Subject: |
[Qemu-devel] [PATCHv3 5/9] target-ppc: force update of msr bits in cpu_post_load |
Date: |
Mon, 9 Feb 2015 22:40:48 +0000 |
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 <address@hidden>
---
target-ppc/machine.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/target-ppc/machine.c b/target-ppc/machine.c
index c801b82..3921012 100644
--- a/target-ppc/machine.c
+++ b/target-ppc/machine.c
@@ -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;
--
1.7.10.4
- [Qemu-devel] [PATCHv3 0/9] ppc: loadvm/savevm fixups for -M g3beige and -M mac99, Mark Cave-Ayland, 2015/02/09
- [Qemu-devel] [PATCHv3 1/9] macio.c: include parent PCIDevice state in VMStateDescription, Mark Cave-Ayland, 2015/02/09
- [Qemu-devel] [PATCHv3 7/9] openpic: fix up loadvm under -M mac99, Mark Cave-Ayland, 2015/02/09
- [Qemu-devel] [PATCHv3 4/9] target-ppc: move sdr1 value change detection logic to helper_store_sdr1(), Mark Cave-Ayland, 2015/02/09
- [Qemu-devel] [PATCHv3 2/9] adb.c: include ADBDevice parent state in KBDState and MouseState, Mark Cave-Ayland, 2015/02/09
- [Qemu-devel] [PATCHv3 3/9] cuda.c: include adb_poll_timer in VMStateDescription, Mark Cave-Ayland, 2015/02/09
- [Qemu-devel] [PATCHv3 8/9] openpic: switch IRQQueue queue from inline to bitmap, Mark Cave-Ayland, 2015/02/09
- [Qemu-devel] [PATCHv3 5/9] target-ppc: force update of msr bits in cpu_post_load,
Mark Cave-Ayland <=
- [Qemu-devel] [PATCHv3 9/9] openpic: convert to vmstate, Mark Cave-Ayland, 2015/02/09
- [Qemu-devel] [PATCHv3 6/9] openpic: fix segfault on -M mac99 savevm, Mark Cave-Ayland, 2015/02/09
- Re: [Qemu-devel] [Qemu-ppc] [PATCHv3 0/9] ppc: loadvm/savevm fixups for -M g3beige and -M mac99, Mark Cave-Ayland, 2015/02/27