aboutsummaryrefslogtreecommitdiff
path: root/tcg/tcg-op-vec.c
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2023-07-20 19:53:07 +0200
committerMichael Tokarev <mjt@tls.msk.ru>2023-07-31 09:12:06 +0300
commit0c8e6ac989581666b0fe4e0c8502000194152611 (patch)
tree8b16283ddf5d203f617e63c5a133033d62c82b88 /tcg/tcg-op-vec.c
parentc1bdd3cdc4636adb150b17f490da5dc5c15689b6 (diff)
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> (cherry picked from commit c34ad459926f6c600a55fe6782a27edfa405d60b) Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'tcg/tcg-op-vec.c')
0 files changed, 0 insertions, 0 deletions