Re: [kvm-unit-tests PATCH] s390x: io: declare s390x CPU as big endian

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 12 Nov 2021 08:38:38 +0100
Thomas Huth <thuth@xxxxxxxxxx> 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@xxxxxxxxxxxxx>
> > ---
> >   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@xxxxxxxxxx>
> 
> 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




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux