qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: Erlon Cruz <sombrafam@gmail.com>
Cc: "Avi Kivity" <avi@redhat.com>, "Alon Levy" <alevy@redhat.com>,
	"Andreas Färber" <afaerber@suse.de>,
	"Anthony Liguori" <anthony@codemonkey.ws>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Cirrus bugs vs endian: how two bugs cancel each other out
Date: Wed, 08 Aug 2012 08:18:54 +0200	[thread overview]
Message-ID: <502204CE.3000303@redhat.com> (raw)
In-Reply-To: <CAF+Cadsrg4-coPE0H5oVZnD9cMUDDhLAF6b4JFpEkAR+8VoJdw@mail.gmail.com>

  Hi,

>>> The only thing
>>> its missing is to fix the endianess for server/client handshaking.
>>
>> What exactly do you mean here?
> 
> Well that are negotiation messages configuring each channel, its
> capabilities, encryption keys , etc. After this negotiation, the
> server start to send SPICE data, which are already swapped by the
> marshallers.

Ah, so the initial handshake isn't covered by the generated marshallers.

>>> We have tested it first running
>>> spice sever tests in a PPC machine and then we run it in an experimental
>>> virtio-qxl driver we are working on.
>>
>> Huh?  How does this work?
> 
> Well, our first though was to minimize changes on xf86-video-qxl.
> [ ... ]

Keep in mind that the linux world is moving to kms & drm.  A virtual
hardware design trying to minimize the changes to todays userland X
driver may turn out to be not be the best pick long-term.  We also must
make sure it works for both linux and windows guests.  I suggest to
discuss the virtual hardware design @ qemu-devel and spice-devel.

>> The QXLCommand passed on to spice-server (via get_command callback) is
>> supposed to be little endian.
> 
> Actually the command endianness doesn't matter at this point once
> QXLCommand will be marshalled (and then swapped) before get to the
> wire.

Well, the flow of a command from the guest to the spice client looks
like this:

  (1) guest places the command into memory (QXLCommand, little endian)
      and queues it up (qxl uses its own ring format, but using virtio
      rings doesn't make a difference).
  (2) qemu takes the QXLCommand and passes it as-is to the spice-server.
  (3) spice-server parses and sanity-checks the command, also
      translates QXLCommand into internal representation (struct
      {Red,Spice}*), see server/red_parse_qxl.c.  It should also
      translate from little endian to native endian but doesn't yet.
  (4) spice-server can process the commands (in native byte order)
      locally in case the rendered screen is needed.  Happens for
      example if you ask for a screenshot via qemu monitor.
  (5) The generated marshaller code translates the command into wire
      format (and swaps again from native to little endian if needed).
  (6) The generated demarshaller code (in the client) translates back
      from the wire format to the internal representation (in native
      endian).
  (7) spice client renders the result.

/me wonders how this works for you with step #3 not byteswapping on
bigendian hosts.

Maybe the guest driver places the qxl commands in native endian instead
of big endian into memory?

cheers,
  Gerd

  reply	other threads:[~2012-08-08  6:19 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-30  6:24 [Qemu-devel] Cirrus bugs vs endian: how two bugs cancel each other out Benjamin Herrenschmidt
2012-07-30 10:08 ` Avi Kivity
2012-07-30 11:20   ` Benjamin Herrenschmidt
2012-07-30 11:25     ` Avi Kivity
2012-07-30 11:54       ` Benjamin Herrenschmidt
2012-07-30 11:58         ` Avi Kivity
2012-07-30 12:08           ` Benjamin Herrenschmidt
2012-07-30 12:15             ` Avi Kivity
2012-07-30 12:23               ` Benjamin Herrenschmidt
2012-07-30 16:24             ` Alon Levy
2012-07-30 20:19               ` Anthony Liguori
2012-07-30 22:24               ` Benjamin Herrenschmidt
2012-07-31  8:10                 ` Alon Levy
2012-08-01 14:35                 ` Avi Kivity
2012-08-06 12:57             ` Gerd Hoffmann
2012-07-30 13:18           ` Anthony Liguori
2012-07-30 13:30             ` Avi Kivity
2012-07-30 13:45               ` Anthony Liguori
2012-07-30 13:55                 ` Avi Kivity
2012-07-30 14:29                   ` Anthony Liguori
2012-07-30 14:36                     ` Avi Kivity
2012-07-30 16:01                       ` Anthony Liguori
2012-07-30 23:47                         ` Rusty Russell
2012-07-31  3:16                           ` Benjamin Herrenschmidt
2012-08-06 14:02                             ` Gerd Hoffmann
2012-08-06 21:13                               ` Benjamin Herrenschmidt
2012-08-01 23:29                         ` Andreas Färber
2012-08-06 13:47                         ` Gerd Hoffmann
2012-08-06 14:35                           ` Anthony Liguori
2012-07-31  8:20                     ` Alon Levy
2012-07-30 22:15                   ` Benjamin Herrenschmidt
2012-07-31  0:17                     ` Anthony Liguori
2012-07-31  3:26                       ` Benjamin Herrenschmidt
2012-08-06 13:20             ` Gerd Hoffmann
2012-08-06 21:16               ` Benjamin Herrenschmidt
2012-08-07  5:30                 ` Gerd Hoffmann
2012-08-07  6:07                   ` Benjamin Herrenschmidt
2012-07-30 16:19         ` Alon Levy
2012-08-01 15:42           ` Andreas Färber
2012-08-01 19:22             ` Anthony Liguori
2012-08-03  6:45               ` Alon Levy
2012-08-03 13:41                 ` Anthony Liguori
2012-08-07  7:00                   ` Alon Levy
2012-08-07  8:01                     ` Gerd Hoffmann
2012-08-07 13:05                       ` Erlon Cruz
2012-08-07 14:07                         ` Gerd Hoffmann
2012-08-07 19:43                           ` Erlon Cruz
2012-08-08  6:18                             ` Gerd Hoffmann [this message]
2012-08-08 14:14                               ` Erlon Cruz
2012-08-09  6:17                                 ` Gerd Hoffmann
2012-07-30 15:18 ` Blue Swirl
2012-07-30 15:30   ` Peter Maydell
2012-07-30 15:44     ` Blue Swirl
2012-07-31  8:44 ` ronnie sahlberg
2012-07-31 10:30   ` Benjamin Herrenschmidt

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=502204CE.3000303@redhat.com \
    --to=kraxel@redhat.com \
    --cc=afaerber@suse.de \
    --cc=alevy@redhat.com \
    --cc=anthony@codemonkey.ws \
    --cc=avi@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sombrafam@gmail.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).