[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e7316f1752a846d98735610d7b795223@AcuMS.aculab.com>
Date: Wed, 30 Sep 2020 13:06:27 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Vasily Gorbik' <gor@...ux.ibm.com>,
Josh Poimboeuf <jpoimboe@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>
CC: Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
"x86@...nel.org" <x86@...nel.org>,
"H. Peter Anvin" <hpa@...or.com>,
"Miroslav Benes" <mbenes@...e.cz>,
Alexandre Chartre <alexandre.chartre@...cle.com>,
Julien Thierry <jthierry@...hat.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [RFC PATCH v2 2/2] objtool: fix x86 orc generation on big endian
cross compiles
From: Vasily Gorbik
> Sent: 30 September 2020 13:24
>
> Correct objtool orc generation endianness problems to enable fully
> functional x86 cross compiles on big endian hardware.
>
...
> +
> +#if defined(__BYTE_ORDER) ? __BYTE_ORDER == __LITTLE_ENDIAN : defined(__LITTLE_ENDIAN)
> +
> struct orc_entry {
> s16 sp_offset;
> s16 bp_offset;
> @@ -57,6 +67,20 @@ struct orc_entry {
> unsigned end:1;
> } __packed;
>
> +#else
> +
> +struct orc_entry {
> + s16 sp_offset;
> + s16 bp_offset;
> + unsigned bp_reg:4;
> + unsigned sp_reg:4;
> + unsigned unused:5;
> + unsigned end:1;
> + unsigned type:2;
> +} __packed;
> +
> +#endif
Shouldn't that be checking BITFIELD_ENDIAN.
I also think that (in the other patch) you can assume
that you don't need to byteswap if __KERNEL__ is defined.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Powered by blists - more mailing lists