crypto: x86/crc32c - Use RIP-relative addressing
authorArd Biesheuvel <ardb@kernel.org>
Wed, 12 Apr 2023 11:00:29 +0000 (13:00 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 20 Apr 2023 10:20:04 +0000 (18:20 +0800)
Prefer RIP-relative addressing where possible, which removes the need
for boot time relocation fixups.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/x86/crypto/crc32c-pcl-intel-asm_64.S

index ec35915..5f843dc 100644 (file)
@@ -168,7 +168,8 @@ continue_block:
        xor     crc2, crc2
 
        ## branch into array
-       mov     jump_table(,%rax,8), %bufp
+       leaq    jump_table(%rip), %bufp
+       mov     (%bufp,%rax,8), %bufp
        JMP_NOSPEC bufp
 
        ################################################################