Re: [PATCH v2 2/2] crypto: x86/aes-ni-xts - rewrite and drop indirections via glue helper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Ard,

I love your patch! Yet something to improve:

[auto build test ERROR on cryptodev/master]
[also build test ERROR on crypto/master linus/master v5.11-rc1 next-20201223]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Ard-Biesheuvel/crypto-x86-aes-ni-xts-recover-and-improve-performance/20210101-004902
base:   https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
config: i386-randconfig-c001-20201231 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/120e62f276c7436572e8a67ecfb9bbb1125bfd8d
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Ard-Biesheuvel/crypto-x86-aes-ni-xts-recover-and-improve-performance/20210101-004902
        git checkout 120e62f276c7436572e8a67ecfb9bbb1125bfd8d
        # save the attached .config to linux build tree
        make W=1 ARCH=i386 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

   ld: arch/x86/crypto/aesni-intel_asm.o: in function `aesni_xts_encrypt':
>> arch/x86/crypto/aesni-intel_asm.S:2844: undefined reference to `.Lcts_permute_table'
   ld: arch/x86/crypto/aesni-intel_asm.o: in function `aesni_xts_decrypt':
   arch/x86/crypto/aesni-intel_asm.S:3006: undefined reference to `.Lcts_permute_table'


vim +2844 arch/x86/crypto/aesni-intel_asm.S

  2702	
  2703	/*
  2704	 * _aesni_gf128mul_x_ble:		internal ABI
  2705	 *	Multiply in GF(2^128) for XTS IVs
  2706	 * input:
  2707	 *	IV:	current IV
  2708	 *	GF128MUL_MASK == mask with 0x87 and 0x01
  2709	 * output:
  2710	 *	IV:	next IV
  2711	 * changed:
  2712	 *	CTR:	== temporary value
  2713	 */
  2714	#define _aesni_gf128mul_x_ble() \
  2715		pshufd $0x13, IV, KEY; \
  2716		paddq IV, IV; \
  2717		psrad $31, KEY; \
  2718		pand GF128MUL_MASK, KEY; \
  2719		pxor KEY, IV;
  2720	
  2721	/*
  2722	 * void aesni_xts_encrypt(const struct crypto_aes_ctx *ctx, u8 *dst,
  2723	 *			  const u8 *src, unsigned int len, le128 *iv)
  2724	 */
  2725	SYM_FUNC_START(aesni_xts_encrypt)
  2726		FRAME_BEGIN
  2727	#ifndef __x86_64__
  2728		pushl IVP
  2729		pushl LEN
  2730		pushl KEYP
  2731		pushl KLEN
  2732		movl (FRAME_OFFSET+20)(%esp), KEYP	# ctx
  2733		movl (FRAME_OFFSET+24)(%esp), OUTP	# dst
  2734		movl (FRAME_OFFSET+28)(%esp), INP	# src
  2735		movl (FRAME_OFFSET+32)(%esp), LEN	# len
  2736		movl (FRAME_OFFSET+36)(%esp), IVP	# iv
  2737		movdqa .Lgf128mul_x_ble_mask, GF128MUL_MASK
  2738	#else
  2739		movdqa .Lgf128mul_x_ble_mask(%rip), GF128MUL_MASK
  2740	#endif
  2741		movups (IVP), IV
  2742	
  2743		mov 480(KEYP), KLEN
  2744	
  2745	.Lxts_enc_loop4:
  2746		sub $64, LEN
  2747		jl .Lxts_enc_1x
  2748	
  2749		movdqa IV, STATE1
  2750		movdqu 0x00(INP), IN
  2751		pxor IN, STATE1
  2752		movdqu IV, 0x00(OUTP)
  2753	
  2754		_aesni_gf128mul_x_ble()
  2755		movdqa IV, STATE2
  2756		movdqu 0x10(INP), IN
  2757		pxor IN, STATE2
  2758		movdqu IV, 0x10(OUTP)
  2759	
  2760		_aesni_gf128mul_x_ble()
  2761		movdqa IV, STATE3
  2762		movdqu 0x20(INP), IN
  2763		pxor IN, STATE3
  2764		movdqu IV, 0x20(OUTP)
  2765	
  2766		_aesni_gf128mul_x_ble()
  2767		movdqa IV, STATE4
  2768		movdqu 0x30(INP), IN
  2769		pxor IN, STATE4
  2770		movdqu IV, 0x30(OUTP)
  2771	
  2772		call _aesni_enc4
  2773	
  2774		movdqu 0x00(OUTP), IN
  2775		pxor IN, STATE1
  2776		movdqu STATE1, 0x00(OUTP)
  2777	
  2778		movdqu 0x10(OUTP), IN
  2779		pxor IN, STATE2
  2780		movdqu STATE2, 0x10(OUTP)
  2781	
  2782		movdqu 0x20(OUTP), IN
  2783		pxor IN, STATE3
  2784		movdqu STATE3, 0x20(OUTP)
  2785	
  2786		movdqu 0x30(OUTP), IN
  2787		pxor IN, STATE4
  2788		movdqu STATE4, 0x30(OUTP)
  2789	
  2790		_aesni_gf128mul_x_ble()
  2791	
  2792		add $64, INP
  2793		add $64, OUTP
  2794		test LEN, LEN
  2795		jnz .Lxts_enc_loop4
  2796	
  2797	.Lxts_enc_ret_iv:
  2798		movups IV, (IVP)
  2799	
  2800	.Lxts_enc_ret:
  2801	#ifndef __x86_64__
  2802		popl KLEN
  2803		popl KEYP
  2804		popl LEN
  2805		popl IVP
  2806	#endif
  2807		FRAME_END
  2808		ret
  2809	
  2810	.Lxts_enc_1x:
  2811		add $64, LEN
  2812		jz .Lxts_enc_ret_iv
  2813		sub $16, LEN
  2814		jl .Lxts_enc_cts4
  2815	
  2816	.Lxts_enc_loop1:
  2817		movdqu (INP), STATE
  2818		pxor IV, STATE
  2819		call _aesni_enc1
  2820		pxor IV, STATE
  2821		_aesni_gf128mul_x_ble()
  2822	
  2823		test LEN, LEN
  2824		jz .Lxts_enc_out
  2825	
  2826		add $16, INP
  2827		sub $16, LEN
  2828		jl .Lxts_enc_cts1
  2829	
  2830		movdqu STATE, (OUTP)
  2831		add $16, OUTP
  2832		jmp .Lxts_enc_loop1
  2833	
  2834	.Lxts_enc_out:
  2835		movdqu STATE, (OUTP)
  2836		jmp .Lxts_enc_ret_iv
  2837	
  2838	.Lxts_enc_cts4:
  2839		movdqa STATE4, STATE
  2840		sub $16, OUTP
  2841	
  2842	.Lxts_enc_cts1:
  2843	#ifndef __x86_64__
> 2844		lea .Lcts_permute_table, T1
  2845	#else
  2846		lea .Lcts_permute_table(%rip), T1
  2847	#endif
  2848		add LEN, INP		/* rewind input pointer */
  2849		add $16, LEN		/* # bytes in final block */
  2850		movups (INP), IN1
  2851	
  2852		mov T1, IVP
  2853		add $32, IVP
  2854		add LEN, T1
  2855		sub LEN, IVP
  2856		add OUTP, LEN
  2857	
  2858		movups (T1), %xmm4
  2859		movaps STATE, IN2
  2860		pshufb %xmm4, STATE
  2861		movups STATE, (LEN)
  2862	
  2863		movups (IVP), %xmm0
  2864		pshufb %xmm0, IN1
  2865		pblendvb IN2, IN1
  2866		movaps IN1, STATE
  2867	
  2868		pxor IV, STATE
  2869		call _aesni_enc1
  2870		pxor IV, STATE
  2871	
  2872		movups STATE, (OUTP)
  2873		jmp .Lxts_enc_ret
  2874	SYM_FUNC_END(aesni_xts_encrypt)
  2875	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux