qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] pseries-2.6 migration from QEMU-2.6 to QEMU-2.7 broken


From: Paolo Bonzini
Subject: Re: [Qemu-devel] pseries-2.6 migration from QEMU-2.6 to QEMU-2.7 broken
Date: Thu, 22 Sep 2016 12:32:24 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0


On 22/09/2016 12:04, Benjamin Herrenschmidt wrote:
> On Thu, 2016-09-22 at 14:34 +0530, Nikunj A Dadhania wrote:
>> Something like this works for KVM:
>>
>> diff --git a/target-ppc/machine.c b/target-ppc/machine.c
>> index 4820f22..1cf3779 100644
>> --- a/target-ppc/machine.c
>> +++ b/target-ppc/machine.c
>> @@ -563,8 +563,8 @@ const VMStateDescription vmstate_ppc_cpu = {
>>  
>>          /* Sanity checking */
>>          VMSTATE_UINTTL_EQUAL(env.msr_mask, PowerPCCPU),
>> -        VMSTATE_UINT64_EQUAL(env.insns_flags, PowerPCCPU),
>> -        VMSTATE_UINT64_EQUAL(env.insns_flags2, PowerPCCPU),
>> +        VMSTATE_UNUSED(sizeof(target_ulong)), /* was 
>> _EQUAL(env.insns_flags) */
>> +        VMSTATE_UNUSED(sizeof(target_ulong)), /* was 
>> _EQUAL(env.insns_flags2) */
>>          VMSTATE_UINT32_EQUAL(env.nb_BATs, PowerPCCPU),
>>          VMSTATE_END_OF_LIST()
>>      },
>>
>> TCG migration still remains broken with this.
> 
> Can we have conditionally present flags and a post-load that does some
> matching ?

Yes, you can use something like

        VMSTATE_UINT64(env.src_insns_flags, PowerPCCPU),
        VMSTATE_UINT64(env.src_insns_flags2, PowerPCCPU),

and a post_load that compares them if kvm_enabled() only.

*However* a better fix would be to preserve the old flags for
pseries-2.6, and only set the newer flags for pseries-2.7.  I'm not
saying you have to do this, but if it's not hard (no idea) why not learn
how to do it right.

The design is not stupid, it's just that compatibility is harder than
you think and you are going through the same learning experiences that
x86 went though.

Paolo



reply via email to

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