hw/mips/malta: Fix the malta machine on big endian hosts
commitdc96009afd8cf2372fa1bbced0bcbcbb2c5d6f1b
authorThomas Huth <thuth@redhat.com>
Thu, 30 Mar 2023 15:26:13 +0000 (30 17:26 +0200)
committerThomas Huth <thuth@redhat.com>
Mon, 5 Jun 2023 18:48:34 +0000 (5 20:48 +0200)
tree10b6854f1cf0a7aca480600add3c4f3f4b98e489
parent98300bcdba2a60cf549c5c13761dcada4d7ff877
hw/mips/malta: Fix the malta machine on big endian hosts

Booting a Linux kernel with the malta machine is currently broken
on big endian hosts. The cpu_to_gt32 macro wants to byteswap a value
for little endian targets only, but uses the wrong way to do this:
cpu_to_[lb]e32 works the other way round on big endian hosts! Fix
it by using the same ways on both, big and little endian hosts.

Fixes: 0c8427baf0 ("hw/mips/malta: Use bootloader helper to set BAR registers")
Cc: qemu-stable@nongnu.org
Message-Id: <20230330152613.232082-1-thuth@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
hw/mips/malta.c