From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50445) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afzRp-0006he-W3 for qemu-devel@nongnu.org; Tue, 15 Mar 2016 20:36:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1afzRm-0001RH-OQ for qemu-devel@nongnu.org; Tue, 15 Mar 2016 20:36:25 -0400 Received: from ozlabs.org ([103.22.144.67]:57932) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afzRl-0001Po-T1 for qemu-devel@nongnu.org; Tue, 15 Mar 2016 20:36:22 -0400 Date: Wed, 16 Mar 2016 11:37:25 +1100 From: David Gibson Message-ID: <20160316003725.GN9032@voom> References: <1458011856-44711-1-git-send-email-aik@ozlabs.ru> <20160315120103.GA11728@work-vm> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Vxa5joy26gVGOrvU" Content-Disposition: inline In-Reply-To: <20160315120103.GA11728@work-vm> Subject: Re: [Qemu-devel] [PATCH qemu] vmstate: Define VARRAY with VMS_ALLOC List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert" Cc: Alexey Kardashevskiy , qemu-devel@nongnu.org, Juan Quintela --Vxa5joy26gVGOrvU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Mar 15, 2016 at 12:01:04PM +0000, Dr. David Alan Gilbert wrote: > * Alexey Kardashevskiy (aik@ozlabs.ru) wrote: > > This allows dynamic allocation for migrating arrays. > >=20 > > Already existing VMSTATE_VARRAY_UINT32 requires an array to be > > pre-allocated, however there are cases when the size is not known in > > advance and there is no real need to enforce it. > >=20 > > This defines another variant of VMSTATE_VARRAY_UINT32 with WMS_ALLOC > > flag which tells the receiving side to allocate memory for the array > > before receiving the data. > >=20 > > The first user of it is the "pseries" machine (POWER8) with > > dynamic DMA windows which existence and size are totally dynamic. >=20 > You say totally dynamic, how big do they get out of interest? They're basically used to map all guest RAM. Typically we'd be looking at one 64-bit TCE per 64K guest page, so we'd be looking at 1/8192th of RAM size. Since we can in theory have guests in the 1T+ range, that might start getting pretty big, so we probably should look at incremental transfer of the TCE tables at some point. >=20 > Dave >=20 > >=20 > > Signed-off-by: Alexey Kardashevskiy > > Reviewed-by: David Gibson > > Reviewed-by: Thomas Huth > > --- > >=20 > >=20 > > As David suggested, I am posting it alone (separately from the DDW patc= hset). > >=20 > > It would be nice either to get "ack" to get this pulled via the powerpc > > tree or get it pulled to the upstream via some other tree. Thanks! > >=20 > >=20 > >=20 > > --- > > include/migration/vmstate.h | 10 ++++++++++ > > 1 file changed, 10 insertions(+) > >=20 > > diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h > > index 84ee355..1622638 100644 > > --- a/include/migration/vmstate.h > > +++ b/include/migration/vmstate.h > > @@ -386,6 +386,16 @@ extern const VMStateInfo vmstate_info_bitmap; > > .offset =3D vmstate_offset_pointer(_state, _field, _type), = \ > > } > > =20 > > +#define VMSTATE_VARRAY_UINT32_ALLOC(_field, _state, _field_num, _versi= on, _info, _type) {\ > > + .name =3D (stringify(_field)), = \ > > + .version_id =3D (_version), = \ > > + .num_offset =3D vmstate_offset_value(_state, _field_num, uint32_t)= ,\ > > + .info =3D &(_info), = \ > > + .size =3D sizeof(_type), = \ > > + .flags =3D VMS_VARRAY_UINT32|VMS_POINTER|VMS_ALLOC, = \ > > + .offset =3D vmstate_offset_pointer(_state, _field, _type), = \ > > +} > > + > > #define VMSTATE_VARRAY_UINT16_UNSAFE(_field, _state, _field_num, _vers= ion, _info, _type) {\ > > .name =3D (stringify(_field)), = \ > > .version_id =3D (_version), = \ --=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 --Vxa5joy26gVGOrvU Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJW6KrFAAoJEGw4ysog2bOScNwP/2LJu6T5eSoYyd3AeBAf2vSs 2kL/VpHSnRedcC4Czgi6uzYF5FdFwAfKPEyK+jC0GESiD3HK9/+fJnUgA9nvZBlZ PDS6Ma4xDcko27XqmgIAPcryTliLZrUNoQZXM6mOy5Gk5qaxy/j1md6Fb2q+L9/5 i/GixD6kNZAZMZ7NA2U9p2egMxDgCvmwTDQc1gM7vQevqy3MSwYstZR3jKH+qX0c 9igaY7myewbNrOHpyvS+mIH1Z1laSB2YMoWNWtJdQ4N//q/AbV5rygD3Zc7T9baY Vp7Eoi488BSn5qqtLQgNEM8H/TopjZG38xybWEkuEurKIbJgditaCyahV5lOt0Ey fNYyLA9yFvkiwu/rQ7UJmov4GxX7I7PZld19dbiZ8NnlOu6WMS1apPFKTw0bkRIi oDfCwP+RV1Fd68gNI93Cqnb347Ivj+wd1RWFkb2odLk3uoqzWUyNPxkONGekiGpr VrUAM0vp5/c8cjBBenkBMlJJnG2q97m5hSTigmZ70g/5zd7ghEdUvpXhJDmsgLW6 ikp+iLX7e1y39xuueSlZ2kDkKvd4MvwHtIyVwSYQ4Ug+XNCUGAmYJDQd8bg3lfLK +L++VaOqrMMmV2qICdUp7B8IsrF+dMHYCPgrA9IOHYgOdrkviefDK7nlJyDoUkXN FMTE87N+JCmnyQH2BAjg =YaYi -----END PGP SIGNATURE----- --Vxa5joy26gVGOrvU--