Nathan Chancellor <nat...@kernel.org> writes:
> Hi Philippe, > > On Wed, Jan 04, 2023 at 02:39:34PM +0100, Philippe Mathieu-Daudé wrote: >> GT64120's PCI endianness swapping works on little-endian hosts, >> but doesn't on big-endian ones. Instead of complicating how >> CFGADDR/CFGDATA registers deal with endianness, use the existing >> MemoryRegionOps from hw/pci/pci_host.c. Doing so also reduce the >> access to internal PCI_HOST_BRIDGE fields. >> >> Map the PCI_HOST_BRIDGE MemoryRegionOps into the corresponding >> CFGADDR/CFGDATA regions in the ISD MMIO and remove the unused >> code in the current ISD read/write handlers. >> >> Update the mapping when PCI0_CMD register is accessed (in case >> the endianness is changed). >> >> This allows using the GT64120 on a big-endian host (and boot >> the MIPS Malta machine in little-endian). >> >> Signed-off-by: Philippe Mathieu-Daudé <phi...@linaro.org> > > This change as commit 145e2198d7 ("hw/mips/gt64xxx_pci: Endian-swap > using PCI_HOST_BRIDGE MemoryRegionOps") in QEMU master causes a hang > when trying to poweroff a malta_defconfig + CONFIG_CPU_BIG_ENDIAN=y > kernel on an x86_64 host. The kernel has been built from latest mainline > using the kernel.org toolchains [1], just in case it matters. > > $ timeout --foreground 30s qemu-system-mips \ > -cpu 24Kf \ > -machine malta \ > -kernel vmlinux \ > -display none \ > -initrd rootfs.cpio \ > -m 512m \ > -nodefaults \ > -no-reboot \ > -serial mon:stdio > ... <snip> Ahh also this commit got fingered by the tuxrun test for the same combination: ./run --runtime docker --qemu-binary /home/alex.bennee/lsrc/qemu.git/builds/bisect/qemu-system-mips64 --device qemu-mips64 with my in flight patches for tuxrun's host support. -- Alex Bennée Virtualisation Tech Lead @ Linaro