qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] target-cris: update CPU state save/load to use


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH] target-cris: update CPU state save/load to use VMStateDescription
Date: Mon, 25 May 2015 17:35:42 +0100

On 25 May 2015 at 16:53, Peter Maydell <address@hidden> wrote:
> From: Juan Quintela <address@hidden>
>
> Update the CRIS CPU state save/load to use a VMStateDescription struct
> rather than cpu_save/cpu_load functions.
>
> Have to define TLBSet struct.
> Multidimensional arrays in C are a mess, just unroll them.
>
> Signed-off-by: Juan Quintela <address@hidden>
> [PMM:
>  * expand commit message a little since it's no longer one patch in
>    a 35-patch series
>  * add header/copyright comment to machine.c; credited copyright is
>    Red Hat and author is Juan, since this commit gives the file all-new
>    contents; license is LGPL-2-or-later, to match other target-cris code
>  * remove hardcoded tab
>  * add fields for locked_irq, interrupt_vector, fault_vector, trap_vector
>  * drop minimum_version_id_old fields
>  * bump version_id to 2 as we are not compatible with old state format
>  * remove unnecessary hw/boards.h include]
> Signed-off-by: Peter Maydell <address@hidden>
> ---
> This is a patch of Juan's from way back in 2012, which I am resurrecting
> because we now have only two CPUs which still use old-style non-VMState
> save/load (CRIS and SPARC). If we can update them both we can drop the
> machinery in the common code which supports this.
>
> Notes:
>  * CPUCRISState indent style is somewhat mismatched (cf load_info);
>    I took the "minimal make checkpatch happy" approach, but am
>    happy to do something else with the line changed here
>  * I have added a copyright header to target-cris/machine.c, because it
>    did not have one at all, and this commit effectively gives the
>    file all-new contents. I have set it up as LGPLv2-or-later,
>    copyright Red Hat, author Juan. Please let me know if you would
>    prefer something else!
>  * I added vmstate entries for four fields which did not previously
>    get saved and restored, which is presumably a bug fix...
>  * vmsave/vmload on the axis-dev88 board does not currently seem to
>    work (among other obvious problems, there is no vmstate support
>    in the interrupt controller), so we're limited to "looks good
>    on code review" here.

Oops, this has a couple of issues I only noticed when I started
looking at the SPARC vmstate:
 * forgot to register vmstate by setting cc->vmsd
 * vmstate should be of CRISCPU, not CPUCRISState

This is why it's a shame the board doesn't have vmsave/load support
for testing.

Will send out a v2.

-- PMM



reply via email to

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