All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Leon Alrae <leon.alrae@imgtec.com>, qemu-devel@nongnu.org
Cc: amit.shah@redhat.com, macro@linux-mips.org, aurelien@aurel32.net,
	quintela@redhat.com
Subject: Re: [Qemu-devel] [PATCH 1/2] target-mips: replace cpu_save/cpu_load with VMStateDescription
Date: Wed, 18 Feb 2015 17:59:19 +0100	[thread overview]
Message-ID: <54E4C4E7.9060405@suse.de> (raw)
In-Reply-To: <1424271115-7885-2-git-send-email-leon.alrae@imgtec.com>

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 <leon.alrae@imgtec.com>
> ---
>  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.

Regards,
Andreas

>  #endif
>  
>      cc->gdb_num_core_regs = 73;
[...]
> diff --git a/target-mips/machine.c b/target-mips/machine.c
> index 6c76dfb..8d75962 100644
> --- a/target-mips/machine.c
> +++ b/target-mips/machine.c
> @@ -1,341 +1,278 @@
[...]
> +const VMStateDescription vmstate_mips_cpu = {
> +    .name = "cpu",
> +    .version_id = 5,
> +    .minimum_version_id = 5,
> +    .fields = (VMStateField[]) {
> +        /* active TC */
> +        VMSTATE_STRUCT(env.active_tc, MIPSCPU, 1, vmstate_tc, TCState),
> +
[snip]

-- 
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Jennifer Guild, Dilip Upmanyu,
Graham Norton; HRB 21284 (AG Nürnberg)

  reply	other threads:[~2015-02-18 17:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-18 14:51 [Qemu-devel] [PATCH 0/2] target-mips: port MIPS CPU to VMState Leon Alrae
2015-02-18 14:51 ` [Qemu-devel] [PATCH 1/2] target-mips: replace cpu_save/cpu_load with VMStateDescription Leon Alrae
2015-02-18 16:59   ` Andreas Färber [this message]
2015-02-19 10:23     ` Leon Alrae
2015-02-18 14:51 ` [Qemu-devel] [PATCH 2/2] target-mips: add missing MSA and correct FP in VMState Leon Alrae
2015-02-19 15:43   ` Richard Henderson
2015-02-19 16:43     ` Leon Alrae
2015-02-20 13:12       ` Maciej W. Rozycki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54E4C4E7.9060405@suse.de \
    --to=afaerber@suse.de \
    --cc=amit.shah@redhat.com \
    --cc=aurelien@aurel32.net \
    --cc=leon.alrae@imgtec.com \
    --cc=macro@linux-mips.org \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.