The series is developed together with QEMU's: [Qemu-devel] [PATCH RFC 00/17] implement multiple primary busses for pc machines http://lists.gnu.org/archive/html/qemu-ppc/2015-01/msg00159.html (not related to ppc)
v2 -> v3: - Addressed Kevin O'Connor comment to drop res_on_default_bus flag. - Added him as signed-off-by, I hope is OK.
v1 -> v2: - Addressed Kevin O'Connor idea (Thanks!) to treat devices behind extra root PCI buses as belonging to Bus 0 for resource resizing and mapping.
The series fixes some issues when more than one root primary bus is present.
First patch scans all the bus range to find the extra root buses. Second patch extends memory and IO mapping for found buses. Marcel Apfelbaum (2): fw/pci: scan all buses if extraroots romfile is present fw/pci: map memory and IO regions for multiple pci root buses
src/fw/pciinit.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
From: Marcel Apfelbaum marcel.a@redhat.com
If there are extra primary root buses, scanning the bus's 0 subtree is not enough. Scan all the range.
Signed-off-by: Marcel Apfelbaum marcel@redhat.com --- src/fw/pciinit.c | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/src/fw/pciinit.c b/src/fw/pciinit.c index fd5dfb9..a5f6505 100644 --- a/src/fw/pciinit.c +++ b/src/fw/pciinit.c @@ -499,8 +499,17 @@ pci_bios_init_bus_rec(int bus, u8 *pci_bus) static void pci_bios_init_bus(void) { + u8 extraroots = romfile_loadint("etc/extra-pci-roots", 0); u8 pci_bus = 0; + pci_bios_init_bus_rec(0 /* host bus */, &pci_bus); + + if (extraroots) { + while (pci_bus < 0xff) { + pci_bus++; + pci_bios_init_bus_rec(pci_bus, &pci_bus); + } + } }
For resource sizing and mapping purposes treat devices on extra root buses as if they are on the default root bus (bus 0).
Signed-off-by: Kevin O'Connor kevin@koconnor.net Signed-off-by: Marcel Apfelbaum marcel@redhat.com --- src/fw/pciinit.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/src/fw/pciinit.c b/src/fw/pciinit.c index a5f6505..701a6e0 100644 --- a/src/fw/pciinit.c +++ b/src/fw/pciinit.c @@ -686,6 +686,11 @@ static int pci_bios_check_devices(struct pci_bus *busses) busses[pci->secondary_bus].bus_dev = pci;
struct pci_bus *bus = &busses[pci_bdf_to_bus(pci->bdf)]; + if (!bus->bus_dev) + /* + * Resources for all root busses go in busses[0] + */ + bus = &busses[0]; int i; for (i = 0; i < PCI_NUM_REGIONS; i++) { if ((pci->class == PCI_CLASS_BRIDGE_PCI) && @@ -716,6 +721,11 @@ static int pci_bios_check_devices(struct pci_bus *busses) if (!s->bus_dev) continue; struct pci_bus *parent = &busses[pci_bdf_to_bus(s->bus_dev->bdf)]; + if (!parent->bus_dev) + /* + * Resources for all root busses go in busses[0] + */ + parent = &busses[0]; int type; int hotplug_support = pci_bus_hotplug_support(s); for (type = 0; type < PCI_REGION_TYPE_COUNT; type++) {
On Mon, Feb 16, 2015 at 07:29:18PM +0200, Marcel Apfelbaum wrote:
The series is developed together with QEMU's: [Qemu-devel] [PATCH RFC 00/17] implement multiple primary busses for pc machines http://lists.gnu.org/archive/html/qemu-ppc/2015-01/msg00159.html (not related to ppc)
v2 -> v3:
- Addressed Kevin O'Connor comment to drop res_on_default_bus flag.
- Added him as signed-off-by, I hope is OK.
v1 -> v2:
- Addressed Kevin O'Connor idea (Thanks!) to treat devices behind extra root PCI buses as belonging to Bus 0 for resource resizing and mapping.
The series fixes some issues when more than one root primary bus is present.
First patch scans all the bus range to find the extra root buses. Second patch extends memory and IO mapping for found buses.
Thanks Marcel.
The patches look fine to me. I'd prefer to commit after the upstream QEMU changes are in.
-Kevin
On 02/24/2015 07:34 PM, Kevin O'Connor wrote:
On Mon, Feb 16, 2015 at 07:29:18PM +0200, Marcel Apfelbaum wrote:
The series is developed together with QEMU's: [Qemu-devel] [PATCH RFC 00/17] implement multiple primary busses for pc machines http://lists.gnu.org/archive/html/qemu-ppc/2015-01/msg00159.html (not related to ppc)
v2 -> v3:
- Addressed Kevin O'Connor comment to drop res_on_default_bus flag.
- Added him as signed-off-by, I hope is OK.
v1 -> v2:
- Addressed Kevin O'Connor idea (Thanks!) to treat devices behind extra root PCI buses as belonging to Bus 0 for resource resizing and mapping.
The series fixes some issues when more than one root primary bus is present.
First patch scans all the bus range to find the extra root buses. Second patch extends memory and IO mapping for found buses.
Thanks Marcel.
The patches look fine to me. I'd prefer to commit after the upstream QEMU changes are in.
Hi Kevin, Thank you for accepting them.
The problem here is the QEMU series depends on it,while this series doesn't depend on QEMU. If no extra roots are present, the functionality is preserved as it is today.
I was waiting with the QEMU series to see the depending code getting accepted, the depending code being this SEABIOS series and ACPI dynamic one that already has a PULL request for it.
My main concern is the possibility for reviewers/testers to try it without too much work, but I guess it doesn't really matter.
Thanks, Marcel
-Kevin
SeaBIOS mailing list SeaBIOS@seabios.org http://www.seabios.org/mailman/listinfo/seabios
Hi,
My main concern is the possibility for reviewers/testers to try it without too much work, but I guess it doesn't really matter.
[ in qemu.git ] cd roms/seabios git checkout <patched-branch> cd .. make bios git add ../pc-bios/bios*.bin git commit -m "[for testing only] patched seabios binaries"
HTH, Gerd