From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:53094) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TLZOk-0007w3-EX for qemu-devel@nongnu.org; Tue, 09 Oct 2012 08:59:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TLZOg-0001po-1U for qemu-devel@nongnu.org; Tue, 09 Oct 2012 08:58:58 -0400 Received: from e23smtp07.au.ibm.com ([202.81.31.140]:48680) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TLZOf-0001p7-Fn for qemu-devel@nongnu.org; Tue, 09 Oct 2012 08:58:53 -0400 Received: from /spool/local by e23smtp07.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 9 Oct 2012 22:55:57 +1000 Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay04.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q99Cn1Er32964626 for ; Tue, 9 Oct 2012 23:49:03 +1100 Received: from d23av01.au.ibm.com (loopback [127.0.0.1]) by d23av01.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q99Cwe1M023942 for ; Tue, 9 Oct 2012 23:58:41 +1100 Date: Tue, 9 Oct 2012 23:53:17 +1100 From: David Gibson Message-ID: <20121009125317.GD5798@truffula.fritz.box> References: <1349758412-5559-1-git-send-email-david@gibson.dropbear.id.au> <1349758412-5559-5-git-send-email-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH 4/7] savevm: Add VMSTATE_ helpers for target_phys_addr_t List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: blauwirbel@gmail.com, aliguori@us.ibm.com, qemu-devel@nongnu.org, quintela@redhat.com On Tue, Oct 09, 2012 at 09:03:21AM +0100, Peter Maydell wrote: > On 9 October 2012 05:53, David Gibson 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