From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Gleb Natapov <gleb@redhat.com>
Cc: Blue Swirl <blauwirbel@gmail.com>,
kevin@koconnor.net,
The OpenBIOS Mailinglist <openbios@openbios.org>,
qemu-devel@nongnu.org, kvm@vger.kernel.org
Subject: Re: [Qemu-devel] Re: [PATCHv8 00/16] boot order specification
Date: Sun, 12 Dec 2010 10:27:22 +1100 [thread overview]
Message-ID: <1292110042.16694.397.camel@pasglop> (raw)
In-Reply-To: <20101211191126.GA11897@redhat.com>
> > > Ah the problem is that we have not qdevified mac io bus. Since first to
> > > ide disks are automatically attached to mac-io bus device paths for them
> > > are incorrect. Next two ide devices will be attached to CMD646 and qemu
> > > will generate correct device paths for them:
> > >
> > > qemu-system-ppc -drive if=none,id=hda,file=/dev/null -device ide-drive,drive=hda,bootindex=1
> > > -drive if=none,id=cd,file=/dev/null -device ide-drive,drive=cd,bootindex=0 -nographic -drive
> > > if=none,id=hdb,file=/dev/null -device ide-drive,drive=hdb,bus=ide.0,bootindex=2 -drive
> > > if=none,id=hdc,file=/dev/null -device ide-drive,drive=hdc,bus=ide.0,bootindex=3
> > > adding '/grackle@fec00000/ide@3/drive@1/disk@1' at index 0
> > > adding '/grackle@fec00000/ide@3/drive@1/disk@0' at index 1
> > > adding '/grackle@fec00000/ide@3/drive@0/disk@0' at index 2
> > > adding '/grackle@fec00000/ide@3/drive@0/disk@1' at index 3
> >
> > But why is the path almost the same as CMD646, shouldn't 'ide@3' be
> > different since the PCI device is not the same?
> >
> It should, but since the mac io is not qdevified there is no qdev pci
> device for it.
Note that a better long term solution for all these is to have qemu
maintain the device-tree, using libfdt, and pass it to the firmware.
I have a port of SLOF that I can't release just yet (soon hopefully) on
top of another ppc "machine" for qemu that will also hopefully be soon
out there, but basically, what I do there is pass the FDT to SLOF, in
which I use forth code to expand it into a real OF device-tree.
Then, my SLOF code "populates" methods for known devices.
The only problem with that approach is the phandles. OpenBIOS/SLOF/OFW
will "assign" it's own phandle to nodes it creates, ignoring the
"phandle" properties created by libfdt.
That means that linkage within the device-tree will be potentially
broken accross the transition (ie, interrupt-parent, interrupt-map
etc... all contain phandle values to reference another node).
The way I get away with it right now is that I never use such linkage in
SLOF and I preserve the original "phandle" properties, which Linux will
then pickup and use instead of the SLOF "native" phandle when parsing
the tree.
A better long run option would be to have OF itself (whichever variant)
use some remapping on the phandles (instead of making them just
pointers) so it can create nodes with specific phandles.
Once you have your device-tree in qemu, everything looks simpler, you no
longer have to play guess work as to what the path will look like inside
the firmware. It also opens the door for passing bits of the device-tree
dynamically to the kernel for hotplug etc...
Cheers,
Ben.
next prev parent reply other threads:[~2010-12-11 23:27 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-08 11:34 [Qemu-devel] [PATCHv8 00/16] boot order specification Gleb Natapov
2010-12-08 11:34 ` [Qemu-devel] [PATCHv8 01/16] Introduce fw_name field to DeviceInfo structure Gleb Natapov
2010-12-08 11:34 ` [Qemu-devel] [PATCHv8 02/16] Introduce new BusInfo callback get_fw_dev_path Gleb Natapov
2010-12-08 11:34 ` [Qemu-devel] [PATCHv8 03/16] Keep track of ISA ports ISA device is using in qdev Gleb Natapov
2010-12-08 11:34 ` [Qemu-devel] [PATCHv8 04/16] Add get_fw_dev_path callback to ISA bus " Gleb Natapov
2010-12-08 11:34 ` [Qemu-devel] [PATCHv8 05/16] Store IDE bus id in IDEBus structure for easy access Gleb Natapov
2010-12-08 11:34 ` [Qemu-devel] [PATCHv8 06/16] Add get_fw_dev_path callback to IDE bus Gleb Natapov
2010-12-08 11:35 ` [Qemu-devel] [PATCHv8 07/16] Add get_fw_dev_path callback for system bus Gleb Natapov
2010-12-08 11:35 ` [Qemu-devel] [PATCHv8 08/16] Add get_fw_dev_path callback for pci bus Gleb Natapov
2010-12-08 11:35 ` [Qemu-devel] [PATCHv8 09/16] Record which USBDevice USBPort belongs too Gleb Natapov
2010-12-08 11:35 ` [Qemu-devel] [PATCHv8 10/16] Add get_fw_dev_path callback for usb bus Gleb Natapov
2010-12-08 11:35 ` [Qemu-devel] [PATCHv8 11/16] Add get_fw_dev_path callback to scsi bus Gleb Natapov
2010-12-08 11:35 ` [Qemu-devel] [PATCHv8 12/16] Add bootindex parameter to net/block/fd device Gleb Natapov
2011-01-28 13:29 ` Markus Armbruster
2011-01-28 15:53 ` Gleb Natapov
2011-01-28 17:19 ` Markus Armbruster
2011-02-02 15:08 ` Markus Armbruster
2011-02-02 15:10 ` Gleb Natapov
2011-02-02 15:12 ` Gleb Natapov
2010-12-08 11:35 ` [Qemu-devel] [PATCHv8 13/16] Change fw_cfg_add_file() to get full file path as a parameter Gleb Natapov
2010-12-08 11:35 ` [Qemu-devel] [PATCHv8 14/16] Add bootindex for option roms Gleb Natapov
2010-12-08 11:35 ` [Qemu-devel] [PATCHv8 15/16] Add notifier that will be called when machine is fully created Gleb Natapov
2010-12-08 11:35 ` [Qemu-devel] [PATCHv8 16/16] Pass boot device list to firmware Gleb Natapov
2010-12-11 15:13 ` [Qemu-devel] Re: [PATCHv8 00/16] boot order specification Blue Swirl
2010-12-11 16:06 ` Gleb Natapov
2010-12-11 17:19 ` Blue Swirl
2010-12-11 18:02 ` Gleb Natapov
2010-12-11 18:27 ` Gleb Natapov
2010-12-11 19:06 ` Blue Swirl
2010-12-11 19:11 ` Gleb Natapov
2010-12-11 23:27 ` Benjamin Herrenschmidt [this message]
2010-12-11 18:59 ` Blue Swirl
2010-12-11 23:22 ` Benjamin Herrenschmidt
2010-12-14 19:59 ` Andreas Färber
2010-12-14 20:31 ` Benjamin Herrenschmidt
2010-12-14 23:02 ` Alexander Graf
2010-12-17 14:05 ` Andreas Färber
2010-12-11 22:10 ` Blue Swirl
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=1292110042.16694.397.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=blauwirbel@gmail.com \
--cc=gleb@redhat.com \
--cc=kevin@koconnor.net \
--cc=kvm@vger.kernel.org \
--cc=openbios@openbios.org \
--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).