qemu-patch-raspberry4/hw/s390x
Pierre Morel c748814b20 s390x/pci: factor out endianess conversion
There are two places where the same endianness conversion
is done.
Let's factor this out into a static function.

Note that the conversion must always be done for data in a register:

The S390 BE guest converted date to le before issuing the instruction.

After interception in a BE host:
ZPCI VFIO using pwrite must make the conversion back for the BE kernel.
Kernel will do BE to le translation when loading the register for the
real instruction.

After interception in a le host:
TCG stores a BE register in le, swapping bytes.
But since the data in the register was already le it is now BE
ZPCI VFIO must convert it to le before writing to the PCI memory.

In both cases ZPCI VFIO must swap the bytes from the register.

Signed-off-by: Pierre Morel <pmorel@linux.vnet.ibm.com>
Reviewed-by: Yi Min Zhao <zyimin@linux.vnet.ibm.com>
Message-Id: <1512046530-17773-2-git-send-email-pmorel@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
2017-12-14 17:56:54 +01:00
..
3270-ccw.c s390x: sort some devices into categories 2017-10-06 10:53:02 +02:00
ccw-device.c s390x: vmstatify config migration for virtio-ccw 2017-07-05 12:16:55 +02:00
ccw-device.h s390x: vmstatify config migration for virtio-ccw 2017-07-05 12:16:55 +02:00
css-bridge.c s390x: add flags field for registering I/O adapter 2017-07-14 12:29:47 +02:00
css.c s390x/tcg: rip out dead tpi code 2017-12-14 17:56:54 +01:00
event-facility.c s390x/event-facility: variable-length event masks 2017-10-20 13:32:10 +02:00
ipl.c s390x/ipl: The s390-ipl device is not hot-pluggable 2017-08-30 18:23:25 +02:00
ipl.h hw/s390x/ipl: enable LOADPARM in IPIB for a boot device 2017-05-02 15:08:54 +02:00
Makefile.objs s390x: get rid of s390-virtio.c 2017-09-19 18:31:31 +02:00
s390-ccw.c s390x: improve error handling for SSCH and RSCH 2017-10-20 13:32:10 +02:00
s390-pci-bus.c s390x/pci: let pci devices start in configured mode 2017-11-08 12:00:08 +01:00
s390-pci-bus.h s390x/pci: remove idx from msix msg data 2017-09-19 18:21:32 +02:00
s390-pci-inst.c s390x/pci: factor out endianess conversion 2017-12-14 17:56:54 +01:00
s390-pci-inst.h s390x/pci: pass the retaddr to all PCI instructions 2017-12-14 17:56:54 +01:00
s390-pci-stub.c s390x/pci: remove idx from msix msg data 2017-09-19 18:21:32 +02:00
s390-skeys-kvm.c s390x/s390-skeys: Mark the storage key devices with user_creatable = false 2017-08-30 18:23:25 +02:00
s390-skeys.c s390x/s390-skeys: Mark the storage key devices with user_creatable = false 2017-08-30 18:23:25 +02:00
s390-stattrib-kvm.c s390x/s390-stattrib: Mark the storage attribute as not user_creatable 2017-08-30 18:23:26 +02:00
s390-stattrib.c s390x/s390-stattrib: Mark the storage attribute as not user_creatable 2017-08-30 18:23:26 +02:00
s390-virtio-ccw.c s390x: introduce 2.12 compat machine 2017-12-14 17:56:54 +01:00
s390-virtio-hcall.c s390x: rename s390-virtio.h to s390-virtio-hcall.h 2017-09-19 18:31:31 +02:00
s390-virtio-hcall.h s390/kvm_virtio/linux-headers: remove traces of old virtio transport 2017-11-24 10:52:05 +01:00
sclp.c s390x/sclp: Mark the sclp device with user_creatable = false 2017-10-06 10:53:02 +02:00
sclpcpu.c s390x/sclp: mark sclp-cpu-hotplug as non-usercreatable 2017-10-06 10:53:02 +02:00
sclpquiesce.c hw/s390x: Mark the "sclpquiesce" device with user_creatable = false 2017-10-06 10:53:02 +02:00
trace-events trace-events: fix code style: print 0x before hex numbers 2017-08-01 12:13:07 +01:00
virtio-ccw.c virtio-ccw: Add the virtio-input devices for CCW bus 2017-10-20 13:32:10 +02:00
virtio-ccw.h virtio-ccw: Add the virtio-input devices for CCW bus 2017-10-20 13:32:10 +02:00