Re: [PATCH v6 22/25] x86/asm: annotate indirect jumps
From: Peter Zijlstra
Date: Wed Oct 21 2020 - 05:52:06 EST
On Tue, Oct 20, 2020 at 01:52:17PM -0500, Josh Poimboeuf wrote:
> > arch/x86/lib/retpoline.S:
> > __x86_retpoline_rdi()+0x10: return with modified stack frame
> > __x86_retpoline_rdi()+0x0: stack state mismatch: cfa1=7+32 cfa2=7+8
> > __x86_retpoline_rdi()+0x0: stack state mismatch: cfa1=7+32 cfa2=-1+0
>
> Is this with upstream? I thought we fixed that with
> UNWIND_HINT_RET_OFFSET.
I can't reproduce this one either; but I do get different warnings:
gcc (Debian 10.2.0-13) 10.2.0, x86_64-defconfig:
defconfig-build/vmlinux.o: warning: objtool: __x86_indirect_thunk_rax() falls through to next function __x86_retpoline_rax()
defconfig-build/vmlinux.o: warning: objtool: .altinstr_replacement+0x1063: (branch)
defconfig-build/vmlinux.o: warning: objtool: __x86_indirect_thunk_rax()+0x0: (alt)
defconfig-build/vmlinux.o: warning: objtool: __x86_indirect_thunk_rax()+0x0: <=== (sym)
(for every single register, not just rax)
Which is daft as well, because the retpoline.o run is clean. It also
doesn't make sense because __x86_retpoline_rax isn't in fact STT_FUNC,
so WTH ?!