Skip to content

Commit

Permalink
target/i386: fix byte swap issue with XMM register access
Browse files Browse the repository at this point in the history
During the conversion to the gdb_get_reg128 helpers the high and low
parts of the XMM register where inadvertently swapped. This causes
reads of the register to report the incorrect value to gdb.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/971
Fixes: b7b8756 (target/i386: use gdb_get_reg helpers)
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Cc: qemu-stable@nongnu.org
Message-Id: <20220419091020.3008144-25-alex.bennee@linaro.org>
  • Loading branch information
stsquad committed Apr 20, 2022
1 parent f9caa8f commit e618e1f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions target/i386/gdbstub.c
Expand Up @@ -129,8 +129,8 @@ int x86_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
n -= IDX_XMM_REGS;
if (n < CPU_NB_REGS32 || TARGET_LONG_BITS == 64) {
return gdb_get_reg128(mem_buf,
env->xmm_regs[n].ZMM_Q(0),
env->xmm_regs[n].ZMM_Q(1));
env->xmm_regs[n].ZMM_Q(1),
env->xmm_regs[n].ZMM_Q(0));
}
} else {
switch (n) {
Expand Down

0 comments on commit e618e1f

Please sign in to comment.