qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Anthony Liguori <aliguori@us.ibm.com>,
	Juan Quintela <quintela@redhat.com>,
	patches@linaro.org
Subject: [Qemu-devel] [PATCH 0/3] target-arm: convert to VMState, fix bugs
Date: Mon,  8 Apr 2013 15:43:47 +0100	[thread overview]
Message-ID: <1365432230-20028-1-git-send-email-peter.maydell@linaro.org> (raw)

This patch series converts target-arm to doing migration via
a VMState structure, and fixes some minor bugs in migration
of the CPU as well. The bulk of it is a patch Juan sent out
back in the middle of last year
 https://lists.gnu.org/archive/html/qemu-devel/2012-05/msg00550.html
which I have rebased and messed about with somewhat:
 * rebased and fixed conflicts
 * updated to use cpu_class_set_vmsd()
 * updated with new/removed fields since original patch
 * corrected subsection names so vmload doesn't fail
 * changed to use custom VMStateInfo for cpsr rather than
   presave/postload hooks

The last of these was the subject of some discussion when Juan
posted the patch (see URL above for the thread). The fundamental
problem that has to be solved is "how do you deal with cases
where the representation in the in memory struct is not the
same as the on the wire representation?":
(a) Juan's original patch does "write wire format to random dummy
    field in the struct and then clean things up in presave/postload
    hooks".
(b) My patch follows what Alpha, i386 and some devices do: define
    a custom VMStateInfo which reads/writes the wire format and
    does the conversion to/from the struct.
(c) There was a mooted third approach of defining new vmstate macros
    and functionality so you could specify conversion functions for
    a field but leave actual reading and writing of the wire format
    to the core savevm code.

The argument against (b) was that it makes introducing a new
migration wire format harder, but on the other hand it's a year
later and nobody has, and we already have examples of this in
tree so another user is no big deal. So it doesn't seem
to me to merit the effort of actually implementing (c). I've
gone for (b) because I think it's better than (a).

Overall I think the whole series is an improvement over the
separate save/load fields; I'd also like to get this changeover
done before we start having to worry about freezing the ARM
migration format.


Juan Quintela (1):
  target-arm: port ARM CPU save/load to use VMState

Peter Maydell (2):
  target-arm: Add some missing CPU state fields to VMState
  target-arm: Correctly restore FPSCR

 target-arm/cpu-qom.h |    4 +
 target-arm/cpu.c     |    1 +
 target-arm/cpu.h     |    2 -
 target-arm/machine.c |  430 +++++++++++++++++++++++++-------------------------
 4 files changed, 221 insertions(+), 216 deletions(-)

-- 
1.7.9.5

             reply	other threads:[~2013-04-08 14:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-08 14:43 Peter Maydell [this message]
2013-04-08 14:43 ` [Qemu-devel] [PATCH 1/3] target-arm: port ARM CPU save/load to use VMState Peter Maydell
2013-04-08 14:43 ` [Qemu-devel] [PATCH 2/3] target-arm: Add some missing CPU state fields to VMState Peter Maydell
2013-04-08 14:43 ` [Qemu-devel] [PATCH 3/3] target-arm: Correctly restore FPSCR Peter Maydell
2013-04-16 17:42 ` [Qemu-devel] [PATCH 0/3] target-arm: convert to VMState, fix bugs Peter Maydell

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=1365432230-20028-1-git-send-email-peter.maydell@linaro.org \
    --to=peter.maydell@linaro.org \
    --cc=aliguori@us.ibm.com \
    --cc=patches@linaro.org \
    --cc=pbonzini@redhat.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).