From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46104) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZjJi3-0002kn-JH for qemu-devel@nongnu.org; Tue, 06 Oct 2015 00:18:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZjJi2-0003CJ-Gq for qemu-devel@nongnu.org; Tue, 06 Oct 2015 00:18:39 -0400 Date: Tue, 6 Oct 2015 15:18:56 +1100 From: David Gibson Message-ID: <20151006041856.GJ3861@voom.fritz.box> References: <1442495357-26547-1-git-send-email-david@gibson.dropbear.id.au> <1442495357-26547-8-git-send-email-david@gibson.dropbear.id.au> <5602F585.4000800@redhat.com> <20150923235459.GG15944@voom.fritz.box> <56039F55.6040907@redhat.com> <560F2069.5030902@ozlabs.ru> <5612858A.80907@redhat.com> <20151006032507.GD3861@voom.fritz.box> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="LG0Ll82vYr46+VA1" Content-Disposition: inline In-Reply-To: <20151006032507.GD3861@voom.fritz.box> Subject: Re: [Qemu-devel] [RFC PATCH 07/10] spapr_pci: Allow PCI host bridge DMA window to be configured List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Laurent Vivier , thuth@redhat.com, Michael Roth , Juan Quintela , Alexey Kardashevskiy , gwshan@linux.vnet.ibm.com, qemu-devel@nongnu.org, alex.williamson@redhat.com, qemu-ppc@nongnu.org --LG0Ll82vYr46+VA1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 06, 2015 at 02:25:07PM +1100, David Gibson wrote: > On Mon, Oct 05, 2015 at 04:13:30PM +0200, Paolo Bonzini wrote: > >=20 > >=20 > > On 03/10/2015 02:25, Alexey Kardashevskiy wrote: > > >> I think this is the aim of VMSTATE_UINT64_EQUAL() ? > > >=20 > > > We use it only for things which cannot be set via the command line > > > and ideally there should be no VMSTATE_*_EQUAL. If something can be > > > set via the command line, then the management software (read - > > > libvirt) runs QEMU with explicit parameters to guarantee that these > > > are equal. > >=20 > > VMSTATE_*_EQUAL is used when a value is later used as e.g. the size of > > an array. It basically provides bounds checking for the subsequent > > array, avoiding that an invalid migration file or an error issuing the > > QEMU command on the destination transforms into a buffer overflow. > >=20 > > Michael Roth did most of this work, IIRC. Documenting it in > > docs/migration.txt would be nice. >=20 > Ah.. which means we probably should use VMSTATE_*_EQUAL here since the > window size determines the size of the array of actual TCEs to follow > shortly. Wait.. no we don't. The vmstate for the sPAPRTCETable object which actually holds the IOMMU page table information already has a suitable VMSTATE_*_EQUAL to protect the variable sized array, so we don't need another one here. --=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 --LG0Ll82vYr46+VA1 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWE0uvAAoJEGw4ysog2bOSONYQAN+JDkiXDvhuutHY3P6xdxZj SlpMrpjSwfCyHDzH5gizon5+iF44yIJRoP01f+4L820RRGLXK25T9ls3ZocuGh5r TtqL8Uxd+FdusebP0yXlL07ClDTSy9tg3TiV2FbUhOR0rmBZ+AER6aM0LBPb13uk 9vORqt84jV3NVjhHX8IzzAmObQALL6YWUiHIn6pyklgL1IOcF6flWKjqZWYI4lev nx7K3q3CQ9b7Gs/oYfivZtTomYoIdR+Hvyx0OzB4oMPSS7V13ZFUf72ZcglqvYV9 ZQGx3+7YOwxTvTLF7xQkDi8qoVlfpfcwfy/tXLPlhWEZEAub5pPl1zNRgGzlWG78 AFedkHhVePxxTJXH7KVAh7y/iAYMPKCt2hi6dn9bmVyEHGp9pH6/Div0cDDC5H2E kq/xbcCgxdzEYXUMN5JnBgDWqkK8eZDmPVlfihlf3Ur1GxfHcWEcfdWhbscRmJbr 4lIR119vKwoc0QdBjIF4LjqFr6dkM6fw88O7JsIUYaiZ3lbHKhjLDmMhnOxVjz4d R8kDct1W1p/qIp0+lFRw8XzzMEv4enWYTflEhhq12ubun4bthM8CI6pwgXrXpILF 43nGwm1cyQtxvvpAvidJOe4/W38XIJonvV2uTUKkIDCVxJ/c05KrYwpZYwUoDUTW 3pOiU5M2zA+6ppRE4PJe =RzZg -----END PGP SIGNATURE----- --LG0Ll82vYr46+VA1--