Re: [PATCH 1/3] crypto: X25519 low-level primitives for ppc64le.

2024-05-16 Thread Segher Boessenkool
Hi! On Thu, May 16, 2024 at 10:06:58PM +1000, Michael Ellerman wrote: > Andy Polyakov writes: > >>> +.abiversion 2 > >> > >> I'd prefer that was left to the compiler flags. > > > > Problem is that it's the compiler that is responsible for providing this > > directive in the intermediate .s p

Re: [PATCH 1/3] crypto: X25519 low-level primitives for ppc64le.

2024-05-16 Thread Andy Polyakov
Hi, +.abiversion2 I'd prefer that was left to the compiler flags. Problem is that it's the compiler that is responsible for providing this directive in the intermediate .s prior invoking the assembler. And there is no assembler flag to pass through -Wa. Hmm, right. But none of our exis

Re: [PATCH 1/3] crypto: X25519 low-level primitives for ppc64le.

2024-05-16 Thread Michael Ellerman
Andy Polyakov writes: > Hi, > >>> +.abiversion2 >> >> I'd prefer that was left to the compiler flags. > > Problem is that it's the compiler that is responsible for providing this > directive in the intermediate .s prior invoking the assembler. And there > is no assembler flag to pass throu

Re: [PATCH 1/3] crypto: X25519 low-level primitives for ppc64le.

2024-05-16 Thread Danny Tsen
Hi Andy, I learned something here.  Will fix this.  Thanks. -Danny On 5/16/24 3:38 AM, Andy Polyakov wrote: Hi, +.abiversion    2 I'd prefer that was left to the compiler flags. Problem is that it's the compiler that is responsible for providing this directive in the intermediate .s pri

Re: [PATCH 1/3] crypto: X25519 low-level primitives for ppc64le.

2024-05-16 Thread Danny Tsen
On 5/15/24 11:53 PM, Michael Ellerman wrote: Hi Danny, Danny Tsen writes: Use the perl output of x25519-ppc64.pl from CRYPTOGAMs and added three supporting functions, x25519_fe51_sqr_times, x25519_fe51_frombytes and x25519_fe51_tobytes. For other algorithms we have checked-in the perl scrip

Re: [PATCH 1/3] crypto: X25519 low-level primitives for ppc64le.

2024-05-16 Thread Andy Polyakov
Hi, +.abiversion2 I'd prefer that was left to the compiler flags. Problem is that it's the compiler that is responsible for providing this directive in the intermediate .s prior invoking the assembler. And there is no assembler flag to pass through -Wa. If concern is ABI neutrality, t

Re: [PATCH 1/3] crypto: X25519 low-level primitives for ppc64le.

2024-05-15 Thread Michael Ellerman
Hi Danny, Danny Tsen writes: > Use the perl output of x25519-ppc64.pl from CRYPTOGAMs and added three > supporting functions, x25519_fe51_sqr_times, x25519_fe51_frombytes > and x25519_fe51_tobytes. For other algorithms we have checked-in the perl script and generated the code at runtime. Is ther

Re: [PATCH 1/3] crypto: X25519 low-level primitives for ppc64le.

2024-05-15 Thread Danny Tsen
See inline. On 5/15/24 4:06 AM, Andy Polyakov wrote: Hi, +SYM_FUNC_START(x25519_fe51_sqr_times) ... + +.Lsqr_times_loop: ... + +    std    9,16(3) +    std    10,24(3) +    std    11,32(3) +    std    7,0(3) +    std    8,8(3) +    bdnz    .Lsqr_times_loop I see no reason for why the stores

Re: [PATCH 1/3] crypto: X25519 low-level primitives for ppc64le.

2024-05-15 Thread Danny Tsen
Thank you Andy.  Will fix this. On 5/15/24 3:11 AM, Andy Polyakov wrote: Hi, Couple of remarks inline. +# [1] https://www.openssl.org/~appro/cryptogams/ https://github.com/dot-asm/cryptogams/ is arguably better reference. +SYM_FUNC_START(x25519_fe51_mul) +.align    5 The goal is to alig

Re: [PATCH 1/3] crypto: X25519 low-level primitives for ppc64le.

2024-05-15 Thread Andy Polyakov
Hi, +SYM_FUNC_START(x25519_fe51_sqr_times) ... + +.Lsqr_times_loop: ... + + std 9,16(3) + std 10,24(3) + std 11,32(3) + std 7,0(3) + std 8,8(3) + bdnz.Lsqr_times_loop I see no reason for why the stores can't be moved outside the loop

Re: [PATCH 1/3] crypto: X25519 low-level primitives for ppc64le.

2024-05-15 Thread Andy Polyakov
Hi, Couple of remarks inline. +# [1] https://www.openssl.org/~appro/cryptogams/ https://github.com/dot-asm/cryptogams/ is arguably better reference. +SYM_FUNC_START(x25519_fe51_mul) +.align 5 The goal is to align the label, not the first instruction after the directive. It's not a proble

[PATCH 1/3] crypto: X25519 low-level primitives for ppc64le.

2024-05-14 Thread Danny Tsen
Use the perl output of x25519-ppc64.pl from CRYPTOGAMs and added three supporting functions, x25519_fe51_sqr_times, x25519_fe51_frombytes and x25519_fe51_tobytes. Signed-off-by: Danny Tsen --- arch/powerpc/crypto/curve25519-ppc64le_asm.S | 648 +++ 1 file changed, 648 insertions(