qemu-patch-raspberry4/target-ppc
Greg Kurz 3a4b791b4c target-ppc: kvm: fix floating point registers sync on little-endian hosts
On VSX capable CPUs, the 32 FP registers are mapped to the high-bits
of the 32 first VSX registers. So if you have:

VSR31 = (uint128) 0x0102030405060708090a0b0c0d0e0f00

then

FPR31 = (uint64) 0x0102030405060708

The kernel stores the VSX registers in the fp_state struct following the
host endian element ordering.

On big-endian:

fp_state.fpr[31][0] = 0x0102030405060708
fp_state.fpr[31][1] = 0x090a0b0c0d0e0f00

On little-endian:

fp_state.fpr[31][0] = 0x090a0b0c0d0e0f00
fp_state.fpr[31][1] = 0x0102030405060708

The KVM_GET_ONE_REG and KVM_SET_ONE_REG ioctls preserve this ordering, but
QEMU considers it as big-endian and always copies element [0] to the
fpr[] array and element [1] to the vsr[] array. This does not work with
little-endian hosts, and you will get:

(qemu) p $f31
0x90a0b0c0d0e0f00

instead of:

(qemu) p $f31
0x102030405060708

This patch fixes the element ordering for little-endian hosts.

Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-01-30 23:37:37 +11:00
..
arch_dump.c ppc: Clean up includes 2016-01-29 15:07:22 +00:00
cpu-models.c target-ppc: Use sensible POWER8/POWER8E versions 2016-01-30 23:36:16 +11:00
cpu-models.h target-ppc: Use sensible POWER8/POWER8E versions 2016-01-30 23:36:16 +11:00
cpu-qom.h dump: qemunotes aren't commonly needed 2016-01-15 14:40:24 +00:00
cpu.h ppc: Clean up error handling in ppc_set_compat() 2016-01-30 23:37:37 +11:00
dfp_helper.c ppc: Clean up includes 2016-01-29 15:07:22 +00:00
excp_helper.c ppc: Clean up includes 2016-01-29 15:07:22 +00:00
fpu_helper.c ppc: Clean up includes 2016-01-29 15:07:22 +00:00
gdbstub.c ppc: Clean up includes 2016-01-29 15:07:22 +00:00
helper.h target-ppc: Introduce tbegin 2015-01-07 16:16:27 +01:00
helper_regs.h PPC: Only enter MSR_POW when no interrupts pending 2014-04-08 11:20:05 +02:00
int_helper.c ppc: Clean up includes 2016-01-29 15:07:22 +00:00
kvm-stub.c ppc: Clean up includes 2016-01-29 15:07:22 +00:00
kvm.c target-ppc: kvm: fix floating point registers sync on little-endian hosts 2016-01-30 23:37:37 +11:00
kvm_ppc.h ppc: Let kvmppc_reset_htab() return 0 for !CONFIG_KVM 2015-11-11 13:29:04 +11:00
machine.c target-ppc: use cpu_write_xer() helper in cpu_post_load 2016-01-30 23:36:16 +11:00
Makefile.objs kvm_ppc: remove kvmppc_timer_hack 2015-09-20 22:48:38 +02:00
mem_helper.c ppc: Clean up includes 2016-01-29 15:07:22 +00:00
mfrom_table.c find -type f | xargs sed -i 's/[\t ]$//g' # on most files 2007-09-16 21:08:06 +00:00
mfrom_table_gen.c ppc: Clean up includes 2016-01-29 15:07:22 +00:00
misc_helper.c ppc: Clean up includes 2016-01-29 15:07:22 +00:00
mmu-hash32.c ppc: Clean up includes 2016-01-29 15:07:22 +00:00
mmu-hash32.h target-ppc: Use PowerPCCPU in PowerPCCPUClass::handle_mmu_fault hook 2014-03-13 19:20:48 +01:00
mmu-hash64.c ppc: Clean up includes 2016-01-29 15:07:22 +00:00
mmu-hash64.h target-ppc: Use right page size with hash table lookup 2015-03-09 14:59:53 +01:00
mmu_helper.c ppc: Clean up includes 2016-01-29 15:07:22 +00:00
monitor.c ppc: Clean up includes 2016-01-29 15:07:22 +00:00
STATUS target-ppc: remove powerpc 970gx 2014-03-05 03:06:23 +01:00
timebase_helper.c ppc: Clean up includes 2016-01-29 15:07:22 +00:00
translate.c ppc: Clean up includes 2016-01-29 15:07:22 +00:00
translate_init.c ppc: Clean up error handling in ppc_set_compat() 2016-01-30 23:37:37 +11:00
user_only_helper.c ppc: Clean up includes 2016-01-29 15:07:22 +00:00