qemu-e2k/hw/arm
Peter Maydell c6445544d4 hw/arm/smmu: Handle big-endian hosts correctly
The implementation of the SMMUv3 has multiple places where it reads a
data structure from the guest and directly operates on it without
doing a guest-to-host endianness conversion.  Since all SMMU data
structures are little-endian, this means that the SMMU doesn't work
on a big-endian host.  In particular, this causes the Avocado test
  machine_aarch64_virt.py:Aarch64VirtMachine.test_alpine_virt_tcg_gic_max
to fail on an s390x host.

Add appropriate byte-swapping on reads and writes of guest in-memory
data structures so that the device works correctly on big-endian
hosts.

As part of this we constrain queue_read() to operate only on Cmd
structs and queue_write() on Evt structs, because in practice these
are the only data structures the two functions are used with, and we
need to know what the data structure is to be able to byte-swap its
parts correctly.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Message-id: 20230717132641.764660-1-peter.maydell@linaro.org
Cc: qemu-stable@nongnu.org
2023-07-25 10:56:51 +01:00
..
allwinner-a10.c
allwinner-h3.c
allwinner-r40.c hw: arm: allwinner-sramc: Add SRAM Controller support for R40 2023-06-06 10:19:33 +01:00
armsse.c
armv7m.c
aspeed_ast10x0.c
aspeed_ast2600.c target/arm: Allow users to set the number of VFP registers 2023-06-15 18:35:58 +02:00
aspeed_eeprom.c hw/arm/aspeed: Add VPD data for Rainier machine 2023-06-15 18:35:57 +02:00
aspeed_eeprom.h hw/arm/aspeed: Add VPD data for Rainier machine 2023-06-15 18:35:57 +02:00
aspeed_soc.c
aspeed.c aspeed: Introduce a "bmc-console" machine option 2023-06-15 18:35:58 +02:00
bananapi_m2u.c hw: arm: allwinner-r40: Add emac and gmac support 2023-06-06 10:19:33 +01:00
bcm2835_peripherals.c hw/arm/bcm2835_property: Implement "get command line" message 2023-05-02 15:47:40 +01:00
bcm2836.c hw/arm/bcm2835_property: Implement "get command line" message 2023-05-02 15:47:40 +01:00
boot.c hw/arm/boot: Make write_bootloader() public as arm_write_bootloader() 2023-05-02 15:47:40 +01:00
collie.c
cubieboard.c
digic_boards.c
digic.c
exynos4_boards.c
exynos4210.c
fby35.c aspeed: Use the boot_rom region of the fby35 machine 2023-06-15 18:35:58 +02:00
fsl-imx6.c fsl-imx6: Add SNVS support for i.MX6 boards 2023-05-30 13:02:53 +01:00
fsl-imx6ul.c
fsl-imx7.c
fsl-imx25.c
fsl-imx31.c
gumstix.c
highbank.c
imx25_pdk.c
integratorcp.c
Kconfig hw/arm/sbsa-ref: use XHCI to replace EHCI 2023-07-04 14:08:47 +01:00
kzm.c
mainstone.c
mcimx6ul-evk.c
mcimx7d-sabre.c
meson.build meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
microbit.c
mps2-tz.c
mps2.c
msf2-soc.c
msf2-som.c
musca.c
musicpal.c bulk: Remove pointless QOM casts 2023-06-05 20:48:34 +02:00
netduino2.c
netduinoplus2.c
npcm7xx_boards.c
npcm7xx.c
nrf51_soc.c
nseries.c
olimex-stm32-h405.c
omap1.c
omap2.c
omap_sx1.c
orangepi.c
palm.c
pxa2xx_gpio.c
pxa2xx_pic.c
pxa2xx.c
raspi.c hw/arm/raspi: Use arm_write_bootloader() to write boot code 2023-05-02 15:47:41 +01:00
realview.c
sabrelite.c
sbsa-ref.c hw/arm/sbsa-ref: set 'slots' property of xhci 2023-07-17 11:05:07 +01:00
smmu-common.c hw/arm/smmu: Handle big-endian hosts correctly 2023-07-25 10:56:51 +01:00
smmu-internal.h hw/arm/smmuv3: Add VMID to TLB tagging 2023-05-30 15:50:16 +01:00
smmuv3-internal.h hw/arm/smmuv3: Parse STE config for stage-2 2023-05-30 13:02:53 +01:00
smmuv3.c hw/arm/smmu: Handle big-endian hosts correctly 2023-07-25 10:56:51 +01:00
spitz.c
stellaris.c
stm32f100_soc.c
stm32f205_soc.c
stm32f405_soc.c
stm32vldiscovery.c
strongarm.c
strongarm.h
tosa.c
trace-events hw/arm/smmuv3: Add stage-2 support in iova notifier 2023-05-30 15:50:16 +01:00
trace.h
versatilepb.c
vexpress.c hw/arm/vexpress: Avoid trivial memory leak of 'flashalias' 2023-05-18 11:39:33 +01:00
virt-acpi-build.c hw/arm/virt-acpi-build.c: Add missing header 2023-07-08 07:24:38 +03:00
virt.c arm/virt: Use virtio-md-pci (un)plug functions 2023-07-12 09:27:28 +02:00
xen_arm.c exec/memory: Add symbolic value for memory listener priority for accel 2023-06-28 14:27:59 +02:00
xilinx_zynq.c
xlnx-versal-virt.c xlnx-versal: Connect Xilinx VERSAL CANFD controllers 2023-06-06 10:19:30 +01:00
xlnx-versal.c target-arm queue: 2023-06-06 12:11:34 -07:00
xlnx-zcu102.c
xlnx-zynqmp.c hw/arm/xlnx-zynqmp: fix unsigned error when checking the RPUs number 2023-05-30 15:50:16 +01:00
z2.c