summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlex Bennée <alex.bennee@linaro.org>2022-04-19 10:10:19 +0100
committerAlex Bennée <alex.bennee@linaro.org>2022-04-20 16:04:20 +0100
commite618e1f9b4cbb3803bbe70fae30a0fa4960f384d (patch)
tree8f4d5b856d8b844e878c7beee9666152c0b76d14
parentf9caa8feea9d5acd1a6dc02b626f82a149b4b94e (diff)
downloadfocaccia-qemu-e618e1f9b4cbb3803bbe70fae30a0fa4960f384d.tar.gz
focaccia-qemu-e618e1f9b4cbb3803bbe70fae30a0fa4960f384d.zip
target/i386: fix byte swap issue with XMM register access
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: b7b8756a9c (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>
-rw-r--r--target/i386/gdbstub.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/target/i386/gdbstub.c b/target/i386/gdbstub.c
index 098a2ad15a..c3a2cf6f28 100644
--- a/target/i386/gdbstub.c
+++ b/target/i386/gdbstub.c
@@ -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) {