lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202211100440.XKaVIUFz-lkp@intel.com>
Date:   Thu, 10 Nov 2022 04:25:19 +0800
From:   kernel test robot <lkp@...el.com>
To:     'Guanjun' <guanjun@...ux.alibaba.com>, herbert@...dor.apana.org.au,
        elliott@....com
Cc:     oe-kbuild-all@...ts.linux.dev, zelin.deng@...ux.alibaba.com,
        artie.ding@...ux.alibaba.com, guanjun@...ux.alibaba.com,
        linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org,
        xuchun.shang@...ux.alibaba.com
Subject: Re: [PATCH v3 RESEND 2/9] crypto/ycc: Add ycc ring configuration

Hi 'Guanjun',

Thank you for the patch! Yet something to improve:

[auto build test ERROR on herbert-cryptodev-2.6/master]
[also build test ERROR on herbert-crypto-2.6/master linus/master v6.1-rc4 next-20221109]
[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#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Guanjun/Drivers-for-Alibaba-YCC-Yitian-Cryptography-Complex-cryptographic-accelerator/20221103-154448
base:   https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
patch link:    https://lore.kernel.org/r/1667461243-48652-3-git-send-email-guanjun%40linux.alibaba.com
patch subject: [PATCH v3 RESEND 2/9] crypto/ycc: Add ycc ring configuration
config: xtensa-allyesconfig
compiler: xtensa-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/9f7d1fe6059378f16efdc261a6643c77ec627818
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Guanjun/Drivers-for-Alibaba-YCC-Yitian-Cryptography-Complex-cryptographic-accelerator/20221103-154448
        git checkout 9f7d1fe6059378f16efdc261a6643c77ec627818
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=xtensa SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>

All errors (new ones prefixed by >>):

   In file included from include/linux/pgtable.h:6,
                    from include/linux/mm.h:29,
                    from include/linux/scatterlist.h:8,
                    from include/linux/iommu.h:10,
                    from drivers/crypto/ycc/ycc_drv.c:16:
>> arch/xtensa/include/asm/pgtable.h:20:33: error: expected identifier before numeric constant
      20 | #define USER_RING               1       /* user ring level */
         |                                 ^
   drivers/crypto/ycc/ycc_ring.h:25:9: note: in expansion of macro 'USER_RING'
      25 |         USER_RING,
         |         ^~~~~~~~~
--
   In file included from include/linux/pgtable.h:6,
                    from include/linux/kasan.h:33,
                    from include/linux/slab.h:148,
                    from drivers/crypto/ycc/ycc_ring.c:8:
>> arch/xtensa/include/asm/pgtable.h:20:33: error: expected identifier before numeric constant
      20 | #define USER_RING               1       /* user ring level */
         |                                 ^
   drivers/crypto/ycc/ycc_ring.h:25:9: note: in expansion of macro 'USER_RING'
      25 |         USER_RING,
         |         ^~~~~~~~~
   drivers/crypto/ycc/ycc_ring.c: In function 'ycc_ring_debugfs_status_show':
   drivers/crypto/ycc/ycc_ring.c:40:41: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 3 has type 'dma_addr_t' {aka 'unsigned int'} [-Wformat=]
      40 |         seq_printf(s, "CMD base addr:%llx, RESP base addr:%llx\n",
         |                                      ~~~^
         |                                         |
         |                                         long long unsigned int
         |                                      %x
      41 |                    ring->cmd_base_paddr, ring->resp_base_paddr);
         |                    ~~~~~~~~~~~~~~~~~~~~  
         |                        |
         |                        dma_addr_t {aka unsigned int}
   drivers/crypto/ycc/ycc_ring.c:40:62: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'dma_addr_t' {aka 'unsigned int'} [-Wformat=]
      40 |         seq_printf(s, "CMD base addr:%llx, RESP base addr:%llx\n",
         |                                                           ~~~^
         |                                                              |
         |                                                              long long unsigned int
         |                                                           %x
      41 |                    ring->cmd_base_paddr, ring->resp_base_paddr);
         |                                          ~~~~~~~~~~~~~~~~~~~~~
         |                                              |
         |                                              dma_addr_t {aka unsigned int}
   drivers/crypto/ycc/ycc_ring.c: In function 'ycc_init_ring':
>> drivers/crypto/ycc/ycc_ring.c:193:22: error: 'KERN_RING' undeclared (first use in this function); did you mean 'KERNEL_RING'?
     193 |         ring->type = KERN_RING;
         |                      ^~~~~~~~~
         |                      KERNEL_RING
   drivers/crypto/ycc/ycc_ring.c:193:22: note: each undeclared identifier is reported only once for each function it appears in
   drivers/crypto/ycc/ycc_ring.c: In function 'ycc_select_ring':
   drivers/crypto/ycc/ycc_ring.c:374:44: error: 'KERN_RING' undeclared (first use in this function); did you mean 'KERNEL_RING'?
     374 |                         if (found->type != KERN_RING) {
         |                                            ^~~~~~~~~
         |                                            KERNEL_RING
   drivers/crypto/ycc/ycc_ring.c: In function 'ycc_handle_resp':
   drivers/crypto/ycc/ycc_ring.c:521:17: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     521 |         aflag = (struct ycc_flags *)desc->private_ptr;
         |                 ^
   drivers/crypto/ycc/ycc_ring.c:522:23: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
     522 |         if (!aflag || (u64)aflag == CMD_INVALID_CONTENT_U64) {
         |                       ^


vim +193 drivers/crypto/ycc/ycc_ring.c

   184	
   185	/*
   186	 * Initiate ring and create command queue and response queue.
   187	 */
   188	static int ycc_init_ring(struct ycc_ring *ring, u32 max_desc)
   189	{
   190		struct ycc_dev *ydev = ring->ydev;
   191		u32 cmd_ring_size, resp_ring_size;
   192	
 > 193		ring->type = KERN_RING;
   194		ring->max_desc = max_desc;
   195	
   196		cmd_ring_size = ring->max_desc * YCC_CMD_DESC_SIZE;
   197		resp_ring_size = ring->max_desc * YCC_RESP_DESC_SIZE;
   198	
   199		ring->cmd_base_vaddr = dma_alloc_coherent(&ydev->pdev->dev,
   200							  cmd_ring_size,
   201							  &ring->cmd_base_paddr,
   202							  GFP_KERNEL);
   203		if (!ring->cmd_base_vaddr) {
   204			pr_err("Failed to alloc cmd dma memory\n");
   205			return -ENOMEM;
   206		}
   207		memset(ring->cmd_base_vaddr, CMD_INVALID_CONTENT_U8, cmd_ring_size);
   208	
   209		ring->resp_base_vaddr = dma_alloc_coherent(&ydev->pdev->dev,
   210							   resp_ring_size,
   211							   &ring->resp_base_paddr,
   212							   GFP_KERNEL);
   213		if (!ring->resp_base_vaddr) {
   214			pr_err("Failed to alloc resp dma memory\n");
   215			dma_free_coherent(&ydev->pdev->dev, cmd_ring_size,
   216					  ring->cmd_base_vaddr, ring->cmd_base_paddr);
   217			return -ENOMEM;
   218		}
   219		memset(ring->resp_base_vaddr, CMD_INVALID_CONTENT_U8, resp_ring_size);
   220	
   221		YCC_CSR_WR(ring->csr_vaddr, REG_RING_RSP_AFULL_TH, 0);
   222		YCC_CSR_WR(ring->csr_vaddr, REG_RING_CMD_BASE_ADDR_LO,
   223						(u32)ring->cmd_base_paddr & 0xffffffff);
   224		YCC_CSR_WR(ring->csr_vaddr, REG_RING_CMD_BASE_ADDR_HI,
   225						((u64)ring->cmd_base_paddr >> 32) & 0xffffffff);
   226		YCC_CSR_WR(ring->csr_vaddr, REG_RING_RSP_BASE_ADDR_LO,
   227						(u32)ring->resp_base_paddr & 0xffffffff);
   228		YCC_CSR_WR(ring->csr_vaddr, REG_RING_RSP_BASE_ADDR_HI,
   229						((u64)ring->resp_base_paddr >> 32) & 0xffffffff);
   230	
   231		if (ycc_create_ring_debugfs(ring))
   232			pr_warn("Failed to create debugfs entry for ring: %d\n", ring->ring_id);
   233	
   234		atomic_set(&ring->ref_cnt, 0);
   235		spin_lock_init(&ring->lock);
   236		return 0;
   237	}
   238	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

View attachment "config" of type "text/plain" (317405 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ