target-ppc: ppc64 can be either endian

This patch implements CPUClass::has_big_endian_virtio() for POWER7, POWER7+
and POWER8 families. In this case, the virtio device endianness depends on a
"system" endianness that is tracked with the ILE bit of the LPCR special
control register (endianness to enforce when entering an interrupt handler).

Since other PowerPC families may handle endianness differently, we first
introduce a PowerPCCPUClass::has_big_endian_interrupts() method that we
can call from the CPUClass::has_big_endian_virtio() implementation for
POWER7 and friends.

We also define TARGET_BIENDIAN to select appropriate virtio accessors.

Suggested-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
[ original hook superseded by CPU method,
  Greg Kurz <gkurz@linux.vnet.ibm.com> ]
Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
target-ppc: ppc64 can be either endian

POWER7, POWER7+ and POWER8 families use the ILE bit of the LPCR special
purpose register to decide the endianness to use when entering interrupt
handlers. When running a linux guest, this provides a hint of the
endianness used by the kernel. From a qemu point of view, the information
is needed for legacy virtio support and possibly crash dump support as well.

Suggested-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
target-ppc: ppc64 can be either endian

POWER7, POWER7+ and POWER8 families use the ILE bit of the LPCR special
purpose register to decide the endianness to use when entering interrupt
handlers. When running a linux guest, this provides a hint of the
endianness used by the kernel. From a qemu point of view, the information
is needed for legacy virtio support and possibly crash dump support as well.

Suggested-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Refresh of target-ppc-ppc64-target-s
refresh (create temporary patch)
refresh (create temporary patch)
refresh
refresh
target-ppc: enable virtio endian ambivalent support

Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
new
new
pop
pop
Refresh of target-ppc-ppc64-target-s
refresh (create temporary patch)
refresh (create temporary patch)
refresh
refresh
edit
edit