qemu-patch-raspberry4/target-ppc
Greg Kurz d4aed70099 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>
(cherry picked from commit 3a4b791b4c)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2016-03-15 12:10:47 -05:00
..
Makefile.objs kvm_ppc: remove kvmppc_timer_hack 2015-09-20 22:48:38 +02:00
STATUS target-ppc: remove powerpc 970gx 2014-03-05 03:06:23 +01:00
arch_dump.c target-ppc: Set the correct endianness in ELF dump header 2014-06-16 13:24:36 +02:00
cpu-models.c target-ppc: Remove POWER5+ v0.0 that never existed 2015-03-25 22:49:46 +01:00
cpu-models.h target-ppc: Remove POWER5+ v0.0 that never existed 2015-03-25 22:49:46 +01:00
cpu-qom.h monitor/target-ppc: Define target_get_monitor_def 2015-11-12 14:53:36 +11:00
cpu.h target-ppc: Move the FPSCR bit update macros to cpu.h 2015-11-30 19:39:01 +11:00
dfp_helper.c target-ppc: Move the FPSCR bit update macros to cpu.h 2015-11-30 19:39:01 +11:00
excp_helper.c target-ppc: Fix SRR0 when taking unaligned exceptions 2015-09-20 22:48:39 +02:00
fpu_helper.c target-ppc/fpu_helper: fix FPSCR_FX bit shift operation 2015-11-30 19:39:01 +11:00
gdbstub.c target-ppc: Fix gdbstub for ppc64le-linux-user 2014-07-08 12:10:36 +02: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 target-ppc: fix vcipher, vcipherlast, vncipherlast and vpermxor 2015-09-20 22:48:39 +02:00
kvm-stub.c kvm/openpic: in-kernel mpic support 2013-07-01 01:11:14 +02:00
kvm.c target-ppc: kvm: fix floating point registers sync on little-endian hosts 2016-03-15 12:10:47 -05:00
kvm_ppc.h ppc: Let kvmppc_reset_htab() return 0 for !CONFIG_KVM 2015-11-11 13:29:04 +11:00
machine.c migration: Use normal VMStateDescriptions for Subsections 2015-06-12 06:53:57 +02:00
mem_helper.c PPC: Fix lswx bounds checks 2015-11-12 13:15:54 +11: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 fix spelling in target sub directory 2011-12-02 10:50:57 +00:00
misc_helper.c target-ppc: move sdr1 value change detection logic to helper_store_sdr1() 2015-03-09 15:00:05 +01:00
mmu-hash32.c qemu-log: add log category for MMU info 2014-12-16 18:43:19 +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 target-ppc: Fix warnings from Sparse 2015-03-09 15:00:08 +01: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: Add/Re-introduce MMU model definitions needed by PR KVM 2015-11-11 11:05:30 +11:00
monitor.c monitor/target-ppc: Define target_get_monitor_def 2015-11-12 14:53:36 +11:00
timebase_helper.c tcg: Invert the inclusion of helper.h 2014-05-28 09:33:54 -07:00
translate.c PPC: Allow Rc bit to be set on mtspr 2015-11-12 13:15:54 +11:00
translate_init.c taget-ppc: Fix read access to IBAT registers higher than IBAT3 2015-11-06 15:42:38 +03:00
user_only_helper.c cpu: Move exception_index field from CPU_COMMON to CPUState 2014-03-13 19:20:46 +01:00