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

Re: [PATCH 2/7] ppc64el: kernel: config: little-endian powerpc64 options



Hi Ben,

On 05/25/2014 09:49 PM, Ben Hutchings wrote:
[...]
The thing with ppc64el is that it's usually not available for most
people to start on, so that debootstrap --second-stage (for running
in qemu-kvm, at least) is quite a common scenario nowadays.
[...]

Can you not run the second stage using qemu-ppc64le-static (or whatever
it's called)?

No; the kernel doesn't handle the 2 different ABIs at once, nor the
exception handlers' endianness being changed constantly at runtime,
I believe.

This is due to a combination of kernel/ABI/endianness incompatibility.
I'll refer you to this short and clear post [1] about that. It's a
good explanation that's been around.

Just for the record, in summary:

- powerpc64: runs only with ELFv1 ABI in big endian mode.
- powerpc64le: runs only w/ ELFv2 ABI in little endian mode.

"""
While the architecture in theory supports running big-endian and little
endian processes at the same time, this would also require Linux kernel
support; [...]

The kernel will be able to start up both ELFv1 and ELFv2 binaries (of
the same byte order). [...] we're not planning on actually
officially supporting both ABI versions in the same byte order, see
above.
""

And the calls for initially setting the exception handlers on each
endian mode occur early in the boot, and are mostly defined at build
time (vs. run time, which would be needed for userspace qemu AFAIK).
I couldn't find any support for it per-process. These patches sum
those evidences I could find [2] [3] [4].

There are more details about the ELFv2 ABI here [5].

Kind regards.

[1] https://gcc.gnu.org/ml/gcc-patches/2013-11/msg01347.html
[2] http://patchwork.ozlabs.org/patch/277051/
[3] http://patchwork.ozlabs.org/patch/265154/
[4] http://patchwork.ozlabs.org/patch/277054/
[5] https://wiki.debian.org/ppc64el#ABI_Documentation

--
Mauricio Faria de Oliveira
IBM Linux Technology Center


Reply to: