Received: from eggs.gnu.org ([2001:4830:134:3::10]:57700) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXu8z-0003vo-Ur for qemu-devel@nongnu.org; Wed, 19 Jul 2017 14:56:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dXu8w-0005cA-2r for qemu-devel@nongnu.org; Wed, 19 Jul 2017 14:56:22 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:51645) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dXu8v-0005bc-Oq for qemu-devel@nongnu.org; Wed, 19 Jul 2017 14:56:18 -0400 Date: Wed, 19 Jul 2017 14:56:03 -0400 From: Konrad Rzeszutek Wilk Message-ID: <20170719185603.GC13557@char.us.oracle.com> References: <1500470414-7911-1-git-send-email-zuban32s@gmail.com> <20170719135726.GG5722@char.us.oracle.com> <20170719181853.GC13096@char.us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] Fwd: [RFC PATCH 0/2] Allow RedHat PCI bridges reserve more buses than necessary during init List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Bezzubikov Cc: Marcel Apfelbaum , qemu-devel@nongnu.org, seabios@seabios.org On Wed, Jul 19, 2017 at 09:38:50PM +0300, Alexander Bezzubikov wrote: > 2017-07-19 21:18 GMT+03:00 Konrad Rzeszutek Wilk : >=20 > > On Wed, Jul 19, 2017 at 05:14:41PM +0000, Alexander Bezzubikov wrote: > > > =D1=81=D1=80, 19 =D0=B8=D1=8E=D0=BB=D1=8F 2017 =D0=B3. =D0=B2 16:57= , Konrad Rzeszutek Wilk < > > konrad.wilk@oracle.com>: > > > > > > > On Wed, Jul 19, 2017 at 04:20:12PM +0300, Aleksandr Bezzubikov wr= ote: > > > > > Now PCI bridges (and PCIE root port too) get a bus range number= in > > > > system init, > > > > > basing on currently plugged devices. That's why when one wants = to > > > > hotplug another bridge, > > > > > it needs his child bus, which the parent is unable to provide. > > > > > > > > Could you explain how you trigger this? > > > > > > > > > I'm trying to hot plug pcie-pci bridge into pcie root port, and Lin= ux > > says > > > 'cannot allocate bus number for device bla-bla'. This obviously doe= s not > > > allow me to use the bridge at all. > > > > > > > > > > > > > > > > The suggested workaround is to have vendor-specific capability = in > > RedHat > > > > generic pcie-root-port > > > > > that contains number of additional bus to reserve on BIOS PCI i= nit. > > > > > > > > But wouldn't the proper fix be for the PCI bridge to have the > > subordinate > > > > value be extended to fit more bus ranges? > > > > > > > > > What do you mean? This is what I'm trying to do. Do you suppose to = get > > rid > > > of vendor-specific cap and use original register value instead of i= t? > > > > I would suggest a simple fix - each bridge has a a number of bus devi= ces > > it can use. You have up to 255 - so you split the number of northbrid= ge > > numbers by the amount of NUMA nodes (if that is used) - so for exampl= e > > if you have 4 NUMA nodes, each bridge would cover 63 bus numbers. > > > > Meaning the root bridge would cover 0->63 bus, 64->128, and so on. > > That gives you enough space to plug in your plugged in devices > > (up to 63). > > > > And if you need sub-briges then carve out a specific range. > > >=20 > The problem is that we don't know at the init moment how many subbridge= s we > may need, = =20 And the explanation above does not either. It just setups at init time = =20 an range where you can plug in your new devices in. But in a more uniform= =20 way such that you can also utilize this with NUMA and _PXM topology = =20 in the future. =20 > and how deep the whole device tree will be. The key moment - PCI bridge > hotplugging > needs either rescan all buses on each bridge device addition, or reserv= e > space in advance during BIOS init. can all buses on each bridge device addition, or reserve = =20 = =20 It is more complex than that - you may need to move devices that are = =20 below you. And Linux kernel (nor any other OS) can handle that. = =20 (They can during bootup) =20 > In this series the second way was chosen. >=20 >=20 > > > > > > > > > > > > > > > > > > > > > Aleksandr Bezzubikov (2): > > > > > pci: add support for direct usage of bdf for capability looku= p > > > > > pci: enable RedHat pci bridges to reserve more buses > > > > > > > > > > src/fw/pciinit.c | 12 ++++++++++-- > > > > > src/hw/pcidevice.c | 24 ++++++++++++++++++++++++ > > > > > src/hw/pcidevice.h | 1 + > > > > > 3 files changed, 35 insertions(+), 2 deletions(-) > > > > > > > > > > -- > > > > > 2.7.4 > > > > > > > > > > > > > > > > > -- > > > Alexander Bezzubikov > > >=20 >=20 >=20 > --=20 > Alexander Bezzubikov