All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH for-6.2 v2 0/2] target/ppc: Fix vector registers access in gdbstub for little-endian
@ 2021-08-18 11:06 matheus.ferst
  2021-08-18 11:06 ` [PATCH for-6.2 v2 1/2] include/qemu/int128.h: introduce bswap128s matheus.ferst
  2021-08-18 11:06 ` [PATCH for-6.2 v2 2/2] target/ppc: fix vector registers access in gdbstub for little-endian matheus.ferst
  0 siblings, 2 replies; 10+ messages in thread
From: matheus.ferst @ 2021-08-18 11:06 UTC (permalink / raw)
  To: qemu-devel, qemu-ppc
  Cc: peter.maydell, philmd, richard.henderson, groug, Matheus Ferst, david

From: Matheus Ferst <matheus.ferst@eldorado.org.br>

PPC gdbstub code has two possible swaps of the 64-bit elements of AVR
registers: in gdb_get_avr_reg/gdb_set_avr_reg (based on msr_le) and in
gdb_get_reg128/ldq_p (based on TARGET_WORDS_BIGENDIAN).

In softmmu, only the first is done, because TARGET_WORDS_BIGENDIAN is
always true. In user mode, both are being done, resulting in swapped
high and low doublewords of AVR registers in little-endian binaries.

We fix this by moving the first swap to ppc_maybe_bswap_register, which
already handles the endianness swap of each element's value in softmmu
and does nothing in user mode.

Matheus Ferst (2):
  include/qemu/int128.h: introduce bswap128s
  target/ppc: fix vector registers access in gdbstub for little-endian

 include/qemu/int128.h | 15 +++++++++++++++
 target/ppc/gdbstub.c  | 32 +++++++-------------------------
 2 files changed, 22 insertions(+), 25 deletions(-)

-- 
2.25.1



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-08-19 23:04 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-18 11:06 [PATCH for-6.2 v2 0/2] target/ppc: Fix vector registers access in gdbstub for little-endian matheus.ferst
2021-08-18 11:06 ` [PATCH for-6.2 v2 1/2] include/qemu/int128.h: introduce bswap128s matheus.ferst
2021-08-18 12:23   ` Philippe Mathieu-Daudé
2021-08-19 12:33   ` Peter Maydell
2021-08-18 11:06 ` [PATCH for-6.2 v2 2/2] target/ppc: fix vector registers access in gdbstub for little-endian matheus.ferst
2021-08-19 12:42   ` Peter Maydell
2021-08-19 12:47     ` Luis Fernando Fujita Pires
2021-08-19 19:39     ` Matheus K. Ferst
2021-08-19 23:03     ` Richard Henderson
2021-08-19 12:57   ` Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.