]> xenbits.xensource.com Git - qemu-xen.git/commit
hw/sd/allwinner-sdhost: Correctly byteswap descriptor fields
authorPeter Maydell <peter.maydell@linaro.org>
Mon, 24 Apr 2023 16:50:52 +0000 (17:50 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 2 May 2023 14:47:41 +0000 (15:47 +0100)
commit3e20d90824c262de6887aa1bc52af94db69e4310
treeb7668196926efee6bb1d31966d02ede0b0f6eb90
parent2b67d0ff971cb232c6d3cbb2cc44d9e2b7a7aac2
hw/sd/allwinner-sdhost: Correctly byteswap descriptor fields

In allwinner_sdhost_process_desc() we just read directly from
guest memory into a host TransferDescriptor struct and back.
This only works on little-endian hosts. Abstract the reading
and writing of descriptors into functions that handle the
byte-swapping so that TransferDescriptor structs as seen by
the rest of the code are always in host-order.

This fixes a failure of one of the avocado tests on s390.

Cc: qemu-stable@nongnu.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20230424165053.1428857-2-peter.maydell@linaro.org
hw/sd/allwinner-sdhost.c