mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Vasily Gorbik' <gor@linux.ibm.com>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	"x86@kernel.org" <x86@kernel.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"Miroslav Benes" <mbenes@suse.cz>,
	Alexandre Chartre <alexandre.chartre@oracle.com>,
	Julien Thierry <jthierry@redhat.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [RFC PATCH v2 2/2] objtool: fix x86 orc generation on big endian cross compiles
Date: Wed, 30 Sep 2020 13:06:27 +0000	[thread overview]
Message-ID: <e7316f1752a846d98735610d7b795223@AcuMS.aculab.com> (raw)
In-Reply-To: <patch-2.thread-ca645c.git-ca645c336a18.your-ad-here.call-01601468251-ext-3723@work.hours>

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)

      reply	other threads:[~2020-09-30 13:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-30  9:58 [RFC PATCH 0/2] objtool and cross compilation Vasily Gorbik
2020-09-30  9:58 ` [RFC PATCH 1/2] objtool: x86 instruction decoder and big endian cross compiles Vasily Gorbik
2020-09-30  9:58 ` [RFC PATCH 2/2] objtool: fix x86 orc generation on " Vasily Gorbik
2020-09-30 10:12 ` [RFC PATCH 0/2] objtool and cross compilation Peter Zijlstra
2020-09-30 12:24   ` [RFC PATCH v2 " Vasily Gorbik
2020-09-30 12:24     ` [RFC PATCH v2 1/2] objtool: x86 instruction decoder and big endian cross compiles Vasily Gorbik
2020-09-30 15:19       ` Josh Poimboeuf
2020-09-30 12:24     ` [RFC PATCH v2 2/2] objtool: fix x86 orc generation on " Vasily Gorbik
2020-09-30 13:06       ` David Laight [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=e7316f1752a846d98735610d7b795223@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=alexandre.chartre@oracle.com \
    --cc=bp@alien8.de \
    --cc=gor@linux.ibm.com \
    --cc=hpa@zytor.com \
    --cc=jpoimboe@redhat.com \
    --cc=jthierry@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbenes@suse.cz \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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

all inboxes | Powered by JetHome®