]> Git Repo - qemu.git/commit - hw/s390x/s390-pci-inst.c
s390x/pci: factor out endianess conversion
authorPierre Morel <[email protected]>
Thu, 30 Nov 2017 12:55:24 +0000 (13:55 +0100)
committerCornelia Huck <[email protected]>
Thu, 14 Dec 2017 16:56:54 +0000 (17:56 +0100)
commitc748814b20f1f1b43eed1fd32c84579c60f4cc58
treec02109b3d13be40b30711f8925957c5051fee199
parentcb3129c3762ceadabcef7e9d319bae9243fc238e
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 <[email protected]>
Reviewed-by: Yi Min Zhao <[email protected]>
Message-Id: <1512046530[email protected]>
Signed-off-by: Cornelia Huck <[email protected]>
hw/s390x/s390-pci-inst.c
This page took 0.023807 seconds and 4 git commands to generate.