qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Gleb Natapov <gleb@redhat.com>
Cc: kvm@vger.kernel.org, qemu-devel@nongnu.org, armbru@redhat.com,
	Blue Swirl <blauwirbel@gmail.com>,
	alex.williamson@redhat.com, kevin@koconnor.net
Subject: [Qemu-devel] Re: [PATCHv4 15/15] Pass boot device list to firmware.
Date: Thu, 18 Nov 2010 14:23:20 +0200	[thread overview]
Message-ID: <20101118122320.GC31987@redhat.com> (raw)
In-Reply-To: <20101118121605.GK7948@redhat.com>

On Thu, Nov 18, 2010 at 02:16:05PM +0200, Gleb Natapov wrote:
> On Thu, Nov 18, 2010 at 01:52:30PM +0200, Michael S. Tsirkin wrote:
> > On Thu, Nov 18, 2010 at 01:45:04PM +0200, Gleb Natapov wrote:
> > > On Thu, Nov 18, 2010 at 01:38:31PM +0200, Michael S. Tsirkin wrote:
> > > > On Thu, Nov 18, 2010 at 12:18:27PM +0200, Gleb Natapov wrote:
> > > > > On Wed, Nov 17, 2010 at 09:54:27PM +0000, Blue Swirl wrote:
> > > > > > 2010/11/16 Gleb Natapov <gleb@redhat.com>:
> > > > > > > On Tue, Nov 16, 2010 at 06:30:19PM +0000, Blue Swirl wrote:
> > > > > > >> >> Perhaps the FW path should use device class names if no name is specified.
> > > > > > >> > What do you mean by "device class name". We can do something like this:
> > > > > > >> > if (dev->child_bus.lh_first)
> > > > > > >> >        return dev->child_bus.lh_first->info->name;
> > > > > > >> >
> > > > > > >> > i.e if there is child bus use its bus name as fw name. This will make
> > > > > > >> > all pci devices to have "pci" as fw name automatically. The problem is
> > > > > > >> > that theoretically same device can provide different buses.
> > > > > > >>
> > > > > > >> I meant PCI class name, like "display" for display controllers,
> > > > > > >> "network" for NICs etc.
> > > > > > >>
> > > > > > > That is what my pci bus related patch is doing already.
> > > > > > >
> > > > > > >> >> I'll try Sparc32 to see how this fits there.
> > > > > > >>
> > > > > > >> Except bootindex is not implemented for SCSI.
> > > > > > > Will look into adding it.
> > > > > > 
> > > > > > Thanks. The bootindex on Sparc32 looks like this:
> > > > > > bootindex /esp@0000000078800000/disk@1,0
> > > > > > /ethernet@ffffffffffffffff/ethernet-phy@0
> > > > > > 
> > > > > For arches other then x86 there is a lot of work left to be done :)
> > > > > For starter exotic sparc buses should get their own get_fw_dev_path()
> > > > > implementation.
> > > > > 
> > > > > > I don't think I got Lance setup right.
> > > > > > 
> > > > > > OF paths for the devices would be:
> > > > > > /iommu@0,10000000/sbus@0,10001000/espdma@5,8400000/esp@5,8800000/sd@1,0
> > > > > > /iommu@0,10000000/sbus@0,10001000/ledma@5,8400010/le@5,8c00000
> > > > > If qdev hierarchy does not correspond to real HW there is no much we can
> > > > > do expect for fixing qdev.
> > > > 
> > > > That's bad.  This raises a concern: if these paths expose qdev
> > > > internals, any attempt to fix this will break migration.
> > > > 
> > > The path expose internal HW hierarchy. It is designed to do so. Qdev
> > > designed to do the same: describe HW hierarchy. If qdev fails to do so it
> > > is broken.
> > 
> > Yes. But since you use qdev to build up the path, a broken
> > qdev will give you a broken path.
> > 
> Qdev bug. Fix it like any other bug. The nice is that when you compare
> device path produced by qdev and real HW you can see when qdev is wrong.
> 
> > > I do not see connection to migration at all since the path is
> > > not used in migration code.
> > 
> > The connection is that if we pass the list with path 1 which you define
> > as broken to BIOS, then migrate to a machine with an updated qemu
> > which has a correct path, BIOS won't be able to complete the boot.
> You solve it like you solve all such issue with -M machine type.

So that's unavoidable if we think paths are correct.
But if we know they are wrong, we are better off
correcting them first IMO.

> But the problem exists only if migration happens in a short window
> between start of the boot process and BIOS reading boot order string.
> After reboot new qemu should have new BIOS.

That makes it even more nasty, doesn't it?

> > Right? Same in reverse direction.
> Reverse direction is not and never was supported.
> 
> > As solution could be a fuzzy matching
> > of paths that wiull let us recover.
> > 
> Firmware can try its best of course, but nothing is guarantied.

No I mean qemu could do matching fuzzily.
This way if we get a path from the old BIOS we can
survive.

> > > > > > 
> > > > > > The logic for ESP is that ESP (registers at 0x78800000, slot offset
> > > > > > 0x880000) is handled by the DMA controller (registers at 0x78400000,
> > > > > > slot offset 0x840000), they are in a SBus slot #5, and SBus (registers
> > > > > > at 0x10001000) is in turn handled by IOMMU (registers at 0x10000000).
> > > > > > Lance should be handled the same way.
> > > > > > 
> > > > > > This hierarchy is partly known by QEMU because DMA accesses use this
> > > > > > flow, but not otherwise. There is no concept of SBus slots, DMA talks
> > > > > > to IOMMU directly. Though in this case both ESP, Lance and their DMA
> > > > > > controllers are on board devices in a MACIO chip. It may be possible
> > > > > > to add the hierarchy information at each stage.
> > > > > > 
> > > > > > It should also be possible for BIOS to determine the device just from
> > > > > > the physical address if we ignored OF compatibility.
> > > > > It would be nice to be OF compatible at least at some level. Of course OF
> > > > > spec is not strict enough to have two different implementations produce
> > > > > exactly same device path that can be compared by strcpy.  Can we apply
> > > > > the series now? At least for x86 it provides useful paths and work can
> > > > > be continue for other arches by interested parties.
> > > > > 
> > > > > --
> > > > > 			Gleb.
> > > > 
> > > > Something I only now realized is that we commit
> > > > to never changing the paths for any architecture
> > > > that supports migration.
> > > > 
> > > No connection to migration whatsoever.
> > 
> > It just seems silly to use different paths for the same thing.
> > 
> > Besides the connection above, I was hoping to use these paths
> > for section names in migration. If we can't guarantee they are
> > stable, we'll have to roll our own, and if we do this,
> > with stability guarantees required for migration format,
> > maybe use it for other things like BIOS as well?
> > 
> It doesn't matter what do you use for migration purposes as long as it
> depend on qdev hierarchy it will have problem when qdev hierarchy
> changes and if it doesn't you can't produce unique names reliably.
> 
> --
> 			Gleb.

We can, it's not like OF is the only way to enumerate.
We could have driver-specific paths for example, exactly like we
currently have.  I.e. paths don't have to be globally unique because
each driver has it's own domain.

It seems cleaner to use an existing spec but we must figure out
how it will not become a support issue.

-- 
MST

  reply	other threads:[~2010-11-18 12:23 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-14 15:39 [Qemu-devel] [PATCHv4 00/15] boot order specification Gleb Natapov
2010-11-14 15:39 ` [Qemu-devel] [PATCHv4 01/15] Introduce fw_name field to DeviceInfo structure Gleb Natapov
2010-11-14 15:39 ` [Qemu-devel] [PATCHv4 02/15] Introduce new BusInfo callback get_fw_dev_path Gleb Natapov
2010-11-14 15:39 ` [Qemu-devel] [PATCHv4 03/15] Keep track of ISA ports ISA device is using in qdev Gleb Natapov
2010-11-14 15:39 ` [Qemu-devel] [PATCHv4 04/15] Add get_fw_dev_path callback to ISA bus " Gleb Natapov
2010-11-14 15:39 ` [Qemu-devel] [PATCHv4 05/15] Store IDE bus id in IDEBus structure for easy access Gleb Natapov
2010-11-14 15:39 ` [Qemu-devel] [PATCHv4 06/15] Add get_fw_dev_path callback to IDE bus Gleb Natapov
2010-11-14 15:39 ` [Qemu-devel] [PATCHv4 07/15] Add get_dev_path callback for system bus Gleb Natapov
2010-11-14 15:39 ` [Qemu-devel] [PATCHv4 08/15] Add get_fw_dev_path callback for pci bus Gleb Natapov
2010-11-14 18:27   ` [Qemu-devel] " Michael S. Tsirkin
2010-11-14 18:42     ` Gleb Natapov
2010-11-14 15:39 ` [Qemu-devel] [PATCHv4 09/15] Record which USBDevice USBPort belongs too Gleb Natapov
2010-11-14 15:39 ` [Qemu-devel] [PATCHv4 10/15] Add get_dev_path callback for usb bus Gleb Natapov
2010-11-14 15:39 ` [Qemu-devel] [PATCHv4 11/15] Add bootindex parameter to net/block/fd device Gleb Natapov
2010-11-14 15:39 ` [Qemu-devel] [PATCHv4 12/15] Change fw_cfg_add_file() to get full file path as a parameter Gleb Natapov
2010-11-14 15:39 ` [Qemu-devel] [PATCHv4 13/15] Add bootindex for option roms Gleb Natapov
2010-11-14 21:33   ` [Qemu-devel] " Blue Swirl
2010-11-15 10:18     ` Gleb Natapov
2010-11-14 15:39 ` [Qemu-devel] [PATCHv4 14/15] Add notifier that will be called when machine is fully created Gleb Natapov
2010-11-14 15:39 ` [Qemu-devel] [PATCHv4 15/15] Pass boot device list to firmware Gleb Natapov
2010-11-14 18:41   ` [Qemu-devel] " Michael S. Tsirkin
2010-11-14 18:52     ` Gleb Natapov
2010-11-14 20:56       ` Michael S. Tsirkin
2010-11-14 20:57       ` Michael S. Tsirkin
2010-11-14 20:49   ` Blue Swirl
2010-11-14 20:54     ` Michael S. Tsirkin
2010-11-14 21:13       ` Blue Swirl
2010-11-14 21:45         ` Michael S. Tsirkin
2010-11-14 22:50   ` Blue Swirl
2010-11-15  8:42     ` Gleb Natapov
2010-11-15 20:29       ` Blue Swirl
2010-11-16 14:11         ` Gleb Natapov
2010-11-16 18:30           ` Blue Swirl
2010-11-16 19:02             ` Gleb Natapov
2010-11-17 21:54               ` Blue Swirl
2010-11-18 10:18                 ` Gleb Natapov
2010-11-18 11:38                   ` Michael S. Tsirkin
2010-11-18 11:45                     ` Gleb Natapov
2010-11-18 11:52                       ` Michael S. Tsirkin
2010-11-18 12:16                         ` Gleb Natapov
2010-11-18 12:23                           ` Michael S. Tsirkin [this message]
2010-11-18 12:37                             ` Gleb Natapov
2010-11-18 13:12                               ` Michael S. Tsirkin
2010-11-18 13:16                                 ` Gleb Natapov
2010-11-15  3:40   ` Kevin O'Connor
2010-11-15  7:40     ` Gleb Natapov
2010-11-15  7:53       ` Michael S. Tsirkin
2010-11-15  8:09         ` Gleb Natapov
2010-11-15 13:26       ` Kevin O'Connor
2010-11-15 13:36         ` Gleb Natapov
2010-11-15 13:46           ` Gleb Natapov
2010-11-16  2:52           ` Kevin O'Connor
2010-11-16  7:22             ` Gleb Natapov
2010-11-16 13:49               ` Kevin O'Connor
2010-11-16 18:19               ` 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=20101118122320.GC31987@redhat.com \
    --to=mst@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=armbru@redhat.com \
    --cc=blauwirbel@gmail.com \
    --cc=gleb@redhat.com \
    --cc=kevin@koconnor.net \
    --cc=kvm@vger.kernel.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).