id = 1693 title = "qemu-system-nios2 not working on s390x (big endian) hosts" state = "closed" created_at = "2023-06-07T08:33:31.965Z" closed_at = "2023-07-01T10:12:35.751Z" labels = ["host: s390", "kind::Bug", "target: nios2", "workflow::Patch available"] url = "https://gitlab.com/qemu-project/qemu/-/issues/1693" host-os = "Linux / RHEL 9" host-arch = "s390x" qemu-version = "current master branch (commit 7ce5a15fa633c7683d4)" guest-os = "Linux" guest-arch = "nios2" description = """qemu-system-nios2 fails to boot a Linux kernel on s390x hosts.""" reproduce = """1. wget https://qemu-advcal.gitlab.io/qac-best-of-multiarch/download/day14.tar.xz 2. tar -xJf day14.tar.xz 3. cd day14/ 4. qemu-system-nios2 -nographic -kernel vmlinux.elf""" additional = """When running with "-d in_asm", it seems like the code initially starts executing ok, but in one of the early translation blocks, there is a difference when comparing the log with a run from a x86 host: ``` IN: fdt_check_header 0xc81afd48: ldw\tr3,0(r4) 0xc81afd4c: srli\tr5,r3,24 0xc81afd50: slli\tr2,r3,24 0xc81afd54: or\tr2,r2,r5 0xc81afd58: slli\tr5,r3,8 0xc81afd5c: srli\tr3,r3,8 0xc81afd60: andhi\tr5,r5,255 0xc81afd64: andi\tr3,r3,65280 0xc81afd68: or\tr2,r2,r5 0xc81afd6c: or\tr2,r2,r3 0xc81afd70: movhi\tr3,53262 0xc81afd74: addi\tr3,r3,-275 0xc81afd78: bne\tr2,r3,0xc81afde8 ``` On the x86 host, the branch at the end is not taken, while on the s390x host, the branch is taken."""