[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241014042833.GA20015@sol.localdomain>
Date: Sun, 13 Oct 2024 21:28:33 -0700
From: Eric Biggers <ebiggers@...nel.org>
To: Ard Biesheuvel <ardb+git@...gle.com>
Cc: linux-kernel@...r.kernel.org, llvm@...ts.linux.dev,
keescook@...omium.org, linux-hardening@...r.kernel.org,
nathan@...nel.org, Ard Biesheuvel <ardb@...nel.org>,
Josh Poimboeuf <jpoimboe@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Jan Beulich <jbeulich@...e.com>,
"Jose E. Marchesi" <jemarch@....org>, Kees Cook <kees@...nel.org>
Subject: Re: [PATCH v3 6/8] crypto: x86/crc32c - Use idiomatic relative jump
table
On Fri, Oct 11, 2024 at 07:08:54PM +0200, Ard Biesheuvel wrote:
> diff --git a/arch/x86/crypto/crc32c-pcl-intel-asm_64.S b/arch/x86/crypto/crc32c-pcl-intel-asm_64.S
> index bbcff1fb78cb..45b005935194 100644
> --- a/arch/x86/crypto/crc32c-pcl-intel-asm_64.S
> +++ b/arch/x86/crypto/crc32c-pcl-intel-asm_64.S
> @@ -53,7 +53,7 @@
> .endm
>
> .macro JMPTBL_ENTRY i
> -.quad .Lcrc_\i
> +.long .Lcrc_\i - jump_table
> .endm
>
> .macro JNC_LESS_THAN j
> @@ -169,7 +169,8 @@ SYM_FUNC_START(crc_pcl)
>
> ## branch into array
> leaq jump_table(%rip), %bufp
> - mov (%bufp,%rax,8), %bufp
> + movslq (%bufp,%rax,4), len
> + addq len, %bufp
> JMP_NOSPEC bufp
I think it would be much better to just get rid of the jump table here.
I have done this at
https://lore.kernel.org/linux-crypto/20241014042447.50197-4-ebiggers@kernel.org/
- Eric
Powered by blists - more mailing lists