]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc: Cleanup KVM emulated load/store endian handling
authorDavid Gibson <david@gibson.dropbear.id.au>
Tue, 3 Feb 2015 05:36:24 +0000 (16:36 +1100)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 24 Mar 2015 02:33:51 +0000 (13:33 +1100)
commit3a94d693fb0ef1628b1b2d8a1737c1e0461d22f1
treec5b1fd6044676ffe9ba10b1929762f3b8e163a40
parentc197cd5616d615f7cab6a5b12418e97b18818339
powerpc: Cleanup KVM emulated load/store endian handling

Sometimes the KVM code on powerpc needs to emulate load or store
instructions from the guest, which can include both normal and byte
reversed forms.

We currently (AFAICT) handle this correctly, but some variable names are
very misleading.  In particular we use "is_bigendian" in several places to
actually mean "is the IO the same endian as the host", but we now support
little-endian powerpc hosts.  This also ties into the misleadingly named
ld_le*() and st_le*() functions, which in fact always byteswap, even on
an LE host.

This patch cleans this up by renaming to more accurate "host_swabbed", and
uses the generic swab*() functions instead of the powerpc specific and
misleadingly named ld_le*() and st_le*() functions.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/include/asm/kvm_host.h
arch/powerpc/kvm/powerpc.c