linux-stable/arch/powerpc
Cyril Bur 3df76a9dcc powerpc/pseries: Fix endian problems with LE migration
RTAS events require arguments be passed in big endian while hypercalls
have their arguments passed in registers and the values should therefore
be in CPU endian.

The "ibm,suspend_me" 'RTAS' call makes a sequence of hypercalls to setup
one true RTAS call. This means that "ibm,suspend_me" is handled
specially in the ppc_rtas() syscall.

The ppc_rtas() syscall has its arguments in big endian and can therefore
pass these arguments directly to the RTAS call. "ibm,suspend_me" is
handled specially from within ppc_rtas() (by calling rtas_ibm_suspend_me())
which has left an endian bug on little endian systems due to the
requirement of hypercalls. The return value from rtas_ibm_suspend_me()
gets returned in cpu endian, and is left unconverted, also a bug on
little endian systems.

rtas_ibm_suspend_me() does not actually make use of the rtas_args that
it is passed. This patch removes the convoluted use of the rtas_args
struct to pass params to rtas_ibm_suspend_me() in favour of passing what
it needs as actual arguments. This patch also ensures the two callers of
rtas_ibm_suspend_me() pass function parameters in cpu endian and in the
case of ppc_rtas(), converts the return value.

migrate_store() (the other caller of rtas_ibm_suspend_me()) is from a
sysfs file which deals with everything in cpu endian so this function
only underwent cleanup.

This patch has been tested with KVM both LE and BE and on PowerVM both
LE and BE. Under QEMU/KVM the migration happens without touching these
code pathes.

For PowerVM there is no obvious regression on BE and the LE code path
now provides the correct parameters to the hypervisor.

Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2015-01-27 14:03:53 +11:00
..
boot Merge remote-tracking branch 'scottwood/next' into next 2014-11-18 17:00:38 +11:00
configs powerpc/ps3: Enable CONFIG_PS3_REPOSITORY_WRITE in ps3_defconfig 2015-01-22 17:31:22 +11:00
crypto crypto: powerpc - replace memset by memzero_explicit 2014-12-02 22:55:50 +08:00
include powerpc/pseries: Fix endian problems with LE migration 2015-01-27 14:03:53 +11:00
kernel powerpc/pseries: Fix endian problems with LE migration 2015-01-27 14:03:53 +11:00
kvm powerpc/kvm: Create proper names for the kvm_host_state PMU fields 2014-12-29 15:45:55 +11:00
lib powerpc: Add 64bit optimised memcmp 2015-01-23 14:02:55 +11:00
math-emu
mm mm/debug-pagealloc: make debug-pagealloc boottime configurable 2014-12-13 12:42:48 -08:00
net PPC: bpf_jit_comp: Unify BPF_MOD | BPF_X and BPF_DIV | BPF_X 2014-11-18 13:20:09 -05:00
oprofile powerpc updates for 3.19 2014-12-11 17:48:14 -08:00
perf power/perf/hv-24x7: Use kmem_cache_free() instead of kfree 2014-12-12 16:06:13 +11:00
platforms powerpc/pseries: Fix endian problems with LE migration 2015-01-27 14:03:53 +11:00
sysdev powerpc: Replace cpumask_weight(cpu_possible_mask) with num_possible_cpus() 2015-01-23 14:02:51 +11:00
xmon powerpc/xmon: use isspace/isxdigit/isalnum from linux/ctype.h 2014-12-29 15:45:43 +11:00
Kconfig gcov: enable GCOV_PROFILE_ALL from ARCH Kconfigs 2014-12-13 12:42:51 -08:00
Kconfig.debug Patch queue for ppc - 2014-08-01 2014-08-05 09:58:11 +02:00
Makefile powerpc: Add POWER8 CPU selection 2014-09-25 23:14:49 +10:00
relocs_check.pl