qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Marcel Apfelbaum <marcel@redhat.com>
To: Laszlo Ersek <lersek@redhat.com>, qemu-devel@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 4/4] hw/pci-bridge: push down PXB in qtree in order to format PXB bus numer
Date: Thu, 11 Jun 2015 07:43:12 +0300	[thread overview]
Message-ID: <557911E0.6000208@redhat.com> (raw)
In-Reply-To: <55789129.1010403@redhat.com>

On 06/10/2015 10:34 PM, Laszlo Ersek wrote:
> On 06/10/15 21:26, Marcel Apfelbaum wrote:
>> On 06/10/2015 08:07 PM, Laszlo Ersek wrote:
>>> The PXB implementation doesn't allow firmware (SeaBIOS or OVMF) to boot
>>> off devices behind the PXB. This happens because the
>>> sysbus_get_fw_dev_path() function in "hw/core/sysbus.c" doesn't have
>>> enough information to format a unique identifier for the PXB in question,
>>> and consequently the OpenFirmware device path passed down to the guest
>>> firmware in the "bootorder" fw_cfg file is unusable for identifying the
>>> boot device.
>>>
>>> For example, the command line fragment
>>>
>>>     -device pxb,id=bridge1,bus_nr=4 \
>>>     \
>>>     -netdev user,id=netdev0 \
>>>     -device e1000,netdev=netdev0,bus=bridge1,addr=2,bootindex=0
>>>
>>> results in the following "bootorder" entry:
>>>
>>>     /pci/pci-bridge@0/ethernet@2/ethernet-phy@0
>>>
>>> The initial "pci" node is formatted by sysbus_get_fw_dev_path(), and the
>>> resultant OpenFirmware device path is independent of bus_nr=4 -- and
>>> therefore it is useless for identifying the device.
>>>
>>> In this patch we insert a dummy bus between the main sysbus and the
>>> TYPE_PXB_HOST device. Formatting child addresses is a bus class level
>>> responsibility, which is exactly what we'll use here.
>>>
>>> After the patch, the same command line fragment results in the following
>>> OpenFirmware device path in the "bootorder" fw_cfg file:
>>>
>>>     /extra-pci-roots/pxbhost@4/pci-bridge@0/ethernet@2/ethernet-phy@0
>>>
>>> The original, initial "/pci" fragment has been replaced with
>>> "/extra-pci-roots/pxbhost@4", which (a) looks better, (b) provides all
>>> the
>>> necessary information. sysbus_get_fw_dev_path() formats the first node
>>> ("extra-pci-roots") as always, and the new function
>>> extra_pci_roots_bus_get_fw_dev_path() formats the second one
>>> ("pxbhost@4").
>>>
>>> Here's the comparison ("diff -u -b -U28") between the "info qtree"
>>> outputs, before and after (the hpet device is the first common line):
>>
>> BTW, did you try to boot from it :) ?
>
> No, not yet; I'll have to write additional OVMF code for that; but the
> syntax is OK, and the information is there, so I'm fairly sure I can
> write that code. :)
>
> The SeaBIOS side I'll probably leave to you... /me ducks :)
I'll take it, sure, you are doing all the work anyway :)

Thanks,
Marcel
>
> Thanks
> Laszlo
>

      parent reply	other threads:[~2015-06-11  4:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-10 17:07 [Qemu-devel] [PATCH v2 0/4] PXB tweaks and fixes Laszlo Ersek
2015-06-10 17:07 ` [Qemu-devel] [PATCH v2 1/4] i386/acpi-build: more traditional _UID and _HID for PXB root buses Laszlo Ersek
2015-06-10 17:07 ` [Qemu-devel] [PATCH v2 2/4] i386/acpi-build: fix PXB workarounds for unsupported BIOSes Laszlo Ersek
2015-06-10 17:07 ` [Qemu-devel] [PATCH v2 3/4] hw/pci-bridge: create interrupt-less, hotplug-less bridge for PXB Laszlo Ersek
2015-06-10 18:22   ` Marcel Apfelbaum
2015-06-10 19:04     ` Laszlo Ersek
2015-06-10 17:07 ` [Qemu-devel] [PATCH v2 4/4] hw/pci-bridge: push down PXB in qtree in order to format PXB bus numer Laszlo Ersek
2015-06-10 19:26   ` Marcel Apfelbaum
2015-06-10 19:44     ` Laszlo Ersek
2015-06-10 19:26   ` Marcel Apfelbaum
2015-06-10 19:34     ` Laszlo Ersek
2015-06-10 20:11       ` Laszlo Ersek
2015-06-10 21:29         ` Laszlo Ersek
2015-06-11  4:44           ` Marcel Apfelbaum
2015-06-11  4:43       ` Marcel Apfelbaum [this message]

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=557911E0.6000208@redhat.com \
    --to=marcel@redhat.com \
    --cc=armbru@redhat.com \
    --cc=lersek@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).