Re: [PATCH] crypto: cipher - move API definition to internal header file

[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]
[cannot apply to crypto/master v5.5-rc5 next-20200109]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Ard-Biesheuvel/crypto-cipher-move-API-definition-to-internal-header-file/20200110-193618
base:   https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
config: powerpc-defconfig (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 7.5.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.5.0 make.cross ARCH=powerpc 

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

All error/warnings (new ones prefixed by >>):

   drivers/crypto/vmx/aes.c: In function 'p8_aes_init':
>> drivers/crypto/vmx/aes.c:33:13: error: implicit declaration of function 'crypto_alloc_cipher'; did you mean 'crypto_alloc_comp'? [-Werror=implicit-function-declaration]
     fallback = crypto_alloc_cipher(alg, 0, CRYPTO_ALG_NEED_FALLBACK);
                ^~~~~~~~~~~~~~~~~~~
                crypto_alloc_comp
>> drivers/crypto/vmx/aes.c:33:11: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     fallback = crypto_alloc_cipher(alg, 0, CRYPTO_ALG_NEED_FALLBACK);
              ^
>> drivers/crypto/vmx/aes.c:41:2: error: implicit declaration of function 'crypto_cipher_set_flags'; did you mean 'crypto_tfm_set_flags'? [-Werror=implicit-function-declaration]
     crypto_cipher_set_flags(fallback,
     ^~~~~~~~~~~~~~~~~~~~~~~
     crypto_tfm_set_flags
>> drivers/crypto/vmx/aes.c:42:5: error: implicit declaration of function 'crypto_cipher_get_flags'; did you mean 'crypto_tfm_get_flags'? [-Werror=implicit-function-declaration]
        crypto_cipher_get_flags((struct
        ^~~~~~~~~~~~~~~~~~~~~~~
        crypto_tfm_get_flags
   drivers/crypto/vmx/aes.c: In function 'p8_aes_exit':
>> drivers/crypto/vmx/aes.c:55:3: error: implicit declaration of function 'crypto_free_cipher'; did you mean 'crypto_free_comp'? [-Werror=implicit-function-declaration]
      crypto_free_cipher(ctx->fallback);
      ^~~~~~~~~~~~~~~~~~
      crypto_free_comp
   drivers/crypto/vmx/aes.c: In function 'p8_aes_setkey':
>> drivers/crypto/vmx/aes.c:75:9: error: implicit declaration of function 'crypto_cipher_setkey'; did you mean 'crypto_aes_set_key'? [-Werror=implicit-function-declaration]
     ret |= crypto_cipher_setkey(ctx->fallback, key, keylen);
            ^~~~~~~~~~~~~~~~~~~~
            crypto_aes_set_key
   drivers/crypto/vmx/aes.c: In function 'p8_aes_encrypt':
>> drivers/crypto/vmx/aes.c:85:3: error: implicit declaration of function 'crypto_cipher_encrypt_one'; did you mean 'crypto_stats_skcipher_encrypt'? [-Werror=implicit-function-declaration]
      crypto_cipher_encrypt_one(ctx->fallback, dst, src);
      ^~~~~~~~~~~~~~~~~~~~~~~~~
      crypto_stats_skcipher_encrypt
   drivers/crypto/vmx/aes.c: In function 'p8_aes_decrypt':
>> drivers/crypto/vmx/aes.c:102:3: error: implicit declaration of function 'crypto_cipher_decrypt_one'; did you mean 'crypto_comp_decompress'? [-Werror=implicit-function-declaration]
      crypto_cipher_decrypt_one(ctx->fallback, dst, src);
      ^~~~~~~~~~~~~~~~~~~~~~~~~
      crypto_comp_decompress
   cc1: some warnings being treated as errors

vim +33 drivers/crypto/vmx/aes.c

8676590a159320 Marcelo H. Cerri          2015-02-06   26  
8676590a159320 Marcelo H. Cerri          2015-02-06   27  static int p8_aes_init(struct crypto_tfm *tfm)
8676590a159320 Marcelo H. Cerri          2015-02-06   28  {
78557e77b25a98 Tudor-Dan Ambarus         2017-06-16   29  	const char *alg = crypto_tfm_alg_name(tfm);
8676590a159320 Marcelo H. Cerri          2015-02-06   30  	struct crypto_cipher *fallback;
8676590a159320 Marcelo H. Cerri          2015-02-06   31  	struct p8_aes_ctx *ctx = crypto_tfm_ctx(tfm);
8676590a159320 Marcelo H. Cerri          2015-02-06   32  
8676590a159320 Marcelo H. Cerri          2015-02-06  @33  	fallback = crypto_alloc_cipher(alg, 0, CRYPTO_ALG_NEED_FALLBACK);
8676590a159320 Marcelo H. Cerri          2015-02-06   34  	if (IS_ERR(fallback)) {
4beb106045976b Herbert Xu                2015-06-15   35  		printk(KERN_ERR
4beb106045976b Herbert Xu                2015-06-15   36  		       "Failed to allocate transformation for '%s': %ld\n",
8676590a159320 Marcelo H. Cerri          2015-02-06   37  		       alg, PTR_ERR(fallback));
8676590a159320 Marcelo H. Cerri          2015-02-06   38  		return PTR_ERR(fallback);
8676590a159320 Marcelo H. Cerri          2015-02-06   39  	}
8676590a159320 Marcelo H. Cerri          2015-02-06   40  
8676590a159320 Marcelo H. Cerri          2015-02-06  @41  	crypto_cipher_set_flags(fallback,
4beb106045976b Herbert Xu                2015-06-15  @42  				crypto_cipher_get_flags((struct
4beb106045976b Herbert Xu                2015-06-15   43  							 crypto_cipher *)
4beb106045976b Herbert Xu                2015-06-15   44  							tfm));
8676590a159320 Marcelo H. Cerri          2015-02-06   45  	ctx->fallback = fallback;
8676590a159320 Marcelo H. Cerri          2015-02-06   46  
8676590a159320 Marcelo H. Cerri          2015-02-06   47  	return 0;
8676590a159320 Marcelo H. Cerri          2015-02-06   48  }
8676590a159320 Marcelo H. Cerri          2015-02-06   49  
8676590a159320 Marcelo H. Cerri          2015-02-06   50  static void p8_aes_exit(struct crypto_tfm *tfm)
8676590a159320 Marcelo H. Cerri          2015-02-06   51  {
8676590a159320 Marcelo H. Cerri          2015-02-06   52  	struct p8_aes_ctx *ctx = crypto_tfm_ctx(tfm);
8676590a159320 Marcelo H. Cerri          2015-02-06   53  
8676590a159320 Marcelo H. Cerri          2015-02-06   54  	if (ctx->fallback) {
8676590a159320 Marcelo H. Cerri          2015-02-06  @55  		crypto_free_cipher(ctx->fallback);
8676590a159320 Marcelo H. Cerri          2015-02-06   56  		ctx->fallback = NULL;
8676590a159320 Marcelo H. Cerri          2015-02-06   57  	}
8676590a159320 Marcelo H. Cerri          2015-02-06   58  }
8676590a159320 Marcelo H. Cerri          2015-02-06   59  
8676590a159320 Marcelo H. Cerri          2015-02-06   60  static int p8_aes_setkey(struct crypto_tfm *tfm, const u8 *key,
8676590a159320 Marcelo H. Cerri          2015-02-06   61  			 unsigned int keylen)
8676590a159320 Marcelo H. Cerri          2015-02-06   62  {
8676590a159320 Marcelo H. Cerri          2015-02-06   63  	int ret;
8676590a159320 Marcelo H. Cerri          2015-02-06   64  	struct p8_aes_ctx *ctx = crypto_tfm_ctx(tfm);
8676590a159320 Marcelo H. Cerri          2015-02-06   65  
5f76eea88dcbe7 David Hildenbrand         2015-05-11   66  	preempt_disable();
8676590a159320 Marcelo H. Cerri          2015-02-06   67  	pagefault_disable();
2d6f0600b2cd75 Leonidas Da Silva Barbosa 2015-07-13   68  	enable_kernel_vsx();
8676590a159320 Marcelo H. Cerri          2015-02-06   69  	ret = aes_p8_set_encrypt_key(key, keylen * 8, &ctx->enc_key);
694e0db6600c12 Eric Biggers              2019-04-09   70  	ret |= aes_p8_set_decrypt_key(key, keylen * 8, &ctx->dec_key);
dc4fbba11e4661 Anton Blanchard           2015-10-29   71  	disable_kernel_vsx();
8676590a159320 Marcelo H. Cerri          2015-02-06   72  	pagefault_enable();
5f76eea88dcbe7 David Hildenbrand         2015-05-11   73  	preempt_enable();
8676590a159320 Marcelo H. Cerri          2015-02-06   74  
694e0db6600c12 Eric Biggers              2019-04-09  @75  	ret |= crypto_cipher_setkey(ctx->fallback, key, keylen);
694e0db6600c12 Eric Biggers              2019-04-09   76  
694e0db6600c12 Eric Biggers              2019-04-09   77  	return ret ? -EINVAL : 0;
8676590a159320 Marcelo H. Cerri          2015-02-06   78  }
8676590a159320 Marcelo H. Cerri          2015-02-06   79  
8676590a159320 Marcelo H. Cerri          2015-02-06   80  static void p8_aes_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
8676590a159320 Marcelo H. Cerri          2015-02-06   81  {
8676590a159320 Marcelo H. Cerri          2015-02-06   82  	struct p8_aes_ctx *ctx = crypto_tfm_ctx(tfm);
8676590a159320 Marcelo H. Cerri          2015-02-06   83  
626ddb2fbe7931 Eric Biggers              2019-04-12   84  	if (!crypto_simd_usable()) {
8676590a159320 Marcelo H. Cerri          2015-02-06  @85  		crypto_cipher_encrypt_one(ctx->fallback, dst, src);
8676590a159320 Marcelo H. Cerri          2015-02-06   86  	} else {
5f76eea88dcbe7 David Hildenbrand         2015-05-11   87  		preempt_disable();
8676590a159320 Marcelo H. Cerri          2015-02-06   88  		pagefault_disable();
2d6f0600b2cd75 Leonidas Da Silva Barbosa 2015-07-13   89  		enable_kernel_vsx();
8676590a159320 Marcelo H. Cerri          2015-02-06   90  		aes_p8_encrypt(src, dst, &ctx->enc_key);
dc4fbba11e4661 Anton Blanchard           2015-10-29   91  		disable_kernel_vsx();
8676590a159320 Marcelo H. Cerri          2015-02-06   92  		pagefault_enable();
5f76eea88dcbe7 David Hildenbrand         2015-05-11   93  		preempt_enable();
8676590a159320 Marcelo H. Cerri          2015-02-06   94  	}
8676590a159320 Marcelo H. Cerri          2015-02-06   95  }
8676590a159320 Marcelo H. Cerri          2015-02-06   96  
8676590a159320 Marcelo H. Cerri          2015-02-06   97  static void p8_aes_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
8676590a159320 Marcelo H. Cerri          2015-02-06   98  {
8676590a159320 Marcelo H. Cerri          2015-02-06   99  	struct p8_aes_ctx *ctx = crypto_tfm_ctx(tfm);
8676590a159320 Marcelo H. Cerri          2015-02-06  100  
626ddb2fbe7931 Eric Biggers              2019-04-12  101  	if (!crypto_simd_usable()) {
8676590a159320 Marcelo H. Cerri          2015-02-06 @102  		crypto_cipher_decrypt_one(ctx->fallback, dst, src);
8676590a159320 Marcelo H. Cerri          2015-02-06  103  	} else {
5f76eea88dcbe7 David Hildenbrand         2015-05-11  104  		preempt_disable();
8676590a159320 Marcelo H. Cerri          2015-02-06  105  		pagefault_disable();
2d6f0600b2cd75 Leonidas Da Silva Barbosa 2015-07-13  106  		enable_kernel_vsx();
8676590a159320 Marcelo H. Cerri          2015-02-06  107  		aes_p8_decrypt(src, dst, &ctx->dec_key);
dc4fbba11e4661 Anton Blanchard           2015-10-29  108  		disable_kernel_vsx();
8676590a159320 Marcelo H. Cerri          2015-02-06  109  		pagefault_enable();
5f76eea88dcbe7 David Hildenbrand         2015-05-11  110  		preempt_enable();
8676590a159320 Marcelo H. Cerri          2015-02-06  111  	}
8676590a159320 Marcelo H. Cerri          2015-02-06  112  }
8676590a159320 Marcelo H. Cerri          2015-02-06  113  

:::::: The code at line 33 was first introduced by commit
:::::: 8676590a159320a9de2a1818df14a3bac3f065a1 crypto: vmx - Adding AES routines for VMX module

:::::: TO: Marcelo H. Cerri <mhcerri@xxxxxxxxxxxxxxxxxx>
:::::: CC: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>

---
0-DAY kernel test infrastructure                 Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx Intel Corporation

Attachment: .config.gz
Description: application/gzip


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

  Powered by Linux