qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] pseries: Limit PCI host bridge "index" value


From: David Gibson
Subject: Re: [Qemu-devel] [PATCH] pseries: Limit PCI host bridge "index" value
Date: Thu, 15 Jan 2015 12:38:52 +1100
User-agent: Mutt/1.5.23 (2014-03-12)

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 <address@hidden>
> 
> 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 <address@hidden>

-- 
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: pgps8jFtDgnUY.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]