HomeFreeBSD

icp: fix all !ENDBR objtool warnings in x86 Asm code

Description

icp: fix all !ENDBR objtool warnings in x86 Asm code

Currently, only Blake3 x86 Asm code has signs of being ENDBR-aware.
At least, under certain conditions it includes some header file and
uses some custom macro from there.
Linux has its own NOENDBR since several releases ago. It's defined
in the same <asm/linkage.h>, so currently <sys/asm_linkage.h>
already is provided with it.

Let's unify those two into one %ENDBR macro. At first, check if it's
present already. If so -- use Linux kernel version. Otherwise, try
to go that second way and use %_CET_ENDBR from <cet.h> if available.
If no, fall back to just empty definition.
This fixes a couple more 'relocations to !ENDBR' across the module.
And now that we always have the latest/actual ENDBR definition, use
it at the entrance of the few corresponding functions that objtool
still complains about. This matches the way how it's used in the
upstream x86 core Asm code.

Reviewed-by: Attila Fülöp <attila@fueloep.org>
Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Lobakin <alobakin@pm.me>
Closes #14035

Details

Provenance
Alexander Lobakin <alobakin@pm.me>Authored on Oct 16 2022, 9:41 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Nov 4 2022, 6:25 PM
Parents
rG61cca6fa0506: icp: fix rodata being marked as text in x86 Asm code
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG73b8f700b68d: icp: fix all !ENDBR objtool warnings in x86 Asm code (authored by Alexander Lobakin <alobakin@pm.me>).Nov 4 2022, 6:25 PM