On 20/01/2015 16:23, Mark Cave-Ayland wrote: > On 20/01/15 14:57, Paolo Bonzini wrote: > >> On 23/12/2014 01:36, Mark Cave-Ayland wrote: >>> 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 <mark.cave-ayl...@ilande.co.uk> >>> CC: Paolo Bonzini <pbonz...@redhat.com> >>> --- >>> target-ppc/misc_helper.c | 7 ++++++- >>> target-ppc/mmu_helper.c | 35 +++++++++++++++-------------------- >>> 2 files changed, 21 insertions(+), 21 deletions(-) >>> >>> diff --git a/target-ppc/misc_helper.c b/target-ppc/misc_helper.c >>> index a577b3a..6b12ca8 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); >> >> Possibly stupid question: should this tlb_flush be in ppc_store_sdr1, >> maybe guarded by "if (tcg_enabled())"? >> >> Apart from this, the patch is okay. > > Thanks Paolo. I based this patch upon a comment in a slightly earlier > thread here: > http://lists.gnu.org/archive/html/qemu-devel/2014-12/msg03146.html. > > Is this still relevant or would you still like me to make the change? > This is a little beyond my area of knowledge, but at the very least I > can test any suggested changes under TCG fairly easily.
No big deal, it's really just personal preference and as you saw even that can change easily... Reviewed-by: Paolo Bonzini <pbonz...@redhat.com>