qemu/hw/sd
Peter Maydell 4b02ac725a 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
(cherry picked from commit 3e20d90824)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2023-05-18 21:09:59 +03:00
..
allwinner-sdhost.c hw/sd/allwinner-sdhost: Correctly byteswap descriptor fields 2023-05-18 21:09:59 +03:00
aspeed_sdhci.c
bcm2835_sdhost.c
cadence_sdhci.c
core.c
Kconfig
meson.build
npcm7xx_sdhci.c
omap_mmc.c
pl181.c
pxa2xx_mmci.c
sd.c
sdhci-internal.h
sdhci-pci.c
sdhci.c
sdmmc-internal.c
sdmmc-internal.h
ssi-sd.c
trace-events
trace.h