Skip to content

Build ppc64le kernel using ABIv2

Anton Blanchard linuxppc-dev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest33 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/33powerpc: No need to use dot symbols when branching to a functionarch/powerpc/boot/util.S arch/powerpc/include/asm/context_tracking.h arch/powerpc/include/asm/exception-64e.h +23 more+270 -2700 replies
2/33powerpc: Remove superflous function descriptors in assembly only codearch/powerpc/kernel/entry_64.S arch/powerpc/kernel/exceptions-64s.S arch/powerpc/kernel/head_64.S +1 more+21 -200 replies
3/33powerpc: Don't use a function descriptor for system call tablearch/powerpc/kernel/entry_64.S arch/powerpc/kernel/systbl.S+8 -40 replies
4/33powerpc: Remove some unnecessary uses of _GLOBAL() and _STATIC()arch/powerpc/kernel/exceptions-64e.S arch/powerpc/kernel/exceptions-64s.S arch/powerpc/kernel/head_64.S+9 -90 replies
5/33powerpc: Remove _INIT_GLOBAL(), _STATIC() and _INIT_STATIC()arch/powerpc/include/asm/ppc_asm.h+0 -380 replies
6/33powerpc: Remove dot symbol usage in exception macrosarch/powerpc/kernel/exceptions-64e.S arch/powerpc/kernel/exceptions-64s.S+27 -270 replies
7/33powerpc: Create DOTSYM to wrap dot symbol usagearch/powerpc/include/asm/ppc_asm.h arch/powerpc/include/asm/systbl.h arch/powerpc/kernel/systbl.S +1 more+24 -220 replies
8/33powerpc: Remove function descriptors and dot symbols on new ABIarch/powerpc/include/asm/ftrace.h arch/powerpc/include/asm/linkage.h arch/powerpc/include/asm/ppc_asm.h+26 -00 replies
9/33powerpc: ABIv2 function calls must place target address in r12arch/powerpc/kernel/entry_64.S arch/powerpc/kernel/head_64.S arch/powerpc/kernel/misc_64.S+19 -130 replies
10/33powerpc: Ignore TOC relocationsarch/powerpc/kernel/prom_init_check.sh+1 -12 replies
11/33powerpc: Add ABIv2 support to ppc_function_entryarch/powerpc/include/asm/code-patching.h+36 -40 replies
12/33powerpc: Use ppc_function_entry instead of open coding itarch/powerpc/mm/hash_utils_64.c+8 -100 replies
13/33powerpc: Fix branch patching code for ABIv2arch/powerpc/mm/hash_low_64.S arch/powerpc/mm/hash_utils_64.c arch/powerpc/mm/slb.c +1 more+47 -330 replies
14/33powerpc: Fix kernel thread creation on ABIv2arch/powerpc/kernel/entry_64.S arch/powerpc/kernel/process.c+8 -130 replies
15/33powerpc: Fix ABIv2 issues with stack offsets in assembly codearch/powerpc/include/asm/ppc_asm.h arch/powerpc/lib/copypage_power7.S arch/powerpc/lib/copyuser_power7.S +2 more+34 -303 replies
16/33powerpc: Fix unsafe accesses to parameter area in ELFv2arch/powerpc/lib/copypage_power7.S arch/powerpc/lib/copyuser_power7.S arch/powerpc/lib/memcpy_64.S +2 more+32 -300 replies
17/33powerpc/tm: Use STK_PARAMarch/powerpc/kernel/tm.S+2 -30 replies
18/33powerpc/tm: Fix GOT save offset for ABIv2arch/powerpc/include/asm/ppc_asm.h arch/powerpc/kernel/tm.S+6 -40 replies
19/33powerpc/tracing: TRACE_WITH_FRAME_BUFFER creates invalid stack framesarch/powerpc/include/asm/irqflags.h+2 -20 replies
20/33powerpc: Fix SMP issues with ppc64le ABIv2arch/powerpc/kernel/head_64.S arch/powerpc/kernel/setup_64.c arch/powerpc/platforms/85xx/smp.c +4 more+22 -190 replies
21/33powerpc: Fix ABIv2 issue with dereference_function_descriptorarch/powerpc/include/asm/sections.h+2 -00 replies
22/33powerpc: make module stub code endian independentarch/powerpc/kernel/module_64.c+11 -310 replies
23/33powerpc: modules implement R_PPC64_TOCSAVE relocation.arch/powerpc/include/uapi/asm/elf.h arch/powerpc/kernel/module_64.c+12 -10 replies
24/33powerpc: EXPORT_SYMBOL(.TOC.)arch/powerpc/kernel/misc_64.S+19 -00 replies
25/33powerpc: module: handle MODVERSION for .TOC.arch/powerpc/kernel/misc_64.S+9 -00 replies
26/33powerpc: Fix up TOC. for modules.arch/powerpc/include/asm/module.h arch/powerpc/kernel/module_64.c+30 -00 replies
27/33powerpc: Handle new ELFv2 module relocationsarch/powerpc/include/uapi/asm/elf.h arch/powerpc/kernel/module_64.c+23 -11 reply
28/33powerpc: modules: comment about de-dotifying symbols when using the ELFv2 ABI.arch/powerpc/kernel/module_64.c+2 -10 replies
29/33powerpc: modules: change r2 save/restore offset for ELFv2 ABI.arch/powerpc/kernel/module_64.c+15 -80 replies
30/33powerpc: modules: use r12 for stub jump address.arch/powerpc/kernel/module_64.c+5 -50 replies
31/33powerpc: modules: skip r2 setup for ELFv2arch/powerpc/kernel/module_64.c+16 -60 replies
32/33powerpc: modules: implement stubs for ELFv2 ABI.arch/powerpc/kernel/module_64.c+61 -120 replies
33/33powerpc: Build little endian ppc64 kernel with ABIv2arch/powerpc/Makefile+6 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/33] Build ppc64le kernel using ABIv2

The following patches allow the kernel to be built using ABIv2 on a compatible LE toolchain. Module support thanks to Rusty. Thanks also to Uli for his help with some of assembly issues we tripped up on.

There are two known outstanding issues:

- If a kernel module calls into an exported assembly function which in turns calls out to C, r2 is going to be wrong. One example is __copy_tofrom_user_power7.

The reason is _GLOBAL() doesn't have a global entry point setup with the associated addis/addi used to create r2. I tried adding it and quickly realised that _GLOBAL is used places that will not tolerate the addi/addis (eg __start()).

- arch/powerpc/platforms/pseries/hvCall.S assumes we always have a parameter save area, which is incorrect for ABIv2. I tried to be intelligent and use the toc save area to store some information but that failed as soon as we started using modules. It would be nice to avoid a stack frame in the common (tracepoints disabled) case, but we may end up having to allocate one.

Anton
--

Anton Blanchard (21):
powerpc: No need to use dot symbols when branching to a function
powerpc: Remove superflous function descriptors in assembly only code
powerpc: Don't use a function descriptor for system call table
powerpc: Remove some unnecessary uses of _GLOBAL() and _STATIC()
powerpc: Remove _INIT_GLOBAL(), _STATIC() and _INIT_STATIC()
powerpc: Remove dot symbol usage in exception macros
powerpc: Create DOTSYM to wrap dot symbol usage
powerpc: Remove function descriptors and dot symbols on new ABI
powerpc: ABIv2 function calls must place target address in r12
powerpc: Ignore TOC relocations
powerpc: Add ABIv2 support to ppc_function_entry
powerpc: Use ppc_function_entry instead of open coding it
powerpc: Fix branch patching code for ABIv2
powerpc: Fix kernel thread creation on ABIv2
powerpc: Fix ABIv2 issues with stack offsets in assembly code powerpc/tm: Use STK_PARAM
powerpc/tm: Fix GOT save offset for ABIv2
powerpc/tracing: TRACE_WITH_FRAME_BUFFER creates invalid stack frames
powerpc: Fix SMP issues with ppc64le ABIv2
powerpc: Fix ABIv2 issue with dereference_function_descriptor
powerpc: Build little endian ppc64 kernel with ABIv2

Rusty Russell (11):
powerpc: make module stub code endian independent
powerpc: modules implement R_PPC64_TOCSAVE relocation.
powerpc: EXPORT_SYMBOL(.TOC.)
powerpc: module: handle MODVERSION for .TOC.
powerpc: Fix up TOC. for modules.
powerpc: Handle new ELFv2 module relocations
powerpc: modules: comment about de-dotifying symbols when using the
ELFv2 ABI.
powerpc: modules: change r2 save/restore offset for ELFv2 ABI.
powerpc: modules: use r12 for stub jump address.
powerpc: modules: skip r2 setup for ELFv2
powerpc: modules: implement stubs for ELFv2 ABI.

Ulrich Weigand (1):
powerpc: Fix unsafe accesses to parameter area in ELFv2

 arch/powerpc/Makefile                          |   8 +-
 arch/powerpc/boot/util.S                       |   4 +-
 arch/powerpc/include/asm/code-patching.h       |  40 ++++-
 arch/powerpc/include/asm/context_tracking.h    |   4 +-
 arch/powerpc/include/asm/exception-64e.h       |   6 +-
 arch/powerpc/include/asm/exception-64s.h       |   2 +-
 arch/powerpc/include/asm/ftrace.h              |   2 +
 arch/powerpc/include/asm/irqflags.h            |   8 +-
 arch/powerpc/include/asm/linkage.h             |   2 +
 arch/powerpc/include/asm/module.h              |   1 +
 arch/powerpc/include/asm/ppc_asm.h             |  64 ++++----
 arch/powerpc/include/asm/sections.h            |   2 +
 arch/powerpc/include/asm/systbl.h              |   6 +-
 arch/powerpc/include/uapi/asm/elf.h            |  10 +-
 arch/powerpc/kernel/cpu_setup_fsl_booke.S      |  28 ++--
 arch/powerpc/kernel/entry_64.S                 | 110 ++++++-------
 arch/powerpc/kernel/exceptions-64e.S           | 140 ++++++++---------
 arch/powerpc/kernel/exceptions-64s.S           | 204 ++++++++++++-------------
 arch/powerpc/kernel/head_64.S                  | 117 +++++++-------
 arch/powerpc/kernel/idle_book3e.S              |   2 +-
 arch/powerpc/kernel/idle_power4.S              |   2 +-
 arch/powerpc/kernel/idle_power7.S              |   4 +-
 arch/powerpc/kernel/misc_64.S                  |  46 +++++-
 arch/powerpc/kernel/module_64.c                | 199 ++++++++++++++++++------
 arch/powerpc/kernel/process.c                  |  17 +--
 arch/powerpc/kernel/prom_init_check.sh         |   2 +-
 arch/powerpc/kernel/setup_64.c                 |   2 +-
 arch/powerpc/kernel/systbl.S                   |  18 ++-
 arch/powerpc/kernel/tm.S                       |  13 +-
 arch/powerpc/kvm/book3s_hv_interrupts.S        |   2 +-
 arch/powerpc/kvm/book3s_hv_rmhandlers.S        |  32 ++--
 arch/powerpc/lib/copypage_64.S                 |   2 +-
 arch/powerpc/lib/copypage_power7.S             |  12 +-
 arch/powerpc/lib/copyuser_power7.S             |  32 ++--
 arch/powerpc/lib/hweight_64.S                  |   8 +-
 arch/powerpc/lib/mem_64.S                      |   4 +-
 arch/powerpc/lib/memcpy_64.S                   |   8 +-
 arch/powerpc/lib/memcpy_power7.S               |  26 ++--
 arch/powerpc/mm/hash_low_64.S                  |  44 ++++--
 arch/powerpc/mm/hash_utils_64.c                |  36 ++---
 arch/powerpc/mm/slb.c                          |  12 +-
 arch/powerpc/mm/slb_low.S                      |  12 +-
 arch/powerpc/platforms/85xx/smp.c              |   3 +-
 arch/powerpc/platforms/cell/smp.c              |   5 +-
 arch/powerpc/platforms/pasemi/powersave.S      |   2 +-
 arch/powerpc/platforms/powernv/opal-takeover.S |   2 +
 arch/powerpc/platforms/powernv/opal-wrappers.S |   4 +-
 arch/powerpc/platforms/powernv/smp.c           |   5 +-
 arch/powerpc/platforms/pseries/hvCall.S        |   4 +-
 arch/powerpc/platforms/pseries/smp.c           |   5 +-
 arch/powerpc/platforms/wsp/scom_smp.c          |   3 +-
 51 files changed, 760 insertions(+), 566 deletions(-)
Signature · 1 line
1.8.3.2