From: Halil Pasic <pasic@linux.ibm.com>
To: Cornelia Huck <cohuck@redhat.com>
Cc: "Thomas Huth" <thuth@redhat.com>,
"Boris Fiuczynski" <fiuczy@linux.ibm.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Eduardo Habkost" <ehabkost@redhat.com>,
"David Hildenbrand" <david@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
qemu-devel@nongnu.org, "Bruce Rogers" <brogers@suse.com>,
"Christian Borntraeger" <borntraeger@de.ibm.com>,
qemu-s390x@nongnu.org, "Gerd Hoffmann" <kraxel@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: Re: [PATCH v3 1/1] hw/s390x: modularize virtio-gpu-ccw
Date: Fri, 5 Mar 2021 13:05:14 +0100 [thread overview]
Message-ID: <20210305130514.18589602.pasic@linux.ibm.com> (raw)
In-Reply-To: <20210305125442.6c582681.cohuck@redhat.com>
On Fri, 5 Mar 2021 12:54:42 +0100
Cornelia Huck <cohuck@redhat.com> wrote:
> On Tue, 2 Mar 2021 18:35:44 +0100
> Halil Pasic <pasic@linux.ibm.com> wrote:
>
> > Since the virtio-gpu-ccw device depends on the hw-display-virtio-gpu
> > module, which provides the type virtio-gpu-device, packaging the
> > hw-display-virtio-gpu module as a separate package that may or may not
> > be installed along with the qemu package leads to problems. Namely if
> > the hw-display-virtio-gpu is absent, qemu continues to advertise
> > virtio-gpu-ccw, but it aborts not only when one attempts using
> > virtio-gpu-ccw, but also when libvirtd's capability probing tries
> > to instantiate the type to introspect it.
> >
> > Let us thus introduce a module named hw-s390x-virtio-gpu-ccw that
> > is going to provide the virtio-gpu-ccw device. The hw-s390x prefix
> > was chosen because it is not a portable device. Because registering
> > virtio-gpu-ccw would make non-s390x emulator fail due to a missing
> > parent type, if built as a module, before registering it, we check
> > if the ancestor types are already registered.
> >
> > With virtio-gpu-ccw built as a module, the correct way to package a
> > modularized qemu is to require that hw-display-virtio-gpu must be
> > installed whenever the module hw-s390x-virtio-gpu-ccw.
> >
> > The definition S390_ADAPTER_SUPPRESSIBLE was moved to "cpu.h", per
> > suggestion of Thomas Huth. From interface design perspective, IMHO, not
> > a good thing as it belongs to the public interface of
> > css_register_io_adapters(). We did this because CONFIG_KVM requeires
> > NEED_CPU_H and Thomas, and other commenters did not like the
> > consequences of that.
> >
> > Moving the interrupt related declarations to s390_flic.h was suggested
> > by Cornelia Huck.
> >
> > Signed-off-by: Halil Pasic <pasic@linux.ibm.com>
> > ---
> >
> > As explained in [1] the previous idea of type_register_mayfail() does
> > not work. The next best thing is to check if all types we need are
> > already registered before registering virtio-gpu-ccw from the module. It
> > is reasonable to assume that when the module is loaded, the ancestors
> > are already registered (which is not the case if the device is a
> > built in one).
> >
> > The alternatives to this approch I could identify are:
> > * A poor mans version of this which checks for the parent
> > * Emulator specific modules:
> > * An emulator specific directory within the modules directory which
> > is ignored by the other emulators.
> > * A way to tell the shared util library the name of this directory,
> > and the code to check it if set.
> > * Build hw-s390x-virtio-gpu-ccw so it lands in this special directory
> > in the build tree, and install it there as well.
> > I've spend some time with looking into this, but I came to the
> > conclusion that the two latter points look hairy.
> >
> > [1] https://lore.kernel.org/qemu-devel/20210222125548.346166-1-pasic@linux.ibm.com/T/#maf0608df5479f87b23606f01f732740d2617b458
> > ---
> > hw/s390x/meson.build | 7 ++++-
> > hw/s390x/virtio-ccw-gpu.c | 5 ++++
> > include/hw/s390x/css.h | 7 -----
> > include/hw/s390x/s390_flic.h | 3 +++
> > include/qom/object.h | 10 ++++++++
> > qom/object.c | 50 ++++++++++++++++++++++++++++++++++++
> > target/s390x/cpu.h | 9 ++++---
> > util/module.c | 1 +
> > 8 files changed, 81 insertions(+), 11 deletions(-)
>
> The s390x part looks fine, but I'm not that well versed in the object
> and module stuff...
>
Thanks Conny! Gerd was so kind to provide review from that perspective.
I'm hoping on his continued feedback :)
Have a nice weekend!
next prev parent reply other threads:[~2021-03-05 12:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-02 17:35 [PATCH v3 1/1] hw/s390x: modularize virtio-gpu-ccw Halil Pasic
2021-03-05 11:25 ` Halil Pasic
2021-03-05 11:54 ` Cornelia Huck
2021-03-05 12:05 ` Halil Pasic [this message]
2021-03-05 21:46 ` Eduardo Habkost
2021-03-08 21:19 ` Halil Pasic
2021-03-09 12:45 ` Gerd Hoffmann
2021-03-09 13:21 ` Daniel P. Berrangé
2021-03-13 2:09 ` Halil Pasic
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=20210305130514.18589602.pasic@linux.ibm.com \
--to=pasic@linux.ibm.com \
--cc=berrange@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=brogers@suse.com \
--cc=cohuck@redhat.com \
--cc=david@redhat.com \
--cc=ehabkost@redhat.com \
--cc=fiuczy@linux.ibm.com \
--cc=kraxel@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=thuth@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).