qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-ppc] [PATCH 4/7] ppc: move sdr1 value change detection logic t


From: Paolo Bonzini
Subject: Re: [Qemu-ppc] [PATCH 4/7] ppc: move sdr1 value change detection logic to helper_store_sdr1()
Date: Tue, 20 Jan 2015 16:58:08 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0


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 <address@hidden>
>>> CC: Paolo Bonzini <address@hidden>
>>> ---
>>>  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 <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]