From: "Michael S. Tsirkin" <mst@redhat.com>
To: Dave Airlie <airlied@gmail.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
Paolo Bonzini <pbonzini@redhat.com>,
Gerd Hoffmann <kraxel@redhat.com>,
Anthony Liguori <aliguori@amazon.com>,
Dave Airlie <airlied@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 3/4] virtio-gpu: v0.3 of the virtio based GPU code.
Date: Mon, 17 Mar 2014 13:01:56 +0200 [thread overview]
Message-ID: <20140317110156.GB32017@redhat.com> (raw)
In-Reply-To: <CAPM=9tyUkLQD54CG4WZCRWqHVuk8776hXc5t50crnht4QyEMrg@mail.gmail.com>
On Mon, Mar 17, 2014 at 02:36:37PM +1000, Dave Airlie wrote:
> On Thu, Mar 13, 2014 at 8:40 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> > Il 12/03/2014 21:26, Michael S. Tsirkin ha scritto:
> >>>
> >>> +Event queue:
> >>> +The only current event passed is a message to denote the host
> >>> +wants to update the layout of the screens. It contains the same
> >>> +info as the response to VIRTGPU_CMD_GET_DISPLAY_INFO.
> >
> >
> > I wonder if an event queue is the best mechanism if you can get the same
> > info from a command anyway. For virtio-scsi I used a queue because I needed
> > to specify which target or LUN the event applied to, but here you do not
> > need it and a queue is susceptible to dropped events.
> >
> > Perhaps a configuration field is better, like this:
> >
> > u32 events_read;
> > u32 events_clear;
> >
> > A new event sets a bit in events_read and generates a configuration change
> > interrupt. The guest should never write to events_read.
> >
> > Writing to events_clear has the side effect of the device doing "events_read
> > &= ~events_clear". We cannot have R/W1C fields in virtio, but this
> > approximation is good enough.
> >
> > When the guest receives a configuration change interrupt, it reads
> > event_read. If it is nonzero, it writes the same value it read to
> > events_clear, and sends the necessary commands to the card in order to
> > retrieve the event data. It can then read again event_read, and loop if it
> > is again nonzero.
> >
>
> I steered away from using config space for anything for the normal
> operation of the GPU after looking at overheads and hearing from S390
> people that config space has some special properties on their hw,
>
> The number of these events should be small in a running system, and
> I'm not sure how we'd lose one.
>
> Dave.
I think Paolo refers to a case where these events
arrive faster than guest can handle them.
As long as there's a single event like this,
it seems possible to avoid such under-runs by guest,
by first making a new buffer available, then processing
a used buffer.
If we want this extendable to multiple events,
make guest prepend an out buffer with a header, saying what kind of
event is expected in a given buffer.
Yes, config space is slow and should be avoided for
normal operation. I'm not sure how common this
specific operation is. For reporting guest errors
config space has some advantages as it can
be read even if driver/device communication
is completely wedged.
--
MST
next prev parent reply other threads:[~2014-03-17 11:02 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-12 12:55 [Qemu-devel] [PATCH 0/4] vga: new display devices Gerd Hoffmann
2014-03-12 12:55 ` [Qemu-devel] [PATCH 1/4] vga: allow non-global vmstate Gerd Hoffmann
2014-03-12 12:55 ` [Qemu-devel] [PATCH 2/4] vga: add secondary stdvga variant Gerd Hoffmann
2014-03-12 13:11 ` Eric Blake
2014-03-12 12:55 ` [Qemu-devel] [PATCH 3/4] virtio-gpu: v0.3 of the virtio based GPU code Gerd Hoffmann
2014-03-12 20:26 ` Michael S. Tsirkin
2014-03-13 9:08 ` Gerd Hoffmann
2014-03-14 11:13 ` Gerd Hoffmann
2014-03-16 12:21 ` Michael S. Tsirkin
2014-03-13 10:40 ` Paolo Bonzini
2014-03-14 11:18 ` Gerd Hoffmann
2014-03-16 12:28 ` Michael S. Tsirkin
2014-03-17 4:36 ` Dave Airlie
2014-03-17 5:21 ` Dave Airlie
2014-03-17 9:50 ` Paolo Bonzini
2014-03-17 9:27 ` Paolo Bonzini
2014-03-17 11:01 ` Michael S. Tsirkin [this message]
2014-03-12 12:55 ` [Qemu-devel] [PATCH 4/4] virtio-vga: v1 Gerd Hoffmann
2014-03-12 13:55 ` [Qemu-devel] [PATCH 0/4] vga: new display devices Laszlo Ersek
2014-03-12 15:47 ` Gerd Hoffmann
2014-03-12 18:14 ` Laszlo Ersek
2014-03-13 8:22 ` Gerd Hoffmann
2014-03-13 8:41 ` Laszlo Ersek
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=20140317110156.GB32017@redhat.com \
--to=mst@redhat.com \
--cc=airlied@gmail.com \
--cc=airlied@redhat.com \
--cc=aliguori@amazon.com \
--cc=kraxel@redhat.com \
--cc=pbonzini@redhat.com \
--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).