linux/tools/objtool
Peter Zijlstra 724c8a23d5 objtool: Fix stack-swizzle for FRAME_POINTER=y
When objtool encounters the stack-swizzle:

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

Inside a FRAME_POINTER=y build, things go a little screwy because
clearly we're not adjusting the cfa->base. This then results in the
pop %rsp not being detected as a restore of cfa->base so it will turn
into a regular POP and offset the stack, resulting in:

  kernel/softirq.o: warning: objtool: do_softirq()+0xdb: return with modified stack frame

Therefore, have "mov %[tos], %rsp" act like a PUSH (it sorta is
anyway) to balance the things out. We're not too concerned with the
actual stack_size for frame-pointer builds, since we don't generate
ORC data for them anyway.

Fixes: aafeb14e9d ("objtool: Support stack-swizzle")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Link: https://lkml.kernel.org/r/YC6UC+rc9KKmQrkd@hirez.programming.kicks-ass.net
2021-02-22 19:54:09 +01:00
..
arch/x86 objtool,x86: Additionally decode: mov %rsp, (%reg) 2021-02-10 20:53:52 +01:00
Documentation objtool: Support stack layout changes in alternatives 2021-01-14 09:53:54 -06:00
include/objtool objtool: Combine UNWIND_HINT_RET_OFFSET and UNWIND_HINT_FUNC 2021-01-26 11:12:00 -06:00
.gitignore objtool: Rework header include paths 2021-01-13 18:13:14 -06:00
Build objtool: Enable compilation of objtool for all architectures 2020-05-20 09:17:28 -05:00
builtin-check.c objtool: Rework header include paths 2021-01-13 18:13:14 -06:00
builtin-orc.c objtool: Refactor ORC section generation 2021-01-14 09:53:42 -06:00
check.c objtool: Fix stack-swizzle for FRAME_POINTER=y 2021-02-22 19:54:09 +01:00
elf.c Merge branch 'x86/paravirt' into x86/entry 2021-02-12 13:36:43 +01:00
Makefile objtool: Refactor ORC section generation 2021-01-14 09:53:42 -06:00
objtool.c objtool: Rework header include paths 2021-01-13 18:13:14 -06:00
orc_dump.c x86/unwind/orc: Change REG_SP_INDIRECT 2021-02-10 20:53:51 +01:00
orc_gen.c objtool: Support stack layout changes in alternatives 2021-01-14 09:53:54 -06:00
special.c objtool: Rework header include paths 2021-01-13 18:13:14 -06:00
sync-check.sh objtool: Make unwind hint definitions available to other architectures 2020-09-10 10:43:13 -05:00
weak.c objtool: Refactor ORC section generation 2021-01-14 09:53:42 -06:00