On 15 April 2014 14:22, Greg Kurz <gk...@linux.vnet.ibm.com> wrote: > On Tue, 15 Apr 2014 13:35:03 +0200 > Alexander Graf <ag...@suse.de> wrote: >> That would defeat the purpose - the reason to have the helper inlined is >> to remove the conditional branch for x86. >> > > Sure but on the other hand, Peter does not like the idea of moving virtio > to compiled-per-target... these look like contradictory requests to me... :-\ > Unless I have missed something, we have to settle whether we favor > building/testing > time or performance of non-{powerpc,arm} targets to have legacy virtio > supporting > LE powerpc and BE arm...
To repeat my remarks from IRC: this weirdo endianness behaviour was a dumb spec decision, and dumb spec decisions have to be paid for. virtio 1.0 should fix this, so we can just suggest that anybody who really cares about performance down to avoiding conditional branches should switch to that, right? My suggestion was that: * virtio_is_big_endian should be a CPU object method * PPC (and eventually ARM) implement this by checking whatever the state flag is * base class implementation returns true/false based on TARGET_WORDS_BIGENDIAN * virtio devices call this method on current_cpu when the guest first touches/resets the virtio device, and cache the result thanks -- PMM