qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: Alon Levy <alevy@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 3/3] hw/qxl: support client monitor configuration via device
Date: Tue, 11 Sep 2012 14:10:00 +0200	[thread overview]
Message-ID: <504F2A18.3000006@redhat.com> (raw)
In-Reply-To: <1638054245.33035745.1347362972455.JavaMail.root@redhat.com>

On 09/11/12 13:29, Alon Levy wrote:
>> Hi,
>> 
>>>> I don't think an explicit handshake via 
>>>> QXL_IO_CLIENT_MONITORS_CONFIG_DONE is a good idea.
>>> 
>>> Why? I don't see the below as being better - it just moves the 
>>> checking to the guest, and racily.
>> 
>> It is more robust.
> 
> I suggested a way for it to be as robust - I take robust to mean "no
> lost messages except for intermediate ones", which both solutions
> suffer from anyway.
> 
>> We don't have to keep state in qxl for the handshake
> You mean it's preferable to have state on the device
> (QXLRom::client_monitors_config_updating) rather then private qxl
> device state?

The difference is that QXLRom::client_monitors_config_updating is
one-way, it informs the guest what qemu is doing.

qxl->client_monitors_config_isr_in_progress depends on the guest doing
the handshake correctly.

>> It is also closer to how real hardware handles this.
> 
> I don't know how it is in real hardware.

Modern hardware would stuff this into an event queue, simliar to a
virtqueue.  Raise a ring-full IRQ in case it can't.

Two monitor config updates in a row would simply result in two event
queue entries.

Setting up a new spice ring just for that is probably overkill though.
But (maybe you've seen it) for a virtio-based qxl design I would clearly
pass that kind of data as virtqueue payload in a event queue, so a new
update wouldn't overwrite the previous one.

>> When qemu updated the data while the guest was reading it one of
>> the two conditions will be true: either (3a) if qemu is still busy
>> updating or (4) if qemu finished updating.
> 
> Making things more complicated in the host, qemu, means making the
> kernel driver in the guest simpler, so even though you have a good
> solution for the race you discovered I don't see why the alternative
> is worse. (answered point to point above).

Real hardware tends to be the other way around.

>> I was thinking about spice-vdagent detecting the qxl kms driver is 
>> active, then just ignore all VDAgentMonitorsConfig messages 
>> unconditionally if this happens to be the case, so there will be
>> no race. But if you think it is too complicated, no problem.
> 
> This sounds like a good idea, didn't think of it. But that leaves me
> fixing the vdagent code now :) Also, I guess I still think doing just
> one message looks simpler.
> 
>> Was just an idea.  Notifying spice-server which way to route is
>> fine with me too.
> 
> OK, if it's all the same to you I'll stick with spice-server routing
> the message.
> 
> Overall, if you find this tedious I will switch to your suggestion
> since it isn't such a big deal.

I think sending both ways unconditionally could make things easier.

For starters you'll have valid data in QXLRom unconditionally, even in
case the spice client has sent it before the qxl kms driver was loaded
and signaled support (this will only work in case the update is
handshake-free).

You have a better view on the big picture though, how this all interacts
vdagent starting and vdagent capability negotiation.

cheers,
  Gerd

  reply	other threads:[~2012-09-11 12:10 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-11  6:56 [Qemu-devel] [PATCH 1/3] hw/qxl: tracing fixes Alon Levy
2012-09-11  6:56 ` [Qemu-devel] [PATCH 2/3] hw/qxl: add support for QXL_IO_CAPABILITIES_SET Alon Levy
2012-09-11  6:56 ` [Qemu-devel] [PATCH 3/3] hw/qxl: support client monitor configuration via device Alon Levy
2012-09-11  8:45   ` Gerd Hoffmann
2012-09-11  9:35     ` Alon Levy
2012-09-11 11:05       ` Gerd Hoffmann
2012-09-11 11:29         ` Alon Levy
2012-09-11 12:10           ` Gerd Hoffmann [this message]
2012-09-11 11:43     ` Hans de Goede
2012-09-11 12:03       ` Alon Levy
2012-09-11 12:10         ` Alon Levy
2012-09-11 12:16         ` Hans de Goede
2012-09-11 12:23           ` Gerd Hoffmann
2012-09-11 12:37             ` Alon Levy
2012-09-11 13:03               ` Gerd Hoffmann
2012-09-11 13:05                 ` Alon Levy
2012-09-11 13:24                   ` Hans de Goede
2012-09-11 13:55                     ` Alon Levy
  -- strict thread matches above, loose matches on Subject: below --
2012-09-12 13:13 [Qemu-devel] [PATCH 0/3] client monitors config support Alon Levy
2012-09-12 13:13 ` [Qemu-devel] [PATCH 3/3] hw/qxl: support client monitor configuration via device Alon Levy

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=504F2A18.3000006@redhat.com \
    --to=kraxel@redhat.com \
    --cc=alevy@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).