From: Laszlo Ersek <lersek@redhat.com>
To: Marcel Apfelbaum <marcel@redhat.com>, seabios@seabios.org
Cc: kevin@koconnor.net, qemu-devel@nongnu.org, mst@redhat.com
Subject: Re: [Qemu-devel] [PATCH V2] pci: fixes to allow booting from extra root pci buses.
Date: Thu, 11 Jun 2015 15:57:31 +0200 [thread overview]
Message-ID: <557993CB.9080307@redhat.com> (raw)
In-Reply-To: <1434029828-31954-1-git-send-email-marcel@redhat.com>
On 06/11/15 15:37, Marcel Apfelbaum wrote:
> The fixes solves the following issue:
> The PXB device exposes a new pci root bridge with the
> fw path: /pci-root@4/..., in which 4 is the root bus number.
> Before this patch the fw path was wrongly computed:
> /pci-root@1/pci@i0cf8/...
> Fix the above issues: Correct the bus number and remove the
> extra host bridge description.
>
> The IEEE Std 1275-1994:
>
> IEEE Standard for Boot (Initialization Configuration)
> Firmware: Core Requirements and Practices
> 3.2.1.1 Node names
> Each node in the device tree is identified by a node name
> using the following notation:
> driver-name@unit-address:device-arguments
>
> The driver name field is a sequence of between one and 31
> letters [...]. By convention, this name includes the name of
> the device’s manufacturer and the device’s model name separated by
> a “,”.
>
> The unit address field is the text representation of the
> physical address of the device within the address space
> defined by its parent node. The form of the text
> representation is bus-dependent.
> 3.2.1.2 Path names
> A particular node is uniquely identified by describing its position
> in the device tree by completely specifying the
> path from the root node through all intermediate nodes to the node
> in question. The textual representation of a
> such a path is called a device path. Device paths are composed as
> follows:
> /node-name0/node-name1/ ... /node-nameN
> When Open Firmware is searching for a particular node, and either
> the driver name or @unit-address portion of
> the node name is not given, Open Firmware shall arbitrarily choose a
> node matching the portion that is present.
>
> Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
> ---
> v1->v2:
> - fixed a bug preventing the boot of devices behind the main host bridge
> This approach leaves previous code paths intact so it will work the same
> as before if no PXB is present.
> - Added spec for fw path naming conventions. (Michael S. Tsirkin)
>
> src/boot.c | 3 ++-
> src/hw/pci.c | 2 +-
> 2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/src/boot.c b/src/boot.c
> index ec59c37..e241d1c 100644
> --- a/src/boot.c
> +++ b/src/boot.c
> @@ -114,7 +114,8 @@ build_pci_path(char *buf, int max, const char *devname, struct pci_device *pci)
> } else {
> if (pci->rootbus)
> p += snprintf(p, max, "/pci-root@%x", pci->rootbus);
> - p += snprintf(p, buf+max-p, "%s", FW_PCI_DOMAIN);
> + else
> + p += snprintf(p, buf+max-p, "%s", FW_PCI_DOMAIN);
> }
>
> int dev = pci_bdf_to_dev(pci->bdf), fn = pci_bdf_to_fn(pci->bdf);
> diff --git a/src/hw/pci.c b/src/hw/pci.c
> index 0379b55..9e77af4 100644
> --- a/src/hw/pci.c
> +++ b/src/hw/pci.c
> @@ -133,7 +133,7 @@ pci_probe_devices(void)
> if (bus != lastbus)
> rootbuses++;
> lastbus = bus;
> - rootbus = rootbuses;
> + rootbus = bus;
> if (bus > MaxPCIBus)
> MaxPCIBus = bus;
> } else {
>
I think the commit message is somewhat overkill, but I'll leave that to
Michael. :)
Regardig the rootbus question. As far as I can see, the last hunk
changes the dev->rootbus assignment for parentless devices, so they pick
up the last bus rather than the number of buses found.
Then, the only difference this makes is in build_pci_path() -- I grepped
the tree for whole-word "rootbus".
(It's quite a serendipity that my v3 qemu patchset produces exactly this
pattern in OFW device paths, without my then-knowledge of the SeaBIOS
code. Although, admittedly, the fw_name := "pci-root" change there was
suggested by Marcel.)
So, unless I'm missing something:
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
next prev parent reply other threads:[~2015-06-11 13:57 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-11 13:37 [Qemu-devel] [PATCH V2] pci: fixes to allow booting from extra root pci buses Marcel Apfelbaum
2015-06-11 13:57 ` Laszlo Ersek [this message]
2015-06-11 13:58 ` Kevin O'Connor
2015-06-11 14:12 ` Marcel Apfelbaum
2015-06-11 14:24 ` Kevin O'Connor
2015-06-11 14:36 ` Marcel Apfelbaum
2015-06-11 15:00 ` Laszlo Ersek
2015-06-11 16:54 ` Kevin O'Connor
2015-06-11 17:46 ` Marcel Apfelbaum
2015-06-11 18:34 ` Laszlo Ersek
2015-06-11 19:24 ` Kevin O'Connor
2015-06-12 9:25 ` Laszlo Ersek
2015-06-12 13:03 ` Kevin O'Connor
2015-06-12 15:45 ` Laszlo Ersek
2015-06-12 18:40 ` Kevin O'Connor
2015-06-12 20:13 ` Laszlo Ersek
2015-06-14 12:05 ` Michael S. Tsirkin
2015-06-14 14:50 ` Kevin O'Connor
2015-06-14 18:06 ` Michael S. Tsirkin
2015-06-14 18:21 ` Kevin O'Connor
2015-06-14 21:39 ` Benjamin Herrenschmidt
2015-06-14 21:59 ` Kevin O'Connor
2015-06-15 2:50 ` Benjamin Herrenschmidt
2015-06-15 8:22 ` Michael S. Tsirkin
2015-06-11 19:10 ` Kevin O'Connor
2015-06-12 6:00 ` Gerd Hoffmann
2015-06-12 12:17 ` Marcel Apfelbaum
2015-06-12 13:23 ` Kevin O'Connor
2015-06-15 6:01 ` Gerd Hoffmann
2015-06-15 6:50 ` Gerd Hoffmann
2015-06-15 9:02 ` Marcel Apfelbaum
2015-06-15 9:43 ` Michael S. Tsirkin
2015-06-15 10:18 ` Gerd Hoffmann
2015-06-15 10:26 ` Michael S. Tsirkin
2015-06-11 14:35 ` Laszlo Ersek
2015-06-11 16:48 ` Kevin O'Connor
2015-06-11 18:38 ` [Qemu-devel] [SeaBIOS] " Laszlo Ersek
2015-06-14 12:10 ` [Qemu-devel] " Michael S. Tsirkin
2015-06-14 13:47 ` Kevin O'Connor
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=557993CB.9080307@redhat.com \
--to=lersek@redhat.com \
--cc=kevin@koconnor.net \
--cc=marcel@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=seabios@seabios.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.