All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: Farhan Ali <alifm@linux.vnet.ibm.com>, qemu-devel@nongnu.org
Cc: borntraeger@de.ibm.com, thuth@redhat.com, cohuck@redhat.com
Subject: Re: [Qemu-devel] [PATCH v1 1/2] virtio_gpu: Handle endian conversion
Date: Thu, 14 Sep 2017 10:44:13 +0200	[thread overview]
Message-ID: <1505378653.31557.5.camel@redhat.com> (raw)
In-Reply-To: <5678da9e-ddea-1d31-77ff-8ea52ee30ca9@linux.vnet.ibm.com>

On Wed, 2017-09-13 at 11:53 -0400, Farhan Ali wrote:
> 
> On 09/13/2017 04:13 AM, Gerd Hoffmann wrote:
> > Please move this to a helper function, maybe by updating the
> > VIRTIO_GPU_FILL_CMD macro.
> > 
> > The header fields should be byteswapped too.  As most structs have
> > 32bit fields only (with the exception of hdr.fence_id) you should
> > be
> > able to create a generic byteswap function which only needs the
> > struct
> > size as argument and handles all structs without addresses/offsets
> > (which are 64bit fields).
> 
> I am not sure if I understand what you mean here. Since struct 
> virtio_gpu_ctrl_hdr is part of every struct, so any such function
> would also need to handle the case of hdr.fence_id, right?

Yes, but that is common in all structs.  You can have one function to
handle the header, one generic function (calls the header function for
the header and just does 32bit byteswaps for everything else), one
specific function for each operation which has a 64bit address
somewhere in the struct (which again can use the header function for
the header).

cheers,
  Gerd

  reply	other threads:[~2017-09-14  8:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-12 14:26 [Qemu-devel] [PATCH v1 0/2] Virtio GPU for S390 Farhan Ali
2017-09-12 14:26 ` [Qemu-devel] [PATCH v1 1/2] virtio_gpu: Handle endian conversion Farhan Ali
2017-09-13  8:13   ` Gerd Hoffmann
2017-09-13 15:53     ` Farhan Ali
2017-09-14  8:44       ` Gerd Hoffmann [this message]
2017-09-12 14:26 ` [Qemu-devel] [PATCH v1 2/2] virtio-gpu-ccw: Create a virtio gpu device for the ccw bus Farhan Ali
2017-09-13 12:09   ` David Hildenbrand
2017-09-13 14:53     ` Gerd Hoffmann
2017-09-13 18:22     ` Thomas Huth
2017-09-13 14:31   ` Halil Pasic
2017-09-13 19:00 ` [Qemu-devel] [PATCH v1 0/2] Virtio GPU for S390 Thomas Huth
2017-09-13 19:11   ` Farhan Ali
2017-09-14  8:46   ` Gerd Hoffmann

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=1505378653.31557.5.camel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=alifm@linux.vnet.ibm.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.