Re: [RFC PATCH 16/21] objtool: Add support for CONFIG_CFI_CLANG

From: Sami Tolvanen
Date: Fri Apr 29 2022 - 21:00:45 EST


On Fri, Apr 29, 2022 at 4:30 PM Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> Urgh, what does this do for decode speed? This is a hash-lookup for
> every single instruction.

Two actually, since .kcfi_traps only contains compiler-emitted
locations and we also have to check for manual type annotations. I
haven't measured performance yet, but I also didn't notice a
significant impact here.

> Is that kcfi location array sorted by the compiler? Because then you can
> keep a running iterator and replace the whole lookup with a simple
> equality comparison.

The compiler generates a separate .kcfi_types section for each text
section and the entries are emitted in order, so this should be
doable.

Sami