From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34504) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YBala-00063h-7O for qemu-devel@nongnu.org; Wed, 14 Jan 2015 22:06:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YBalW-0002WX-6Z for qemu-devel@nongnu.org; Wed, 14 Jan 2015 22:06:38 -0500 Date: Thu, 15 Jan 2015 12:38:52 +1100 From: David Gibson Message-ID: <20150115013852.GD5297@voom.fritz.box> References: <1421202819-19860-1-git-send-email-david@gibson.dropbear.id.au> <20150114172310.20117.41933@loki> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="rqzD5py0kzyFAOWN" Content-Disposition: inline In-Reply-To: <20150114172310.20117.41933@loki> Subject: Re: [Qemu-devel] [PATCH] pseries: Limit PCI host bridge "index" value List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Roth Cc: aik@ozlabs.ru, agraf@suse.de, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, mdroth@us.ibm.com, pbonzini@redhat.com --rqzD5py0kzyFAOWN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 14, 2015 at 11:23:10AM -0600, Michael Roth wrote: > Quoting David Gibson (2015-01-13 20:33:39) > > pseries guests can have large numbers of PCI host bridges. To avoid the > > user having to specify a number of different configuration values for e= very > > one, the device supports an "index" property which is a shorthand setti= ng > > the various window and configuration addresses from a predefined sensib= le > > set. > >=20 > > There are some problems with the details at present: > > * The "index" propery is signed, but negative values will create PCI > > windows below where we expect, potentially colliding with other devices > > * No limit is imposed on the "index" property and large values can > > translate to extremely large window addresses. With PCI passthrough in > > particular this can mean we exceed various mapping and physical address > > limits causing the guest host bridge to not work in strange ways. > >=20 > > This patch addresses this, by making "index" unsigned, and imposing a > > limit. Currently the limit allows indices from 0..255 which is probably > > enough host bridges for the time being. It's fairly easy to extend if > > we discover we need more. > >=20 > > Signed-off-by: David Gibson >=20 > I think the limit makes sense, but since the check isn't triggered in cas= es > where 'index' isn't specified and '[io,mem]_win_[size,offset]' are set > explicitly, maybe it makes sense to sanity-check the final calculation for > those values as well? We could actually drop the index limit in that case > (if we decided we wanted to). >=20 > But I think it's okay to assume such users know what they're doing in the > meantime, so: Yeah, that was my assumption, that if you're explicitly setting the windows, then you know what you're doing. > Reviewed-by: Michael Roth --=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 --rqzD5py0kzyFAOWN Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJUtxosAAoJEGw4ysog2bOSBSUQANKdFBn4fr0m7SqP8wvsl3Zg s3QIRHWeMbwgswJIu/k/TG5yTLw1/iXFWpirtPFhxtqjh+zDZdIR/Zta7MBlIUGe XWp+iKtTvVwSu66POk4QDUKQUAHPi4ADmK4cuDAFV6TUvOaqOUtiM/IbrP0/O+uG UQ8xyVD8TQLKFIXQXrnJsvHLUfIQ4R6utIA2PJBPYkaJDmgU2fQ1m7BylAG36gO8 O7qFucxvgNipEOvghMB3q7z9VsSFnsa6V/t6jjrjREmoFniXuwI9iOLY2M+1PnDW BnQ7e1vr2kds8rebQeaSgeJoEIQJ/GNAZOi/WsKUt8ykIGuM4vMygvYcV+9XjQhv +yBOM9Yb/3Z+ElEivJPQlrATaef8GAqOM/BJyvp0/AeQugWg/uN1yuyWc8zd+dVy 6ylMiSe7eoGK1mMtSnXoHSjEtuf/xeHs+8gE2nJ/EA1h2oCsl4sriZG1GC2+fcuT 9Ksa1ZkeLcubjTbAObhMsH37P8Pr9jTtFnJJNcyRmbn+h0gwTzFe8kMaFkxtq61u S0WbgYaVbgZyDg19f2j/uGykZaXe4kyWx+g3zsTNuuvB/sikUYI6TJsjm/wOSTtG 2nZeMSPMhM6feQTmeO9wIEC7HGL5wWu+NJAUCTCxoD89D2Esb+O4x/ypA1+waxpp j5Ih3s9ifmy2F4nO4Fwv =v8Fl -----END PGP SIGNATURE----- --rqzD5py0kzyFAOWN--