Re: [RFC PATCH 2/4] vhost: add byteswap routines

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 29 Oct 2014 09:38:43 +0100
Cédric Le Goater <clg@xxxxxxxxxx> 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@xxxxxxxxxx>
> ---
> 
> 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.

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux