qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>
Cc: qemu-devel@nongnu.org,
	Daniel Henrique Barboza <dbarboza@ventanamicro.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Laurent Vivier <lvivier@redhat.com>,
	 Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
	Alistair Francis <alistair.francis@wdc.com>,
	 Anton Johansson <anjo@rev.ng>, Zhao Liu <zhao1.liu@intel.com>,
	 "Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	David Hildenbrand <david@redhat.com>,
	qemu-s390x@nongnu.org,  Max Filippov <jcmvbkbc@gmail.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	 Nicholas Piggin <npiggin@gmail.com>,
	qemu-arm@nongnu.org, Thomas Huth <thuth@redhat.com>,
	 qemu-riscv@nongnu.org, Alistair Francis <alistair@alistair23.me>,
	qemu-ppc@nongnu.org,
	Richard Henderson <richard.henderson@linaro.org>
Subject: Re: [PATCH 17/20] disas: Use cpu_datapath_is_big_endian()
Date: Thu, 5 Dec 2024 10:47:15 +0000	[thread overview]
Message-ID: <CAFEAcA8Y6PGOJvMwQKykD4jpDjnuVO61xNFQ4k5t=z5ULjv-oQ@mail.gmail.com> (raw)
In-Reply-To: <20241204202602.58083-18-philmd@linaro.org>

On Wed, 4 Dec 2024 at 20:28, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>
> Rather that using the binary endianness, use the vCPU one.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  disas/disas-common.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/disas/disas-common.c b/disas/disas-common.c
> index 7377de0715c..ef91c43449e 100644
> --- a/disas/disas-common.c
> +++ b/disas/disas-common.c
> @@ -7,7 +7,6 @@
>  #include "disas/disas.h"
>  #include "disas/capstone.h"
>  #include "hw/core/cpu.h"
> -#include "exec/tswap.h"
>  #include "disas-internal.h"
>
>
> @@ -61,7 +60,7 @@ void disas_initialize_debug_target(CPUDebug *s, CPUState *cpu)
>
>      s->cpu = cpu;
>      s->info.print_address_func = print_address;
> -    if (qemu_binary_is_bigendian()) {
> +    if (cpu_datapath_is_big_endian(cpu)) {
>          s->info.endian = BFD_ENDIAN_BIG;
>      } else {
>          s->info.endian =  BFD_ENDIAN_LITTLE;
> --

This looks weird, but maybe that's just the function naming?
Instruction disassembly is instructions, not data, and the
endianness isn't necessarily the same (e.g. on Armv7 and later
instructions are always little-endian even when data is
big-endian.)

-- PMM


  parent reply	other threads:[~2024-12-05 10:48 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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é

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFEAcA8Y6PGOJvMwQKykD4jpDjnuVO61xNFQ4k5t=z5ULjv-oQ@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=alistair.francis@wdc.com \
    --cc=alistair@alistair23.me \
    --cc=anjo@rev.ng \
    --cc=david@redhat.com \
    --cc=dbarboza@ventanamicro.com \
    --cc=edgar.iglesias@gmail.com \
    --cc=jcmvbkbc@gmail.com \
    --cc=lvivier@redhat.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=mst@redhat.com \
    --cc=npiggin@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=thuth@redhat.com \
    --cc=zhao1.liu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).