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>] [day] [month] [year] [list]
Message-ID: <202012011357.iz7Q03V2-lkp@intel.com>
Date:   Tue, 1 Dec 2020 13:19:01 +0800
From:   kernel test robot <lkp@...el.com>
To:     Shannon Nelson <snelson@...sando.io>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Jakub Kicinski <kuba@...nel.org>
Subject: drivers/net/ethernet/pensando/ionic/ionic_txrx.c:100:28: sparse:
 sparse: cast truncates bits from constant value (10000 becomes 0)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   b65054597872ce3aefbc6a666385eabdf9e288da
commit: d701ec326a31945d1533b438a6feab753829b738 ionic: clean up sparse complaints
date:   5 weeks ago
config: ia64-randconfig-s032-20201201 (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.3-170-g3bc348f6-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d701ec326a31945d1533b438a6feab753829b738
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout d701ec326a31945d1533b438a6feab753829b738
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=ia64 

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


"sparse warnings: (new ones prefixed by >>)"
>> drivers/net/ethernet/pensando/ionic/ionic_txrx.c:100:28: sparse: sparse: cast truncates bits from constant value (10000 becomes 0)
   drivers/net/ethernet/pensando/ionic/ionic_txrx.c: note: in included file (through arch/ia64/include/asm/io.h, arch/ia64/include/asm/uaccess.h, include/linux/uaccess.h, ...):
   include/asm-generic/io.h:236:22: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned long long [usertype] value @@     got restricted __le64 [usertype] @@
   include/asm-generic/io.h:236:22: sparse:     expected unsigned long long [usertype] value
   include/asm-generic/io.h:236:22: sparse:     got restricted __le64 [usertype]

vim +100 drivers/net/ethernet/pensando/ionic/ionic_txrx.c

0f3154e6bcb3549 Shannon Nelson 2019-09-03   68  
08f2e4b2b2008ce Shannon Nelson 2019-10-23   69  static struct sk_buff *ionic_rx_frags(struct ionic_queue *q,
08f2e4b2b2008ce Shannon Nelson 2019-10-23   70  				      struct ionic_desc_info *desc_info,
08f2e4b2b2008ce Shannon Nelson 2019-10-23   71  				      struct ionic_cq_info *cq_info)
0f3154e6bcb3549 Shannon Nelson 2019-09-03   72  {
0f3154e6bcb3549 Shannon Nelson 2019-09-03   73  	struct ionic_rxq_comp *comp = cq_info->cq_desc;
0f3154e6bcb3549 Shannon Nelson 2019-09-03   74  	struct device *dev = q->lif->ionic->dev;
08f2e4b2b2008ce Shannon Nelson 2019-10-23   75  	struct ionic_page_info *page_info;
08f2e4b2b2008ce Shannon Nelson 2019-10-23   76  	struct sk_buff *skb;
08f2e4b2b2008ce Shannon Nelson 2019-10-23   77  	unsigned int i;
08f2e4b2b2008ce Shannon Nelson 2019-10-23   78  	u16 frag_len;
08f2e4b2b2008ce Shannon Nelson 2019-10-23   79  	u16 len;
08f2e4b2b2008ce Shannon Nelson 2019-10-23   80  
08f2e4b2b2008ce Shannon Nelson 2019-10-23   81  	page_info = &desc_info->pages[0];
08f2e4b2b2008ce Shannon Nelson 2019-10-23   82  	len = le16_to_cpu(comp->len);
08f2e4b2b2008ce Shannon Nelson 2019-10-23   83  
08f2e4b2b2008ce Shannon Nelson 2019-10-23   84  	prefetch(page_address(page_info->page) + NET_IP_ALIGN);
08f2e4b2b2008ce Shannon Nelson 2019-10-23   85  
08f2e4b2b2008ce Shannon Nelson 2019-10-23   86  	skb = ionic_rx_skb_alloc(q, len, true);
08f2e4b2b2008ce Shannon Nelson 2019-10-23   87  	if (unlikely(!skb))
08f2e4b2b2008ce Shannon Nelson 2019-10-23   88  		return NULL;
08f2e4b2b2008ce Shannon Nelson 2019-10-23   89  
08f2e4b2b2008ce Shannon Nelson 2019-10-23   90  	i = comp->num_sg_elems + 1;
08f2e4b2b2008ce Shannon Nelson 2019-10-23   91  	do {
08f2e4b2b2008ce Shannon Nelson 2019-10-23   92  		if (unlikely(!page_info->page)) {
08f2e4b2b2008ce Shannon Nelson 2019-10-23   93  			struct napi_struct *napi = &q_to_qcq(q)->napi;
08f2e4b2b2008ce Shannon Nelson 2019-10-23   94  
08f2e4b2b2008ce Shannon Nelson 2019-10-23   95  			napi->skb = NULL;
08f2e4b2b2008ce Shannon Nelson 2019-10-23   96  			dev_kfree_skb(skb);
08f2e4b2b2008ce Shannon Nelson 2019-10-23   97  			return NULL;
0f3154e6bcb3549 Shannon Nelson 2019-09-03   98  		}
0f3154e6bcb3549 Shannon Nelson 2019-09-03   99  
08f2e4b2b2008ce Shannon Nelson 2019-10-23 @100  		frag_len = min(len, (u16)PAGE_SIZE);
08f2e4b2b2008ce Shannon Nelson 2019-10-23  101  		len -= frag_len;
08f2e4b2b2008ce Shannon Nelson 2019-10-23  102  
08f2e4b2b2008ce Shannon Nelson 2019-10-23  103  		dma_unmap_page(dev, dma_unmap_addr(page_info, dma_addr),
08f2e4b2b2008ce Shannon Nelson 2019-10-23  104  			       PAGE_SIZE, DMA_FROM_DEVICE);
08f2e4b2b2008ce Shannon Nelson 2019-10-23  105  		skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
08f2e4b2b2008ce Shannon Nelson 2019-10-23  106  				page_info->page, 0, frag_len, PAGE_SIZE);
08f2e4b2b2008ce Shannon Nelson 2019-10-23  107  		page_info->page = NULL;
08f2e4b2b2008ce Shannon Nelson 2019-10-23  108  		page_info++;
08f2e4b2b2008ce Shannon Nelson 2019-10-23  109  		i--;
08f2e4b2b2008ce Shannon Nelson 2019-10-23  110  	} while (i > 0);
08f2e4b2b2008ce Shannon Nelson 2019-10-23  111  
08f2e4b2b2008ce Shannon Nelson 2019-10-23  112  	return skb;
0f3154e6bcb3549 Shannon Nelson 2019-09-03  113  }
0f3154e6bcb3549 Shannon Nelson 2019-09-03  114  

:::::: The code at line 100 was first introduced by commit
:::::: 08f2e4b2b2008ce461dd6958caa616a2e3a30ac8 ionic: implement support for rx sgl

:::::: TO: Shannon Nelson <snelson@...sando.io>
:::::: CC: David S. Miller <davem@...emloft.net>

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

Download attachment ".config.gz" of type "application/gzip" (30938 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ