From 2828c4cd92b1c0590b959ec022888b1f6909949a Mon Sep 17 00:00:00 2001 From: Mark Cave-Ayland Date: Mon, 9 Feb 2015 22:40:47 +0000 Subject: target-ppc: move sdr1 value change detection logic to helper_store_sdr1() Otherwise when cpu_post_load calls ppc_store_sdr1() when restoring a VM snapshot the value is deemed unchanged and so the internal env->htab* variables aren't set correctly. Signed-off-by: Mark Cave-Ayland Reviewed-by: Paolo Bonzini Signed-off-by: Alexander Graf --- target-ppc/misc_helper.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'target-ppc/misc_helper.c') diff --git a/target-ppc/misc_helper.c b/target-ppc/misc_helper.c index a577b3afd1..6b12ca86af 100644 --- a/target-ppc/misc_helper.c +++ b/target-ppc/misc_helper.c @@ -77,8 +77,13 @@ void helper_msr_facility_check(CPUPPCState *env, uint32_t bit, void helper_store_sdr1(CPUPPCState *env, target_ulong val) { + PowerPCCPU *cpu = ppc_env_get_cpu(env); + if (!env->external_htab) { - ppc_store_sdr1(env, val); + if (env->spr[SPR_SDR1] != val) { + ppc_store_sdr1(env, val); + tlb_flush(CPU(cpu), 1); + } } } -- cgit v1.2.3