qemu/hw
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
..
9pfs
acpi
adc
alpha
arm hw/arm/smmu: Handle big-endian hosts correctly 2023-07-25 10:56:51 +01:00
audio
avr
block virtio-blk: fix host notifier issues during dataplane start/stop 2023-07-12 15:20:32 -04:00
char
core pcie: Specify 0 for ARI next function numbers 2023-07-10 18:59:32 -04:00
cpu
cris
cxl
display virtio-gpu-udmabuf: correct naming of QemuDmaBuf size properties 2023-07-17 15:22:28 +04:00
dma
gpio
hppa
hyperv
i2c
i386 pc: Factor out (un)plug handling of virtio-md-pci devices 2023-07-12 09:27:27 +02:00
ide hw/ide/piix: properly initialize the BMIBA register 2023-07-14 11:10:57 +02:00
input
intc s390x: Fix QEMU abort by selecting S390_FLIC_KVM 2023-07-18 09:36:27 +02:00
ipack
ipmi
isa hw/isa/vt82c686: Remove via_isa_set_irq() 2023-07-11 00:11:25 +02:00
loongarch hw/loongarch/virt: Use machine_memory_devices_init() 2023-07-12 09:25:37 +02:00
m68k
mem memory-device: Track used region size in DeviceMemoryState 2023-07-12 09:25:37 +02:00
microblaze
mips pc,pci,virtio: cleanups, fixes, features 2023-07-11 09:33:12 +01:00
misc hw/misc: sifive_e_aon: Support the watchdog timer of HiFive 1 rev b. 2023-07-10 22:29:14 +10:00
net kconfig: Add PCIe devices to s390x machines 2023-07-14 11:10:57 +02:00
nios2
nubus
nvme hw/nvme: fix endianness issue for shadow doorbells 2023-07-19 09:33:54 +02:00
nvram hw/nvram: Avoid unnecessary Xilinx eFuse backstore write 2023-07-17 11:05:52 +01:00
openrisc
pci kconfig: Add PCIe devices to s390x machines 2023-07-14 11:10:57 +02:00
pci-bridge
pci-host hw/pci/pci: Remove multifunction parameter from pci_new_multifunction() 2023-07-10 18:59:32 -04:00
pcmcia
ppc hw/ppc/spapr: Use machine_memory_devices_init() 2023-07-12 09:25:37 +02:00
rdma
remote
riscv hw/riscv: Fix typo field in error_report 2023-07-19 14:31:41 +10:00
rtc
rx
s390x s390x: Fix QEMU abort by selecting S390_FLIC_KVM 2023-07-18 09:36:27 +02:00
scsi scsi: clear unit attention only for REPORT LUNS commands 2023-07-14 11:10:58 +02:00
sd
sensor
sh4
smbios hw/smbios: Fix core count in type4 2023-07-10 16:17:08 -04:00
sparc
sparc64 hw/pci/pci: Remove multifunction parameter from pci_new_multifunction() 2023-07-10 18:59:32 -04:00
ssi
timer
tpm hw/tpm: TIS on sysbus: Remove unsupport ppi command line option 2023-07-14 11:31:54 -04:00
tricore
usb kconfig: Add PCIe devices to s390x machines 2023-07-14 11:10:57 +02:00
vfio vfio/pci: Enable AtomicOps completers on root ports 2023-07-10 09:52:52 +02:00
virtio virtio-mem-pci: Device unplug support 2023-07-12 09:27:32 +02:00
watchdog
xen
xenpv
xtensa
Kconfig
meson.build