]> git.ipfire.org Git - thirdparty/qemu.git/commit
target/arm: Fix handling of setting SVE registers from gdb
authorVacha Bhavsar <vacha.bhavsar@oss.qualcomm.com>
Tue, 22 Jul 2025 17:37:36 +0000 (17:37 +0000)
committerMichael Tokarev <mjt@tls.msk.ru>
Tue, 5 Aug 2025 08:36:38 +0000 (11:36 +0300)
commit423a3bece9e671386b8667b2b96d4796af9a3a54
tree2d91e49e0274fe1cc40d93b2521e3dcb2fa183ee
parentd85e56bc73154236301752f56f665bbf03a87151
target/arm: Fix handling of setting SVE registers from gdb

The code to handle setting SVE registers via the gdbstub is broken:
 * it sets each pair of elements in the zregs[].d[] array in the
   wrong order for the most common (little endian) case: the least
   significant 64-bit value comes first
 * it makes no attempt to handle target_endian()
 * it does a simple copy out of the (target endian) gdbstub buffer
   into the (host endan) zregs data structure, which is wrong on
   big endian hosts

Fix all these problems:
 * use ldq_p() to read from the gdbstub buffer
 * check target_big_endian() to see if we need to handle the
   128-bit values the opposite way around

Cc: qemu-stable@nongnu.org
Signed-off-by: Vacha Bhavsar <vacha.bhavsar@oss.qualcomm.com>
Message-id: 20250722173736.2332529-3-vacha.bhavsar@oss.qualcomm.com
[PMM: adjusted commit message, fixed spacing]
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
(cherry picked from commit 97b3d732afec9b165c33697452e31267a845338f)
(Mjt: s/target_big_endian/target_words_bigendian/ due to missing
 v10.0.0-277-gb939b8e42a "exec: Rename target_words_bigendian() -> target_big_endian()")
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
target/arm/gdbstub64.c