• D
    pseries: Limit PCI host bridge "index" value · 3e4ac968
    David Gibson 提交于
    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: NDavid Gibson <david@gibson.dropbear.id.au>
    Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
    Reviewed-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
    Signed-off-by: NAlexander Graf <agraf@suse.de>
    3e4ac968
spapr_pci.c 31.3 KB