objtool: Add IBT/ENDBR decoding
authorPeter Zijlstra <peterz@infradead.org>
Tue, 8 Mar 2022 15:30:53 +0000 (16:30 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Tue, 15 Mar 2022 09:32:46 +0000 (10:32 +0100)
commit7d209d13e7c3a3d60dc262f11a8ae4e6b4454d30
tree89c6d78c5f1101bf73948acbe5cc71f5f8b09d71
parent96db4a988d653a7f18b518c25367f7bf238f4667
objtool: Add IBT/ENDBR decoding

Intel IBT requires the target of any indirect CALL or JMP instruction
to be the ENDBR instruction; optionally it allows those two
instructions to have a NOTRACK prefix in order to avoid this
requirement.

The kernel will not enable the use of NOTRACK, as such any occurence
of it in compiler generated code should be flagged.

Teach objtool to Decode ENDBR instructions and WARN about NOTRACK
prefixes.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Link: https://lore.kernel.org/r/20220308154319.645963517@infradead.org
tools/objtool/arch/x86/decode.c
tools/objtool/include/objtool/arch.h