diff options
author | Thomas Huth <thuth@redhat.com> | 2023-07-20 19:53:07 +0200 |
---|---|---|
committer | Thomas Huth <thuth@redhat.com> | 2023-07-24 18:44:48 +0200 |
commit | c34ad459926f6c600a55fe6782a27edfa405d60b (patch) | |
tree | 76adf6aa58a092635c4b63e27b89be87fcddd1ef /softmmu | |
parent | 71a00a5baea0e291a59ae639cbecf54d8cd70abb (diff) | |
download | qemu-c34ad459926f6c600a55fe6782a27edfa405d60b.zip qemu-c34ad459926f6c600a55fe6782a27edfa405d60b.tar.gz qemu-c34ad459926f6c600a55fe6782a27edfa405d60b.tar.bz2 |
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>
Diffstat (limited to 'softmmu')
0 files changed, 0 insertions, 0 deletions