public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Claudio Imbrenda <imbrenda@linux.ibm.com>
To: Thomas Huth <thuth@redhat.com>
Cc: Pierre Morel <pmorel@linux.ibm.com>,
	kvm@vger.kernel.org, frankja@linux.ibm.com, david@redhat.com,
	cohuck@redhat.com
Subject: Re: [kvm-unit-tests PATCH] s390x: io: declare s390x CPU as big endian
Date: Fri, 12 Nov 2021 10:10:47 +0100	[thread overview]
Message-ID: <20211112101047.55fbca87@p-imbrenda> (raw)
In-Reply-To: <6b28a9e3-6129-0202-fb2c-6398c3363f28@redhat.com>

On Fri, 12 Nov 2021 08:38:38 +0100
Thomas Huth <thuth@redhat.com> wrote:

> On 11/11/2021 19.48, Pierre Morel wrote:
> > To use the swap byte transformations we need to declare
> > the s390x architecture as big endian.
> > 
> > Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
> > ---
> >   lib/s390x/asm/io.h | 1 +
> >   1 file changed, 1 insertion(+)
> > 
> > diff --git a/lib/s390x/asm/io.h b/lib/s390x/asm/io.h
> > index 1dc6283b..b5e661cf 100644
> > --- a/lib/s390x/asm/io.h
> > +++ b/lib/s390x/asm/io.h
> > @@ -10,6 +10,7 @@
> >   #define _ASMS390X_IO_H_
> >   
> >   #define __iomem
> > +#define __cpu_is_be() (1)
> >   
> >   #include <asm-generic/io.h>
> >   
> >   
> 
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> 
> Alternatively, I think you could also move this sequence from 
> lib/ppc64/asm/io.h into lib/asm-generic/io.h:
> 
> #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
> #define __cpu_is_be() (0)
> #elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
> #define __cpu_is_be() (1)
> #else
> #error Undefined byte order
> #endif
> 
> (replacing the hardcoded __cpu_is_be() in the generic code).
> 
>   Thomas

I think this looks cleaner


      reply	other threads:[~2021-11-12  9:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-11 18:48 [kvm-unit-tests PATCH] s390x: io: declare s390x CPU as big endian Pierre Morel
2021-11-12  7:38 ` Thomas Huth
2021-11-12  9:10   ` Claudio Imbrenda [this message]

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=20211112101047.55fbca87@p-imbrenda \
    --to=imbrenda@linux.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=pmorel@linux.ibm.com \
    --cc=thuth@redhat.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