qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Halil Pasic <pasic@linux.ibm.com>
To: marcandre.lureau@redhat.com
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Dmitry Fleytman" <dmitry.fleytman@gmail.com>,
	"open list:Overall KVM CPUs" <kvm@vger.kernel.org>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Jason Wang" <jasowang@redhat.com>,
	"Bin Meng" <bin.meng@windriver.com>,
	"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
	qemu-devel@nongnu.org, "Peter Xu" <peterx@redhat.com>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Yanan Wang" <wangyanan55@huawei.com>,
	"Max Filippov" <jcmvbkbc@gmail.com>,
	"Alistair Francis" <alistair.francis@wdc.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Vikram Garhwal" <fnu.vikram@xilinx.com>,
	"open list:virtio-blk" <qemu-block@nongnu.org>,
	"Daniel Henrique Barboza" <danielhb413@gmail.com>,
	"Halil Pasic" <pasic@linux.ibm.com>,
	"Thomas Huth" <thuth@redhat.com>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Christian Borntraeger" <borntraeger@linux.ibm.com>,
	"Artyom Tarasenko" <atar4qemu@gmail.com>,
	"Pavel Pisa" <pisa@cmp.felk.cvut.cz>,
	"Huacai Chen" <chenhuacai@kernel.org>,
	"Eric Farman" <farman@linux.ibm.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Greg Kurz" <groug@kaod.org>,
	"open list:S390 SCLP-backed..." <qemu-s390x@nongnu.org>,
	"open list:ARM PrimeCell and..." <qemu-arm@nongnu.org>,
	"Cédric Le Goater" <clg@kaod.org>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"David Hildenbrand" <david@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"David Gibson" <david@gibson.dropbear.id.au>,
	"Eduardo Habkost" <eduardo@habkost.net>,
	"open list:RISC-V TCG CPUs" <qemu-riscv@nongnu.org>,
	"Cornelia Huck" <cohuck@redhat.com>,
	"Laurent Vivier" <laurent@vivier.eu>,
	"Coiby Xu" <Coiby.Xu@gmail.com>,
	"open list:PowerPC TCG CPUs" <qemu-ppc@nongnu.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Aleksandar Rikalo" <aleksandar.rikalo@syrmia.com>,
	"Aurelien Jarno" <aurelien@aurel32.net>
Subject: Re: [PATCH 10/27] Replace config-time define HOST_WORDS_BIGENDIAN
Date: Wed, 16 Mar 2022 12:31:08 +0100	[thread overview]
Message-ID: <20220316123108.682cffa0.pasic@linux.ibm.com> (raw)
In-Reply-To: <20220316095308.2613651-1-marcandre.lureau@redhat.com>

On Wed, 16 Mar 2022 13:53:07 +0400
marcandre.lureau@redhat.com wrote:

> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> Replace a config-time define with a compile time condition
> define (compatible with clang and gcc) that must be declared prior to
> its usage. This avoids having a global configure time define, but also
> prevents from bad usage, if the config header wasn't included before.
> 
> This can help to make some code independent from qemu too.
> 
> gcc supports __BYTE_ORDER__ from about 4.6 and clang from 3.2.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>

LGTM

For the s390x parts I'm involved in:
Acked-by: Halil Pasic <pasic@linux.ibm.com>

[..]

> --- a/include/exec/cpu-all.h
> +++ b/include/exec/cpu-all.h
> @@ -34,13 +34,13 @@
>  
>  /* some important defines:
>   *
> - * HOST_WORDS_BIGENDIAN : if defined, the host cpu is big endian and
> + * HOST_BIG_ENDIAN : whether the host cpu is big endian and
>   * otherwise little endian.
>   *
>   * TARGET_WORDS_BIGENDIAN : same for target cpu
>   */

This comment does not seem spot on any more. BTW would it make sense
to replace TARGET_WORDS_BIGENDIAN with TARGET_BIG_ENDIAN as well. I
believe the bad usage argument applies equally to both, and IMHO we
should keep the both consistent naming and usage wise.

>  
> -#if defined(HOST_WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN)
> +#if HOST_BIG_ENDIAN != defined(TARGET_WORDS_BIGENDIAN)
>  #define BSWAP_NEEDED
>  #endif
>  

[..]


  parent reply	other threads:[~2022-03-16 11:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-16  9:53 [PATCH 10/27] Replace config-time define HOST_WORDS_BIGENDIAN marcandre.lureau
2022-03-16 10:28 ` Thomas Huth
2022-03-16 11:15   ` Halil Pasic
2022-03-16 11:20     ` Marc-André Lureau
2022-03-16 11:22     ` Thomas Huth
2022-03-16 11:31 ` Halil Pasic [this message]
2022-03-16 13:04 ` Philippe Mathieu-Daudé
2022-03-16 13:09   ` Marc-André Lureau
2022-03-16 13:11   ` Philippe Mathieu-Daudé
2022-03-17 11:31 ` Cédric Le Goater

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=20220316123108.682cffa0.pasic@linux.ibm.com \
    --to=pasic@linux.ibm.com \
    --cc=Coiby.Xu@gmail.com \
    --cc=aleksandar.rikalo@syrmia.com \
    --cc=alex.bennee@linaro.org \
    --cc=alistair.francis@wdc.com \
    --cc=atar4qemu@gmail.com \
    --cc=aurelien@aurel32.net \
    --cc=bin.meng@windriver.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=chenhuacai@kernel.org \
    --cc=clg@kaod.org \
    --cc=cohuck@redhat.com \
    --cc=danielhb413@gmail.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=david@redhat.com \
    --cc=dmitry.fleytman@gmail.com \
    --cc=eduardo@habkost.net \
    --cc=f4bug@amsat.org \
    --cc=farman@linux.ibm.com \
    --cc=fnu.vikram@xilinx.com \
    --cc=groug@kaod.org \
    --cc=jasowang@redhat.com \
    --cc=jcmvbkbc@gmail.com \
    --cc=kraxel@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=laurent@vivier.eu \
    --cc=marcandre.lureau@redhat.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=mst@redhat.com \
    --cc=palmer@dabbelt.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=peterx@redhat.com \
    --cc=pisa@cmp.felk.cvut.cz \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-block@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=stefanha@redhat.com \
    --cc=thuth@redhat.com \
    --cc=wangyanan55@huawei.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).