qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <dwg@au1.ibm.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: blauwirbel@gmail.com, aliguori@us.ibm.com, qemu-devel@nongnu.org,
	quintela@redhat.com
Subject: Re: [Qemu-devel] [PATCH 4/7] savevm: Add VMSTATE_ helpers for target_phys_addr_t
Date: Tue, 9 Oct 2012 23:53:17 +1100	[thread overview]
Message-ID: <20121009125317.GD5798@truffula.fritz.box> (raw)
In-Reply-To: <CAFEAcA_kOSgueto4H+WL6J4dF3CFiz+fPHqBmdqOPZQ+7cSZ4Q@mail.gmail.com>

On Tue, Oct 09, 2012 at 09:03:21AM +0100, Peter Maydell wrote:
> On 9 October 2012 05:53, David Gibson <david@gibson.dropbear.id.au> wrote:
> > The savevm code contains VMSTATE_ helpers for a number of commonly used
> > types, but not for target_phys_addr_t.  This patch fixes that deficiency
> > implementing VMSTATE_TPA helpers in terms of VMSTATE_UINT32 or
> > VMSTATE_UINT64 helpers as appropriate.
> 
> (This comment is out of date...)

Ah, yes.

> Traditionally we have deliberately not had any vmstate helpers
> for target_phys_addr_t because the meaning of that type is "a
> type wide enough to hold the widest address in use in the system".
> vmstate fields, on the other hand, are for the state of a specific
> device model, and a particular device's registers are always a
> fixed width. Even if a pci card model is plugged into a system
> with 64 bit PCI addresses, if the chip on the card itself only
> has 32 bit wide registers controlling DMA those registers need
> to be uint32_t. So if you think you need to put target_phys_addr_t
> into a vmstate the chances are you don't. I think this logic
> should still hold even now we have made target_phys_addr_t
> 64 bits for every platform.
> 
> What was the problem this patch is trying to fix?

Well, the place I've used this (in patches yet to be posted) is saving
the state of the pseries machine itself.  Specifically, I use
VMSTATE_TPA_EQUAL to sanity check that the restored machine has the
same ram size as the saved machine.  In this case the variable is qemu
internal information and represents a ram size, so I think
target_phys_addr_t is the correct type here.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

  reply	other threads:[~2012-10-09 12:59 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-09  4:53 [Qemu-devel] [0/7] vmstate extensions David Gibson
2012-10-09  4:53 ` [Qemu-devel] [PATCH 1/7] savevm: Add VMSTATE_UINT64_EQUAL helpers David Gibson
2012-10-09  4:53 ` [Qemu-devel] [PATCH 2/7] savevm: Add VMSTATE_UINTTL_EQUAL helper David Gibson
2012-10-09  4:53 ` [Qemu-devel] [PATCH 3/7] savevm: Add VMSTATE_FLOAT64 helpers David Gibson
2012-10-09  4:53 ` [Qemu-devel] [PATCH 4/7] savevm: Add VMSTATE_ helpers for target_phys_addr_t David Gibson
2012-10-09  8:03   ` Peter Maydell
2012-10-09 12:53     ` David Gibson [this message]
2012-10-09 16:24       ` Peter Maydell
2012-10-10  0:17         ` David Gibson
2012-10-11  1:57           ` David Gibson
2012-10-11 15:07             ` Peter Maydell
2012-10-12  0:35               ` David Gibson
2012-10-09  4:53 ` [Qemu-devel] [PATCH 5/7] savevm: Add VMSTATE_STRUCT_VARRAY_POINTER_UINT32 David Gibson
2012-10-09  4:53 ` [Qemu-devel] [PATCH 6/7] savevm: Fix bugs in the VMSTATE_VBUFFER_MULTIPLY definition David Gibson
2012-10-09  4:53 ` [Qemu-devel] [PATCH 7/7] savevm: Implement VMS_DIVIDE flag David Gibson

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=20121009125317.GD5798@truffula.fritz.box \
    --to=dwg@au1.ibm.com \
    --cc=aliguori@us.ibm.com \
    --cc=blauwirbel@gmail.com \
    --cc=peter.maydell@linaro.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 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).