From: David Gibson <david@gibson.dropbear.id.au>
To: Michael Roth <mdroth@linux.vnet.ibm.com>
Cc: aik@ozlabs.ru, agraf@suse.de, qemu-devel@nongnu.org,
qemu-ppc@nongnu.org, mdroth@us.ibm.com, pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH] pseries: Limit PCI host bridge "index" value
Date: Thu, 15 Jan 2015 12:38:52 +1100 [thread overview]
Message-ID: <20150115013852.GD5297@voom.fritz.box> (raw)
In-Reply-To: <20150114172310.20117.41933@loki>
[-- Attachment #1: Type: text/plain, Size: 2099 bytes --]
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 every
> > one, the device supports an "index" property which is a shorthand setting
> > the various window and configuration addresses from a predefined sensible
> > set.
> >
> > 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.
> >
> > 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.
> >
> > Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
>
> I think the limit makes sense, but since the check isn't triggered in cases
> 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).
>
> 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 <mdroth@linux.vnet.ibm.com>
--
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
[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2015-01-15 3:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-14 2:33 [Qemu-devel] [PATCH] pseries: Limit PCI host bridge "index" value David Gibson
2015-01-14 12:10 ` Paolo Bonzini
2015-01-14 17:23 ` Michael Roth
2015-01-15 1:38 ` David Gibson [this message]
2015-01-29 0:37 ` David Gibson
2015-01-29 13:12 ` Alexander Graf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150115013852.GD5297@voom.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=agraf@suse.de \
--cc=aik@ozlabs.ru \
--cc=mdroth@linux.vnet.ibm.com \
--cc=mdroth@us.ibm.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).