public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: "Cédric Le Goater" <clg@fr.ibm.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, agraf@suse.de,
	paulus@samba.org, gkurz@linux.vnet.ibm.com, aik@ozlabs.ru
Subject: Re: [RFC PATCH 2/4] vhost: add byteswap routines
Date: Mon, 3 Nov 2014 16:38:22 +0100	[thread overview]
Message-ID: <20141103163822.5570c340.cornelia.huck@de.ibm.com> (raw)
In-Reply-To: <1414571925-16918-3-git-send-email-clg@fr.ibm.com>

On Wed, 29 Oct 2014 09:38:43 +0100
Cédric Le Goater <clg@fr.ibm.com> wrote:

> This patch adds a few helper routines around get_user and put_user
> to ease byteswapping.
> 
> Signed-off-by: Cédric Le Goater <clg@fr.ibm.com>
> ---
> 
> I am not sure these routines belong to this file. There is room for 
> improvement to remove the ugly  switch (sizeof(*(ptr))). Please 
> comment !
> 
>  drivers/vhost/vhost.c |   93 +++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 93 insertions(+)
> 

I'm wondering whether it would be a good idea to introduce generic
{get,put}_user_reversed() routines.

That way, you would push the switch (sizeof(*(ptr)) into uaccess code,
where it needs to be done anyway. It also makes it possible to add
optimizations there.

  reply	other threads:[~2014-11-03 15:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-29  8:38 [RFC PATCH 0/4] vhost_net: support for cross endian guests Cédric Le Goater
2014-10-29  8:38 ` [RFC PATCH 1/4] vhost: add VHOST_VRING_F_BYTESWAP flag Cédric Le Goater
2014-11-03 16:28   ` Michael S. Tsirkin
2014-10-29  8:38 ` [RFC PATCH 2/4] vhost: add byteswap routines Cédric Le Goater
2014-11-03 15:38   ` Cornelia Huck [this message]
2014-10-29  8:38 ` [RFC PATCH 3/4] vhost: byteswap virtqueue attributes Cédric Le Goater
2014-11-03 16:02   ` Cornelia Huck
2014-10-29  8:38 ` [RFC PATCH 4/4] vhost_net: byteswap virtio_net header Cédric Le Goater
2014-11-03 16:25   ` Michael S. Tsirkin
2014-11-03 16:23 ` [RFC PATCH 0/4] vhost_net: support for cross endian guests Michael S. Tsirkin
2014-11-04  8:07   ` Cedric Le Goater

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=20141103163822.5570c340.cornelia.huck@de.ibm.com \
    --to=cornelia.huck@de.ibm.com \
    --cc=agraf@suse.de \
    --cc=aik@ozlabs.ru \
    --cc=clg@fr.ibm.com \
    --cc=gkurz@linux.vnet.ibm.com \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=paulus@samba.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