lkml.org 
[lkml]   [2015]   [Jul]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PULL] virtio/vhost: cross endian support
On Wed, Jul 01, 2015 at 12:02:50PM -0700, Linus Torvalds wrote:
> On Wed, Jul 1, 2015 at 2:31 AM, Michael S. Tsirkin <mst@redhat.com> wrote:
> > virtio/vhost: cross endian support
>
> Ugh. Does this really have to be dynamic?
>
> Can't virtio do the sane thing, and just use a _fixed_ endianness?
>
> Doing a unconditional byte swap is faster and simpler than the crazy
> conditionals. That's true regardless of endianness, but gets to be
> even more so if the fixed endianness is little-endian, since BE is
> not-so-slowly fading from the world.
>
> Linus

Yea, well - support for legacy BE guests on the new LE hosts is
exactly the motivation for this.

I dislike it too, but there are two redeeming properties that
made me merge this:

1. It's a trivial amount of code: since we wrap host/guest accesses
anyway, almost all of it is well hidden from drivers.

2. Sane platforms would never set flags like VHOST_CROSS_ENDIAN_LEGACY -
and when it's clear, there's zero overhead (as some point it was
tested by compiling with and without the patches, got the same
stripped binary).

Maybe we could create a Kconfig symbol to enforce point (2): prevent
people from enabling it e.g. on x86. I will look into this - but it can
be done by a patch on top, so I think this can be merged as is.

Or do you know of someone using kernel with all config options enabled
undiscriminately?

Thanks,

--
MST


\
 
 \ /
  Last update: 2015-07-02 08:21    [W:0.162 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site