qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 1/2] target-mips: replace cpu_save/cpu_load with


From: Leon Alrae
Subject: Re: [Qemu-devel] [PATCH 1/2] target-mips: replace cpu_save/cpu_load with VMStateDescription
Date: Thu, 19 Feb 2015 10:23:40 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

Hi,

On 18/02/2015 16:59, Andreas Färber wrote:
> Hi Leon,
> 
> Am 18.02.2015 um 15:51 schrieb Leon Alrae:
>> Create VMStateDescription for MIPS CPU. The new structure contains exactly 
>> the
>> same fields as before, therefore leaving existing version_id.
>>
>> Signed-off-by: Leon Alrae <address@hidden>
>> ---
>>  target-mips/cpu-qom.h |   4 +
>>  target-mips/cpu.c     |   1 +
>>  target-mips/cpu.h     |   2 -
>>  target-mips/machine.c | 567 
>> ++++++++++++++++++++++----------------------------
>>  4 files changed, 257 insertions(+), 317 deletions(-)
> [...]
>> diff --git a/target-mips/cpu.c b/target-mips/cpu.c
>> index 98dc94e..cbdc463 100644
>> --- a/target-mips/cpu.c
>> +++ b/target-mips/cpu.c
>> @@ -148,6 +148,7 @@ static void mips_cpu_class_init(ObjectClass *c, void 
>> *data)
>>      cc->do_unassigned_access = mips_cpu_unassigned_access;
>>      cc->do_unaligned_access = mips_cpu_do_unaligned_access;
>>      cc->get_phys_page_debug = mips_cpu_get_phys_page_debug;
>> +    dc->vmsd = &vmstate_mips_cpu;
> 
> This looks wrong. There's two ways to do a CPU VMSD, 1) via dc->vmsd,
> and 2) via cc->vmsd. When going for the new dc->vmsd, the common CPU
> state would need to be referenced from vmstate_mips_cpu below. Doing so
> would break backwards compatibility, so you probably want cc->vmsd,
> causing a separate VMSD for the common parts to be registered.

Ah, I see it now in cpu_exec_init() that vmstate_cpu_common won't get
registered if I set dc->vmsd. Thanks for pointing that out.

Regards,
Leon




reply via email to

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