Skip to content

Commit

Permalink
icp: fix all !ENDBR objtool warnings in x86 Asm code
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Tino Reichardt <[email protected]>
Reviewed-by: Richard Yao <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Alexander Lobakin <[email protected]>
Closes openzfs#14035
  • Loading branch information
solbjorn authored and tonyhutter committed Nov 18, 2022
1 parent 12d2afc commit 1417fba
Show file tree
Hide file tree
Showing 10 changed files with 8,835 additions and 0 deletions.
2 changes: 2 additions & 0 deletions module/icp/asm-x86_64/aes/aes_amd64.S
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,7 @@ enc_tab:


ENTRY_NP(aes_encrypt_amd64)
ENDBR
#ifdef GLADMAN_INTERFACE
// Original interface
sub $[4*8], %rsp // gnu/linux/opensolaris binary interface
Expand Down Expand Up @@ -809,6 +810,7 @@ dec_tab:


ENTRY_NP(aes_decrypt_amd64)
ENDBR
#ifdef GLADMAN_INTERFACE
// Original interface
sub $[4*8], %rsp // gnu/linux/opensolaris binary interface
Expand Down
Loading

0 comments on commit 1417fba

Please sign in to comment.