qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: "Richard W.M. Jones" <rjones@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	qemu devel list <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] address order of virtio-mmio devices
Date: Thu, 29 Jan 2015 20:35:16 +0100	[thread overview]
Message-ID: <54CA8B74.3010706@redhat.com> (raw)
In-Reply-To: <20150129190912.GB3860@redhat.com>

On 01/29/15 20:09, Richard W.M. Jones wrote:
> On Thu, Jan 29, 2015 at 07:29:09PM +0100, Laszlo Ersek wrote:
>> On 01/29/15 19:15, Peter Maydell wrote:
>>> On 29 January 2015 at 17:25, Laszlo Ersek <lersek@redhat.com> wrote:
>>>> I find that virtio-mmio devices are assigned highest-to-lowest addresses
>>>> as they are found on the command line. IOW, this code (from commit
>>>> f5fdcd6e):
>>>>
>>>>     /* Note that we have to create the transports in forwards order
>>>>      * so that command line devices are inserted lowest address first,
>>>>      * and then add dtb nodes in reverse order so that they appear in
>>>>      * the finished device tree lowest address first.
>>>>      */
>>>>     for (i = 0; i < NUM_VIRTIO_TRANSPORTS; i++) {
>>>>         int irq = vbi->irqmap[VIRT_MMIO] + i;
>>>>         hwaddr base = vbi->memmap[VIRT_MMIO].base + i * size;
>>>>
>>>>         sysbus_create_simple("virtio-mmio", base, pic[irq]);
>>>>     }
>>>>
>>>> works exactly in reverse.
>>>
>>> Note that you can't rely on device ordering anyway. Guests
>>> should be using UUIDs or similar to ensure they mount the
>>> right filesystems in the right places, because the kernel
>>> makes no guarantee that it will enumerate devices in the
>>> device tree in any particular order.
>>
>> Understood. Then we'll probably have to address this in libguestfs.
> 
> That's pretty much impossible.  If we can't fix qemu, then libguestfs
> will need to add the drives in reverse order on the command line (for
> this case virtio-blk && -M virt).

That's precisely what I meant by "addressing it in libguestfs". My idea
wasn't reversing the drives but to fixup the root=.... kernel cmdline
parameter. But I didn't look into it at all; I certainly defer to you.

> I should note that we're only trying to use virtio-blk because
> virtio-scsi is broken

It's not directly virtio-scsi that's broken; something in the thread
pool breaks on aarch64 KVM, and only virtio-scsi exposes it, virtio-blk
doesn't (although it uses the same thread pool, just with fewer middle
layers).

> ...  Laszlo: is there a public bug for that?

There isn't.

I requested permission on the appropriate internal list to open up bug
1184405. I didn't get permission. I disagree with that to this day
(given the actual contents of the bug).

Paolo had suggested to use Launchpad, but I resisted (for good reason;
Launchpad is possibly the worst bug tracker imaginable. I have specific
reasons.)

Working 12+ hours per day I don't feel the slightest inclination to
screw around with substandard bug trackers during the original research,
nor to shovel over 30+ carefully edited comments and about 10
attachments after their initial record in the RHBZ. The way forward is
to open up 1184405, if we'd like it to be public.

Thanks
Laszlo

      parent reply	other threads:[~2015-01-29 19:35 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-29 17:25 [Qemu-devel] address order of virtio-mmio devices Laszlo Ersek
2015-01-29 17:59 ` Paolo Bonzini
2015-01-29 18:15 ` Peter Maydell
2015-01-29 18:29   ` Laszlo Ersek
2015-01-29 19:01     ` Peter Maydell
2015-01-29 19:12       ` Laszlo Ersek
2015-01-29 19:47         ` Laszlo Ersek
2015-01-29 20:05           ` Peter Maydell
2015-01-30  9:54             ` Daniel P. Berrange
2015-01-30 10:16               ` Laszlo Ersek
2015-01-30 10:29               ` Peter Maydell
2015-01-30 10:48                 ` Daniel P. Berrange
2015-01-30 10:54                   ` Peter Maydell
2015-01-30 11:32                     ` Peter Maydell
2015-01-30 11:39                     ` Laszlo Ersek
2015-01-30 11:42                       ` Peter Maydell
2015-01-30 11:38                   ` Laszlo Ersek
2015-01-30 11:40                     ` Peter Maydell
2015-01-30 11:48                       ` Laszlo Ersek
2015-01-30 11:50                         ` Peter Maydell
2015-01-29 19:09     ` Richard W.M. Jones
2015-01-29 19:28       ` Peter Maydell
2015-01-29 19:35       ` Laszlo Ersek [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=54CA8B74.3010706@redhat.com \
    --to=lersek@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rjones@redhat.com \
    /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).