From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45936) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQ4Hs-0005bT-9C for qemu-devel@nongnu.org; Sun, 31 Jan 2016 21:32:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aQ4Ho-0006ht-VL for qemu-devel@nongnu.org; Sun, 31 Jan 2016 21:32:20 -0500 Date: Mon, 1 Feb 2016 13:33:09 +1100 From: David Gibson Message-ID: <20160201023309.GD23043@voom.redhat.com> References: <1453340271-7417-1-git-send-email-david@gibson.dropbear.id.au> <20160122110225.2f9ae2d1@nial.brq.redhat.com> <56A23AD1.20202@redhat.com> <20160122153252.0d47355e@nial.brq.redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="EcSFpNr6Vcxykj4g" Content-Disposition: inline In-Reply-To: <20160122153252.0d47355e@nial.brq.redhat.com> Subject: Re: [Qemu-devel] [PATCH] dimm: Correct type of MemoryHotplugState->base List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: Paolo Bonzini , bharata@linux.vnet.ibm.com, qemu-ppc@nongnu.org, qemu-devel@nongnu.org, ehabkost@redhat.com --EcSFpNr6Vcxykj4g Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 22, 2016 at 03:32:52PM +0100, Igor Mammedov wrote: > On Fri, 22 Jan 2016 15:21:05 +0100 > Paolo Bonzini wrote: >=20 > > On 22/01/2016 11:02, Igor Mammedov wrote: > > > On Thu, 21 Jan 2016 12:37:51 +1100 > > > David Gibson wrote: > > > =20 > > >> The 'base' field of MemoryHotplugState is ram_addr_t, which indicate= s that > > >> it exists in the abstract address space of RAM regions. > > >> > > >> However, the actual usage of this field indicates that it is a concr= ete > > >> physical address (it's passed as an offset to memory_region_add_subg= region > > >> for example). > > >> > > >> So, correct its type to 'hwaddr'. > > >> > > >> Signed-off-by: David Gibson > > >> --- > > >> include/hw/mem/pc-dimm.h | 2 +- > > >> 1 file changed, 1 insertion(+), 1 deletion(-) > > >> > > >> diff --git a/include/hw/mem/pc-dimm.h b/include/hw/mem/pc-dimm.h > > >> index d83bf30..218dfb0 100644 > > >> --- a/include/hw/mem/pc-dimm.h > > >> +++ b/include/hw/mem/pc-dimm.h > > >> @@ -77,7 +77,7 @@ typedef struct PCDIMMDeviceClass { > > >> * @mr: hotplug memory address space container > > >> */ > > >> typedef struct MemoryHotplugState { > > >> - ram_addr_t base; > > >> + hwaddr base; > > >> MemoryRegion mr; > > >> } MemoryHotplugState; > > >> =20 > > >=20 > > > I agree with this fix but that's not the only place where > > > ram_addr_t needs to be replaced with hwaddr. > > > For example type of MachineState.[max]ram_size fields needs > > > to be changed as well. Because QEMU builds without CONFIG_XEN_BACKEND > > > on 32-bit hosts are broken since ram_addr_t is 32-bits there > > > while some targets assume and use it as 64-bit one. =20 > >=20 > > But on a 32-bit system without CONFIG_XEN_BACKEND you cannot allocate > > more than 4G anyway, so the choice of ram_addr_t is understandable in > > that case. > QEMU build will probably fail with above config but if it succeeds > then maxmem will be silently truncated. >=20 > >=20 > > On the other hand, on a 32-bit system without CONFIG_XEN_BACKEND you > > definitely can place 128M of hot plugged memory between say 4096MB and > > 4224MB. > True. >=20 > Anyway for this patch > Reviewed-by: Igor Mammedov Who needs to take this patch? I'm not sure if I need to do anything further to push it forwards. --=20 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 --EcSFpNr6Vcxykj4g Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWrsPlAAoJEGw4ysog2bOS0lQP/AoWUOb9RQlqK7mlSpZ3idyo 2HnULmcmonYUjuwHlLm4zqH877FSUHlwgs/Tzabj2qRY2Q6MAirAh1/utiNXI7/S vgGeNdFPI+WxbRtWb/Ei/SOGhwmsRsw3n9WAVEqT6gXOlmRHHzyHQGGZkQic96PN b5nkmqK0ff1S0OFl72LzpdKByOPr16bD8FWH0z51AonuRa8lotoctUNGypUrfqId 9LiyyILCD6swfb/o924OPuSiqFcdiD01uIvAG7tH3WsOEDsC0TqhMN53h2CmWZAu eT3O0sRAQFr+PbhEUrUjAilZ2r8gU9Xf6EYK8hxjZu+u23DzKrG61tFrHuDeuwAN fo/Dwp5N+7vPJawvqr86gad3HPu+f97ahq2I72Q27emZLk/A0gw6qkPMHCnTMNkj heddRgOPPntA0auBhNa1BCtfxI4T26joXTkPSuR1Nw8G3LTyewn7qmJJnKMQEjMm daVcNjiiIpWYB5BEq4Y3X1XfX6sZNV2QHBu7R9pMf7scqCDQ352d4jkFtqbnTmco OdhPBnY1Yf+lZKxD89kEyfdaVUyWnSJmC7YEb/KHnlf6Mr4RrvmTjzZtISL2NtSV Us2OzyB8LHk1Zz8msWf+wddXTiBPmlJoIVol2g384hsOn1lhv4j10oYPSjSiagLz yBCgiZTlFI1UPZg8gOtb =UrnS -----END PGP SIGNATURE----- --EcSFpNr6Vcxykj4g--