All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Weiser <michael.weiser@gmx.de>
To: Laurent Vivier <laurent@vivier.eu>
Cc: qemu-devel@nongnu.org, Riku Voipio <riku.voipio@iki.fi>
Subject: Re: [Qemu-devel] [PATCH v2 5/5] linux-user: Add aarch64_be magic numbers to qemu-binfmt-conf.sh
Date: Wed, 20 Dec 2017 21:29:18 +0100	[thread overview]
Message-ID: <20171220202918.GA18146@weiser.dinsnail.net> (raw)
In-Reply-To: <bcf948cb-fe73-bc72-5e93-b776740fa80d@vivier.eu>

Hi Laurent,

On Wed, Dec 20, 2017 at 05:43:34PM +0100, Laurent Vivier wrote:

> >> So it's not like on intel/AMD where we can execute a 32bit binary on a
> >> 64bit kernel?
> > 
> > An aarch64 CPU is capable of running arm (i.e. aarch32) code. And I
> > think this is supported as a multilib setup on Linux. But not in mixed
> > endianess as far as I know.
> > 
> > Looking at the code again, I'm confused now: Wouldn't the current logic
> > treat an actual i386 machine as capable of running x86_64 binaries
> > natively and omit registering the handler for x86_64?
> - on 32bit machine, we don't register the interpreter because the
> interpreter cannot work,

Okay, makes sense.

Meanwhile I verified that a little-endian arm kernel indeed refuses to
run a statically linked big-endian arm binary and vice-versa with
ENOEXEC ("Exec format error").

Looking at fs/binfmt_elf.c of the kernel, I understand that the kernel
makes no attempt to adjust for binary images of differing endianness.
Because the e_type ELF header field is byte-swapped in the big-endian
arm ELF binary, the kernel will see an invalid executable type and
return ENOEXEC.

Based on this I'm reasonably sure that a mixed little-/big-endian
userland is not currently possible on Linux. So I've gone with the
arm/armeb family split.

I'll push out a new version of the patch series with all the discussed
changes in a minute.
-- 
Bye,
Michael

  reply	other threads:[~2017-12-20 20:30 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-19 20:16 [Qemu-devel] [PATCH v2 0/5] Add aarch64_be-linux-user target Michael Weiser
2017-12-19 20:16 ` [Qemu-devel] [PATCH v2 1/5] linux-user: Add support for big-endian aarch64 Michael Weiser
2017-12-19 20:16 ` [Qemu-devel] [PATCH v2 2/5] linux-user: Add separate aarch64_be uname Michael Weiser
2017-12-20 15:20   ` Laurent Vivier
2017-12-20 15:36     ` Peter Maydell
2017-12-20 15:51       ` Laurent Vivier
2017-12-20 16:01       ` Michael Weiser
2017-12-19 20:16 ` [Qemu-devel] [PATCH v2 3/5] linux-user: Fix endianess of aarch64 signal trampoline Michael Weiser
2017-12-19 20:16 ` [Qemu-devel] [PATCH v2 4/5] configure: Add aarch64_be-linux-user target Michael Weiser
2017-12-20 14:55   ` Laurent Vivier
2017-12-20 15:51     ` Michael Weiser
2017-12-19 20:16 ` [Qemu-devel] [PATCH v2 5/5] linux-user: Add aarch64_be magic numbers to qemu-binfmt-conf.sh Michael Weiser
2017-12-20 14:18   ` Laurent Vivier
2017-12-20 15:37     ` Michael Weiser
2017-12-20 15:56       ` Laurent Vivier
2017-12-20 16:15         ` Michael Weiser
2017-12-20 16:43           ` Laurent Vivier
2017-12-20 20:29             ` Michael Weiser [this message]
2017-12-19 20:45 ` [Qemu-devel] [PATCH v2 0/5] Add aarch64_be-linux-user target no-reply

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=20171220202918.GA18146@weiser.dinsnail.net \
    --to=michael.weiser@gmx.de \
    --cc=laurent@vivier.eu \
    --cc=qemu-devel@nongnu.org \
    --cc=riku.voipio@iki.fi \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.