qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/20] target: Implement CPUClass::datapath_is_big_endian() handlers
@ 2024-12-04 20:25 Philippe Mathieu-Daudé
  2024-12-04 20:25 ` [PATCH 01/20] exec/tswap: Rename target_words_bigendian -> qemu_binary_is_bigendian Philippe Mathieu-Daudé
                   ` (19 more replies)
  0 siblings, 20 replies; 27+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-12-04 20:25 UTC (permalink / raw)
  To: qemu-devel
  Cc: Daniel Henrique Barboza, Michael S. Tsirkin, Peter Maydell,
	Laurent Vivier, Mark Cave-Ayland, Alistair Francis,
	Anton Johansson, Zhao Liu, Edgar E. Iglesias, David Hildenbrand,
	qemu-s390x, Max Filippov, Paolo Bonzini, Nicholas Piggin,
	qemu-arm, Thomas Huth, qemu-riscv, Alistair Francis, qemu-ppc,
	Richard Henderson, Philippe Mathieu-Daudé

The long term goal is to remove endianness knowledge from
QEMU system binaries, allowing them to run vCPU in any
endianness. For that target_words_bigendian(), TARGET_BIG_ENDIAN
and few other things (like MO_TE) must be removed.

Have each target implement a datapath_is_big_endian() handler
to express whether the CPU data is expected to be accessed in
big endian or not.

Few targets already provide a such functionality (ARM, PPC);
for some the data endianness is exposed via a CPU bit;
and for many the data endianness is fixed.

Use this handler in 3 places: disas/, the generic-loader
device and the VirtIO core layer.

Note, a similar CPUClass::codepath_is_big_endian() helper could
be useful for translator_ld/st_swap() API.

Philippe Mathieu-Daudé (20):
  exec/tswap: Rename target_words_bigendian -> qemu_binary_is_bigendian
  hw/core/cpu: Introduce CPUClass::datapath_is_big_endian() handler
  target/arm: Implement CPUClass::datapath_is_big_endian
  target/ppc: Register CPUClass::datapath_is_big_endian
  target/rx: Implement CPUClass::datapath_is_big_endian
  target/sparc: Implement CPUClass::datapath_is_big_endian
  target/riscv: Implement CPUClass::datapath_is_big_endian
  target/sh4: Expose CPUSH4State::little_endian property
  target/sh4: Implement CPUClass::datapath_is_big_endian
  target/microblaze: Implement CPUClass::datapath_is_big_endian
  target/mips: Implement CPUClass::datapath_is_big_endian
  target/xtensa: Implement xtensa_isa_is_big_endian()
  target/xtensa: Implement CPUClass::datapath_is_big_endian
  target: Implement CPUClass::datapath_is_big_endian (little-endian)
  target: Implement CPUClass::datapath_is_big_endian (big-endian)
  hw/core/cpu: Expose cpu_datapath_is_big_endian() method
  disas: Use cpu_datapath_is_big_endian()
  hw/core/generic-loader: Use cpu_datapath_is_big_endian()
  hw/virtio: Use cpu_datapath_is_big_endian()
  hw/core/cpu: Remove cpu_virtio_is_big_endian()

 include/exec/tswap.h             | 18 +++++++++---------
 include/hw/core/cpu.h            | 22 ++++++++++++----------
 include/hw/core/sysemu-cpu-ops.h |  8 --------
 include/hw/xtensa/xtensa-isa.h   |  1 +
 target/microblaze/cpu.h          |  2 ++
 target/sh4/cpu.h                 |  6 ++++++
 cpu-target.c                     |  2 +-
 disas/disas-common.c             |  3 +--
 hw/core/cpu-common.c             |  7 +++++++
 hw/core/cpu-sysemu.c             | 11 -----------
 hw/core/generic-loader.c         |  7 ++-----
 hw/display/vga.c                 |  4 ++--
 hw/virtio/virtio.c               |  4 ++--
 system/qtest.c                   |  2 +-
 target/alpha/cpu.c               |  6 ++++++
 target/arm/cpu.c                 |  4 ++--
 target/avr/cpu.c                 |  7 ++++++-
 target/hexagon/cpu.c             |  6 ++++++
 target/hppa/cpu.c                |  6 ++++++
 target/i386/cpu.c                |  6 ++++++
 target/loongarch/cpu.c           |  6 ++++++
 target/m68k/cpu.c                |  6 ++++++
 target/microblaze/cpu.c          | 11 +++++++++++
 target/mips/cpu.c                |  9 +++++++++
 target/openrisc/cpu.c            |  6 ++++++
 target/ppc/cpu_init.c            |  8 ++++----
 target/riscv/cpu.c               | 17 +++++++++++++++++
 target/rx/cpu.c                  | 10 ++++++++++
 target/s390x/cpu.c               |  6 ++++++
 target/sh4/cpu.c                 | 16 ++++++++++++++++
 target/sparc/cpu.c               | 15 +++++++++++++++
 target/tricore/cpu.c             |  6 ++++++
 target/xtensa/cpu.c              |  8 ++++++++
 target/xtensa/xtensa-isa.c       |  7 +++++++
 34 files changed, 205 insertions(+), 58 deletions(-)

-- 
2.45.2



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

end of thread, other threads:[~2024-12-09 20:22 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-04 20:25 [PATCH 00/20] target: Implement CPUClass::datapath_is_big_endian() handlers Philippe Mathieu-Daudé
2024-12-04 20:25 ` [PATCH 01/20] exec/tswap: Rename target_words_bigendian -> qemu_binary_is_bigendian Philippe Mathieu-Daudé
2024-12-04 23:33   ` Richard Henderson
2024-12-04 20:25 ` [PATCH 02/20] hw/core/cpu: Introduce CPUClass::datapath_is_big_endian() handler Philippe Mathieu-Daudé
2024-12-04 20:25 ` [PATCH 03/20] target/arm: Implement CPUClass::datapath_is_big_endian Philippe Mathieu-Daudé
2024-12-04 23:37   ` Richard Henderson
2024-12-04 20:25 ` [PATCH 04/20] target/ppc: Register CPUClass::datapath_is_big_endian Philippe Mathieu-Daudé
2024-12-04 20:25 ` [PATCH 05/20] target/rx: Implement CPUClass::datapath_is_big_endian Philippe Mathieu-Daudé
2024-12-04 20:25 ` [PATCH 06/20] target/sparc: " Philippe Mathieu-Daudé
2024-12-04 20:25 ` [PATCH 07/20] target/riscv: " Philippe Mathieu-Daudé
2024-12-04 20:25 ` [PATCH 08/20] target/sh4: Expose CPUSH4State::little_endian property Philippe Mathieu-Daudé
2024-12-04 20:25 ` [PATCH 09/20] target/sh4: Implement CPUClass::datapath_is_big_endian Philippe Mathieu-Daudé
2024-12-04 20:25 ` [PATCH 10/20] target/microblaze: " Philippe Mathieu-Daudé
2024-12-04 20:25 ` [PATCH 11/20] target/mips: " Philippe Mathieu-Daudé
2024-12-04 20:25 ` [PATCH 12/20] target/xtensa: Implement xtensa_isa_is_big_endian() Philippe Mathieu-Daudé
2024-12-04 20:25 ` [PATCH 13/20] target/xtensa: Implement CPUClass::datapath_is_big_endian Philippe Mathieu-Daudé
2024-12-04 20:25 ` [PATCH 14/20] target: Implement CPUClass::datapath_is_big_endian (little-endian) Philippe Mathieu-Daudé
2024-12-04 20:25 ` [PATCH 15/20] target: Implement CPUClass::datapath_is_big_endian (big-endian) Philippe Mathieu-Daudé
2024-12-09 20:21   ` Brian Cain
2024-12-04 20:25 ` [PATCH 16/20] hw/core/cpu: Expose cpu_datapath_is_big_endian() method Philippe Mathieu-Daudé
2024-12-04 20:25 ` [PATCH 17/20] disas: Use cpu_datapath_is_big_endian() Philippe Mathieu-Daudé
2024-12-04 23:40   ` Richard Henderson
2024-12-05 10:47   ` Peter Maydell
2024-12-04 20:26 ` [PATCH 18/20] hw/core/generic-loader: " Philippe Mathieu-Daudé
2024-12-05  0:05   ` Richard Henderson
2024-12-04 20:26 ` [RFC PATCH 19/20] hw/virtio: " Philippe Mathieu-Daudé
2024-12-04 20:26 ` [PATCH 20/20] hw/core/cpu: Remove cpu_virtio_is_big_endian() Philippe Mathieu-Daudé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).