Skip to content

objtool: Support the stack swizzle

Peter Zijlstra lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 5 repliesIn review
  2. v15 patches 3 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3x86/unwind/orc: Change REG_SP_INDIRECTarch/x86/kernel/unwind_orc.c tools/objtool/orc_dump.c+5 -20 replies
2/3objtool,x86: Additionally decode: mov %rsp, (%reg)tools/objtool/arch/x86/decode.c+18 -52 replies
2/3objtool,x86: Additionally decode: mov %rsp, (%reg)tools/objtool/arch/x86/decode.c+34 -81 reply
3/3objtool: Support stack-swizzletools/objtool/check.c+45 -01 reply

Reviews trailers per patch

None of the 4 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchMiroslav Benes
SeriesR-b
1/3
2/3
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/3] objtool: Support the stack swizzle

Hi!

Implement objtool support for the x86_64 stack swizzle pattern.

This means we can use the minial stack swizzle:

mov %rsp, (%[tos])
mov %[tos], %rsp
...
pop %rsp

from inline asm, with arbitrary stack setup. The ORC data for the Top-of-Stack will use the SP_INDIRECT CFA base. In order for this to work, SP_INDIRECT needs to first dereference and then add the offset to find the next frame.

Therefore we need to change SP_INDIRECT (which is currently unused) to mean:
(%rsp) + offset.

Changes since v1 include:

- removed the !callee saved reg restriction by using the vals[] array over the regs[] array.

- per the above, removed the patches creating the regs[] scratch space.

- more comments.

- rebased to tip/objtool/core