qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/1] Fix endless translation loop of riscv
@ 2025-04-14  3:46 Ziqiao Kong
  2025-04-14  3:46 ` [PATCH v2 1/1] target/riscv: fix endless translation loop on big endian systems Ziqiao Kong
  0 siblings, 1 reply; 11+ messages in thread
From: Ziqiao Kong @ 2025-04-14  3:46 UTC (permalink / raw)
  To: qemu-devel; +Cc: ziqiaokong, qemu-trivial, alistair.francis, richard.henderson

Sorry for sending this again as I found previous patch series does not
work on riscv32 due to target_ulong is not le64. Please ignore my
previous v1 patch. Below is the original cover letter to illustrate the
purpose of the patch:

Hello! I'm Ziqiao Kong, the maintainer of Unicorn Engine, a fork of
QEMU. When I port Unicorn Engine to s390x, I notice there is a bug in
the implementation of RISCV MMU. It uses qemu_map_ram_ptr to get a
pointer and reads it directly, instead of bswap or address_space_ldl,
which causes an endless translation loop on big endian systems like
s390x I'm working on. Therefore, a quick fix to this is to call
cpu_to_le64 for cmpxchg as this patch shows.

This patch passes our unit tests and the error is somewhat obvious
(unhandled endianness discrepancy). Therefore, I'm rather confident
that QEMU aslo needs this patch. Given the changes are small and don't
impact most popular little endian platforms, I think this fits into
trivial patches.


Ziqiao Kong (1):
  target/riscv: fix endless translation loop on big endian systems

 target/riscv/cpu_helper.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.34.1



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2025-04-15  7:41 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-14  3:46 [PATCH v2 0/1] Fix endless translation loop of riscv Ziqiao Kong
2025-04-14  3:46 ` [PATCH v2 1/1] target/riscv: fix endless translation loop on big endian systems Ziqiao Kong
2025-04-14 10:41   ` Philippe Mathieu-Daudé
2025-04-14 11:17     ` Ziqiao Kong
2025-04-14 16:59       ` Ziqiao Kong
2025-04-14 17:38         ` Philippe Mathieu-Daudé
     [not found]           ` <CAM0BWNBNrjJ6UuF+TRtkuEesLatnY1pzSjyaiPVDeKSMF8no-A@mail.gmail.com>
2025-04-15  7:04             ` Ziqiao Kong
2025-04-15  7:15               ` Philippe Mathieu-Daudé
2025-04-15  7:19                 ` Ziqiao Kong
2025-04-15  7:22                   ` Ziqiao Kong
2025-04-15  7:40                     ` Ziqiao Kong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).