qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>,
	Gerd Hoffmann <kraxel@redhat.com>
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"QEMU Developers" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] virtio-gpu doesn't build if you do a linux-headers update from kvm/next
Date: Thu, 5 Nov 2015 18:15:04 +0100	[thread overview]
Message-ID: <563B8E98.9050702@redhat.com> (raw)
In-Reply-To: <CAFEAcA8_jZeY-5S+=r7iPCbLTeExUdZWd_fCPchLdYN6xbVAKQ@mail.gmail.com>

On 11/05/15 16:11, Peter Maydell wrote:
> On 5 November 2015 at 14:58, Gerd Hoffmann <kraxel@redhat.com> wrote:
>> On Do, 2015-11-05 at 14:45 +0000, Peter Maydell wrote:
>>> On 5 November 2015 at 14:42, Gerd Hoffmann <kraxel@redhat.com> wrote:
>>>> Chicken & egg issue in that case because airlied (linux kernel drm
>>>> maintainer) asked to have the qemu changes merged before taking the
>>>> virtio-gpu pull request.  So I had no other chance than creating the
>>>> patches with not-yet upstream virtio header changes ...
>>>
>>> Hmm. If I'd realised that at the time I'd have pushed back on it.
>>> We should never take code that relies on upstream kernel
>>> ABI that hasn't been accepted by the maintainer yet.
>>
>> The reason airlied asked for qemu being upstream first is to avoid
>> having code in the kernel tree not accepted by qemu yet ...
>>
>> So, one of the two has to go first ;)
> 
> Right, but this isn't a symmetrical arrangement. If on the
> kernel side the ABI is changed before it's finally accepted
> into mainline, that means that any QEMU that got released with
> changes made on the basis of not-yet-upstream kernel patches
> will be broken. But if the kernel accepts code which needs a
> not-yet-in-qemu feature to be useful, that doesn't break the
> kernel, because the kernel isn't actually dependent on the
> QEMU changes. That's why I think the kernel side of the ABI
> always needs to go first (the kernel provides the ABI, QEMU
> uses it, never the other way around).

I could be confused about what ABI means, but in case of *guest* kernel
drivers (for virtual devices provided by QEMU), the dependency seems to
be the opposite.

Alex mentioned "kernel uapi includes" up-thread. To be honest, I don't
know what "uapi" means here. Are those headers there to be relied upon
by userspace processes that need services from the kernel? That would
match your above argument.

However, I found the following files there:

include/uapi/linux/virtio_console.h
include/uapi/linux/virtio_input.h
include/uapi/linux/virtio_net.h
include/uapi/linux/virtio_types.h
include/uapi/linux/virtio_9p.h
include/uapi/linux/virtio_balloon.h
include/uapi/linux/virtio_scsi.h
include/uapi/linux/virtio_rng.h
include/uapi/linux/virtio_ids.h
include/uapi/linux/virtio_ring.h
include/uapi/linux/virtio_pci.h
include/uapi/linux/virtio_gpu.h
include/uapi/linux/virtio_config.h
include/uapi/linux/virtio_blk.h

Which kinda confuses me. I cannot imagine that a userspace process
should depend on these, for the purpose of consuming kernel services.
Instead, QEMU should *definitely* dictate in this case, because it
provides the service (the hardware), and Linux has drivers that consume
that service.

Consider: there are virtio drivers in SeaBIOS, OVMF, and Windows too.
Should QEMU include their header files as well? I think not.

In other words, I agree with your argument, and the "QEMU depends on the
kernel" statement, as far as QEMU plays the role of a userspace process
that consumes the *host* kernel's services (VFIO, KVM, ...).

However, when QEMU provides the *hardware* (which is hopefully described
by an industry standard, or at least by some kind of independent
documentation), then the *guest* kernel plays the consumer role (as do
other non-Linux-kernel guests), and in that case the QEMU changes should
go in first (hopefully after testing them with the under-development
guest code, of course).

Hence, I'm leaning to think that the above virtio header files should
not be under uapi *at all*. They should be under "include/virtio", and
should be private to the guest drivers.

--*--

I think we had the same discussion when Wei was working on SMBIOS 3.0
for ARM. In
<http://thread.gmane.org/gmane.comp.emulators.qemu/353282/focus=354806>,
you asked

"Is support for this all in the mainline kernel yet?"

I didn't really understand that question -- it didn't matter. QEMU as a
*platform* was learning how to provide a service that was governed by an
industry standard. The status of *guest* kernel support (and of guest
utility support) was irrelevant, in my opinion.

Thanks
Laszlo

  reply	other threads:[~2015-11-05 17:15 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-05 11:42 [Qemu-devel] virtio-gpu doesn't build if you do a linux-headers update from kvm/next Peter Maydell
2015-11-05 11:49 ` Paolo Bonzini
2015-11-05 12:13 ` Gerd Hoffmann
2015-11-05 12:32   ` Peter Maydell
2015-11-05 13:23     ` Christian Borntraeger
2015-11-05 13:44       ` Peter Maydell
2015-11-05 13:46         ` Christian Borntraeger
2015-11-05 14:01         ` Paolo Bonzini
2015-11-05 14:30           ` Peter Maydell
2015-11-05 14:52             ` Peter Maydell
2015-11-05 15:03               ` Paolo Bonzini
2015-11-05 14:58             ` Paolo Bonzini
2015-11-05 18:56               ` Peter Maydell
2015-11-05 13:48     ` Laszlo Ersek
2015-11-05 15:52       ` Alex Bennée
2015-11-05 17:05         ` Laszlo Ersek
2015-11-05 17:09           ` Paolo Bonzini
2015-11-05 14:42     ` Gerd Hoffmann
2015-11-05 14:45       ` Peter Maydell
2015-11-05 14:58         ` Gerd Hoffmann
2015-11-05 15:11           ` Peter Maydell
2015-11-05 17:15             ` Laszlo Ersek [this message]
2015-11-05 18:13               ` Cornelia Huck
2015-11-05 18:51                 ` Laszlo Ersek
2015-11-06 16:34               ` Alex Bennée
2015-11-06 16:43               ` Peter Maydell

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=563B8E98.9050702@redhat.com \
    --to=lersek@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=kraxel@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.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).