qemu/target/loongarch/insn_trans
Thomas Huth c34ad45992 target/loongarch: Fix the CSRRD CPUID instruction on big endian hosts
The test in tests/avocado/machine_loongarch.py is currently failing
on big endian hosts like s390x. By comparing the traces between running
the QEMU_EFI.fd bios on a s390x and on a x86 host, it's quickly obvious
that the CSRRD instruction for the CPUID is behaving differently. And
indeed: The code currently does a long read (i.e. 64 bit) from the
address that points to the CPUState->cpu_index field (with tcg_gen_ld_tl()
in the trans_csrrd() function). But this cpu_index field is only an "int"
(i.e. 32 bit). While this dirty pointer magic works on little endian hosts,
it of course fails on big endian hosts. Fix it by using a proper helper
function instead.

Message-Id: <20230720175307.854460-1-thuth@redhat.com>
Reviewed-by: Song Gao <gaosong@loongson.cn>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2023-07-24 18:44:48 +02:00
..
trans_arith.c.inc target/loongarch: Drop tcg_temp_free 2023-03-05 13:44:07 -08:00
trans_atomic.c.inc target/loongarch: Drop tcg_temp_free 2023-03-05 13:44:07 -08:00
trans_bit.c.inc target/loongarch: Drop tcg_temp_free 2023-03-05 13:44:07 -08:00
trans_branch.c.inc target/loongarch: Disassemble jirl properly 2023-01-23 15:36:36 -10:00
trans_extra.c.inc accel/tcg: Introduce translator_io_start 2023-06-05 12:04:29 -07:00
trans_farith.c.inc target/loongarch: Use {set/get}_gpr replace to cpu_fpr 2023-05-06 11:19:50 +08:00
trans_fcmp.c.inc target/loongarch: Use {set/get}_gpr replace to cpu_fpr 2023-05-06 11:19:50 +08:00
trans_fcnv.c.inc target/loongarch: Add floating point conversion instruction translation 2022-06-06 18:09:03 +00:00
trans_fmemory.c.inc target/loongarch: Use {set/get}_gpr replace to cpu_fpr 2023-05-06 11:19:50 +08:00
trans_fmov.c.inc target/loongarch: Use {set/get}_gpr replace to cpu_fpr 2023-05-06 11:19:50 +08:00
trans_lsx.c.inc target/loongarch: Fix the vinsgr2vr/vpickve2gr instructions cause system coredump 2023-05-26 17:21:16 +08:00
trans_memory.c.inc target/loongarch: Drop tcg_temp_free 2023-03-05 13:44:07 -08:00
trans_privileged.c.inc target/loongarch: Fix the CSRRD CPUID instruction on big endian hosts 2023-07-24 18:44:48 +02:00
trans_shift.c.inc target/loongarch: Drop tcg_temp_free 2023-03-05 13:44:07 -08:00