Skip to content

Commit

Permalink
x86/crypto/crc32c-pcl-intel: Standardize jump table
Browse files Browse the repository at this point in the history
Simplify the jump table code so that it resembles a compiler-generated
table.

This enables ORC unwinding by allowing objtool to follow all the
potential code paths.

Signed-off-by: Josh Poimboeuf <[email protected]>
Tested-by: Ard Biesheuvel <[email protected]>
Acked-by: Ard Biesheuvel <[email protected]>
Tested-by: Sami Tolvanen <[email protected]>
Acked-by: Peter Zijlstra (Intel) <[email protected]>
Acked-by: Herbert Xu <[email protected]>
Link: https://lore.kernel.org/r/5357a039def90b8ef6b5874ef12cda008ecf18ba.1614182415.git.jpoimboe@redhat.com
  • Loading branch information
jpoimboe committed Apr 19, 2021
1 parent dabe516 commit 2b02ed5
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions arch/x86/crypto/crc32c-pcl-intel-asm_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
.endm

.macro JMPTBL_ENTRY i
.word crc_\i - crc_array
.quad crc_\i
.endm

.macro JNC_LESS_THAN j
Expand Down Expand Up @@ -168,10 +168,7 @@ continue_block:
xor crc2, crc2

## branch into array
lea jump_table(%rip), %bufp
movzwq (%bufp, %rax, 2), len
lea crc_array(%rip), %bufp
lea (%bufp, len, 1), %bufp
mov jump_table(,%rax,8), %bufp
JMP_NOSPEC bufp

################################################################
Expand Down

0 comments on commit 2b02ed5

Please sign in to comment.