x86/unwind/orc: Change REG_SP_INDIRECT
authorPeter Zijlstra <peterz@infradead.org>
Wed, 3 Feb 2021 11:02:21 +0000 (12:02 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 10 Feb 2021 19:53:51 +0000 (20:53 +0100)
commit87ccc826bf1c9e5ab4c2f649b404e02c63e47622
treee38d55a0877be33672867af408ecc512d44493ee
parent9077c016a39c78054f03e0354ad8409b47af68dc
x86/unwind/orc: Change REG_SP_INDIRECT

Currently REG_SP_INDIRECT is unused but means (%rsp + offset),
change it to mean (%rsp) + offset.

The reason is that we're going to swizzle stack in the middle of a C
function with non-trivial stack footprint. This means that when the
unwinder finds the ToS, it needs to dereference it (%rsp) and then add
the offset to the next frame, resulting in: (%rsp) + offset

This is somewhat unfortunate, since REG_BP_INDIRECT is used (by DRAP)
and thus needs to retain the current (%rbp + offset).

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Miroslav Benes <mbenes@suse.cz>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
arch/x86/kernel/unwind_orc.c
tools/objtool/orc_dump.c