Skip to content

Commit 2cc17fd

Browse files
jpoimboeIngo Molnar
authored andcommitted
objtool: Support '-mtune=atom' stack frame setup instruction
Arnd reported that enabling CONFIG_MATOM results in a bunch of objtool false positive frame pointer warnings: arch/x86/events/intel/ds.o: warning: objtool: intel_pmu_pebs_del()+0x43: call without frame pointer save/setup security/keys/keyring.o: warning: objtool: keyring_read()+0x59: call without frame pointer save/setup kernel/signal.o: warning: objtool: __dequeue_signal()+0xd8: call without frame pointer save/setup ... objtool gets confused by the fact that the '-mtune=atom' GCC option sometimes uses 'lea (%rsp),%rbp' instead of 'mov %rsp,%rbp'. The instructions are effectively the same, but objtool doesn't know about the 'lea' variant. Fix the false warnings by adding support for 'lea (%rsp),%rbp' in the objtool decoder. Reported-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Andy Lutomirski <luto@kernel.org> Cc: Borislav Petkov <bp@alien8.de> Cc: Brian Gerst <brgerst@gmail.com> Cc: Denys Vlasenko <dvlasenk@redhat.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 597f03f commit 2cc17fd

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tools/objtool/arch/x86/decode.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,15 @@ int arch_decode_instruction(struct elf *elf, struct section *sec,
9898
*type = INSN_FP_SETUP;
9999
break;
100100

101+
case 0x8d:
102+
if (insn.rex_prefix.bytes &&
103+
insn.rex_prefix.bytes[0] == 0x48 &&
104+
insn.modrm.nbytes && insn.modrm.bytes[0] == 0x2c &&
105+
insn.sib.nbytes && insn.sib.bytes[0] == 0x24)
106+
/* lea %(rsp), %rbp */
107+
*type = INSN_FP_SETUP;
108+
break;
109+
101110
case 0x90:
102111
*type = INSN_NOP;
103112
break;

0 commit comments

Comments
 (0)