mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/3] objtool: Support the stack swizzle
@ 2021-02-09  9:16 Peter Zijlstra
  2021-02-09  9:16 ` [PATCH v2 1/3] x86/unwind/orc: Change REG_SP_INDIRECT Peter Zijlstra
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Peter Zijlstra @ 2021-02-09  9:16 UTC (permalink / raw)
  To: Josh Poimboeuf, Thomas Gleixner
  Cc: Miroslav Benes, Nick Desaulniers, Julien Thierry, Kees Cook, x86,
	linux-kernel, peterz

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-02-10  9:34 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-09  9:16 [PATCH v2 0/3] objtool: Support the stack swizzle Peter Zijlstra
2021-02-09  9:16 ` [PATCH v2 1/3] x86/unwind/orc: Change REG_SP_INDIRECT Peter Zijlstra
2021-02-09  9:16 ` [PATCH v2 2/3] objtool,x86: Additionally decode: mov %rsp, (%reg) Peter Zijlstra
2021-02-09 16:32   ` Josh Poimboeuf
2021-02-09 16:42     ` Peter Zijlstra
2021-02-10  9:08   ` [PATCH v2.1 " Peter Zijlstra
2021-02-10  9:31     ` Peter Zijlstra
2021-02-09  9:16 ` [PATCH v2 3/3] objtool: Support stack-swizzle Peter Zijlstra
2021-02-09 10:35   ` Peter Zijlstra
2021-02-09 15:45 ` [PATCH v2 0/3] objtool: Support the stack swizzle Miroslav Benes

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®