All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: drivers/xen/swiotlb-xen.c:206 xen_swiotlb_init() error: uninitialized symbol 'start'.
Date: Fri, 19 Nov 2021 09:56:08 +0800	[thread overview]
Message-ID: <202111190956.AXXwpcVR-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 8717 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Christoph Hellwig <hch@lst.de>
CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   e26dd976580a6a427c69e6116508dd3d412742e5
commit: cbce99527ca7c4e98db9890651d5e9dfc2fb89ac xen-swiotlb: remove xen_io_tlb_start and xen_io_tlb_nslabs
date:   8 months ago
:::::: branch date: 3 hours ago
:::::: commit date: 8 months ago
config: arm-randconfig-m031-20211116 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/xen/swiotlb-xen.c:206 xen_swiotlb_init() error: uninitialized symbol 'start'.

vim +/start +206 drivers/xen/swiotlb-xen.c

4035b43da6daa51 Christoph Hellwig     2021-03-01  158  
b82776005369899 Konrad Rzeszutek Wilk 2012-08-23  159  int __ref xen_swiotlb_init(int verbose, bool early)
b097186fd29d5bc Konrad Rzeszutek Wilk 2010-05-11  160  {
b82776005369899 Konrad Rzeszutek Wilk 2012-08-23  161  	unsigned long bytes, order;
f4b2f07b2ed9b46 Konrad Rzeszutek Wilk 2011-07-22  162  	int rc = -ENOMEM;
5bab7864b1167f9 Konrad Rzeszutek Wilk 2012-08-23  163  	enum xen_swiotlb_err m_ret = XEN_SWIOTLB_UNKNOWN;
f4b2f07b2ed9b46 Konrad Rzeszutek Wilk 2011-07-22  164  	unsigned int repeat = 3;
cbce99527ca7c4e Christoph Hellwig     2021-03-01  165  	char *start;
cbce99527ca7c4e Christoph Hellwig     2021-03-01  166  	unsigned long nslabs;
b097186fd29d5bc Konrad Rzeszutek Wilk 2010-05-11  167  
cbce99527ca7c4e Christoph Hellwig     2021-03-01  168  	nslabs = swiotlb_nr_tbl();
f4b2f07b2ed9b46 Konrad Rzeszutek Wilk 2011-07-22  169  retry:
cbce99527ca7c4e Christoph Hellwig     2021-03-01  170  	if (!nslabs)
cbce99527ca7c4e Christoph Hellwig     2021-03-01  171  		nslabs = DEFAULT_NSLABS;
cbce99527ca7c4e Christoph Hellwig     2021-03-01  172  	bytes = nslabs << IO_TLB_SHIFT;
4035b43da6daa51 Christoph Hellwig     2021-03-01  173  	order = get_order(bytes);
4e7372e0dc5d7d2 Stefano Stabellini    2019-05-28  174  
4e7372e0dc5d7d2 Stefano Stabellini    2019-05-28  175  	/*
4e7372e0dc5d7d2 Stefano Stabellini    2019-05-28  176  	 * IO TLB memory already allocated. Just use it.
4e7372e0dc5d7d2 Stefano Stabellini    2019-05-28  177  	 */
cbce99527ca7c4e Christoph Hellwig     2021-03-01  178  	if (io_tlb_start != 0)
4e7372e0dc5d7d2 Stefano Stabellini    2019-05-28  179  		goto end;
4e7372e0dc5d7d2 Stefano Stabellini    2019-05-28  180  
b097186fd29d5bc Konrad Rzeszutek Wilk 2010-05-11  181  	/*
b097186fd29d5bc Konrad Rzeszutek Wilk 2010-05-11  182  	 * Get IO TLB memory from any location.
b097186fd29d5bc Konrad Rzeszutek Wilk 2010-05-11  183  	 */
8a7f97b902f4fb0 Mike Rapoport         2019-03-11  184  	if (early) {
cbce99527ca7c4e Christoph Hellwig     2021-03-01  185  		start = memblock_alloc(PAGE_ALIGN(bytes),
15c3c114ed144e5 Mike Rapoport         2018-10-30  186  						  PAGE_SIZE);
cbce99527ca7c4e Christoph Hellwig     2021-03-01  187  		if (!start)
8a7f97b902f4fb0 Mike Rapoport         2019-03-11  188  			panic("%s: Failed to allocate %lu bytes align=0x%lx\n",
8a7f97b902f4fb0 Mike Rapoport         2019-03-11  189  			      __func__, PAGE_ALIGN(bytes), PAGE_SIZE);
8a7f97b902f4fb0 Mike Rapoport         2019-03-11  190  	} else {
b82776005369899 Konrad Rzeszutek Wilk 2012-08-23  191  #define SLABS_PER_PAGE (1 << (PAGE_SHIFT - IO_TLB_SHIFT))
b82776005369899 Konrad Rzeszutek Wilk 2012-08-23  192  #define IO_TLB_MIN_SLABS ((1<<20) >> IO_TLB_SHIFT)
b82776005369899 Konrad Rzeszutek Wilk 2012-08-23  193  		while ((SLABS_PER_PAGE << order) > IO_TLB_MIN_SLABS) {
cbce99527ca7c4e Christoph Hellwig     2021-03-01  194  			start = (void *)xen_get_swiotlb_free_pages(order);
cbce99527ca7c4e Christoph Hellwig     2021-03-01  195  			if (start)
b82776005369899 Konrad Rzeszutek Wilk 2012-08-23  196  				break;
b82776005369899 Konrad Rzeszutek Wilk 2012-08-23  197  			order--;
b82776005369899 Konrad Rzeszutek Wilk 2012-08-23  198  		}
b82776005369899 Konrad Rzeszutek Wilk 2012-08-23  199  		if (order != get_order(bytes)) {
283c0972d53769e Joe Perches           2013-06-28  200  			pr_warn("Warning: only able to allocate %ld MB for software IO TLB\n",
283c0972d53769e Joe Perches           2013-06-28  201  				(PAGE_SIZE << order) >> 20);
cbce99527ca7c4e Christoph Hellwig     2021-03-01  202  			nslabs = SLABS_PER_PAGE << order;
cbce99527ca7c4e Christoph Hellwig     2021-03-01  203  			bytes = nslabs << IO_TLB_SHIFT;
b82776005369899 Konrad Rzeszutek Wilk 2012-08-23  204  		}
b82776005369899 Konrad Rzeszutek Wilk 2012-08-23  205  	}
cbce99527ca7c4e Christoph Hellwig     2021-03-01 @206  	if (!start) {
5bab7864b1167f9 Konrad Rzeszutek Wilk 2012-08-23  207  		m_ret = XEN_SWIOTLB_ENOMEM;
f4b2f07b2ed9b46 Konrad Rzeszutek Wilk 2011-07-22  208  		goto error;
f4b2f07b2ed9b46 Konrad Rzeszutek Wilk 2011-07-22  209  	}
b097186fd29d5bc Konrad Rzeszutek Wilk 2010-05-11  210  	/*
b097186fd29d5bc Konrad Rzeszutek Wilk 2010-05-11  211  	 * And replace that memory with pages under 4GB.
b097186fd29d5bc Konrad Rzeszutek Wilk 2010-05-11  212  	 */
cbce99527ca7c4e Christoph Hellwig     2021-03-01  213  	rc = xen_swiotlb_fixup(start,
b097186fd29d5bc Konrad Rzeszutek Wilk 2010-05-11  214  			       bytes,
cbce99527ca7c4e Christoph Hellwig     2021-03-01  215  			       nslabs);
f4b2f07b2ed9b46 Konrad Rzeszutek Wilk 2011-07-22  216  	if (rc) {
b82776005369899 Konrad Rzeszutek Wilk 2012-08-23  217  		if (early)
cbce99527ca7c4e Christoph Hellwig     2021-03-01  218  			memblock_free(__pa(start),
2013288f7238878 Mike Rapoport         2018-10-30  219  				      PAGE_ALIGN(bytes));
b82776005369899 Konrad Rzeszutek Wilk 2012-08-23  220  		else {
cbce99527ca7c4e Christoph Hellwig     2021-03-01  221  			free_pages((unsigned long)start, order);
cbce99527ca7c4e Christoph Hellwig     2021-03-01  222  			start = NULL;
b82776005369899 Konrad Rzeszutek Wilk 2012-08-23  223  		}
5bab7864b1167f9 Konrad Rzeszutek Wilk 2012-08-23  224  		m_ret = XEN_SWIOTLB_EFIXUP;
b097186fd29d5bc Konrad Rzeszutek Wilk 2010-05-11  225  		goto error;
f4b2f07b2ed9b46 Konrad Rzeszutek Wilk 2011-07-22  226  	}
c468bdee28a1cb6 Konrad Rzeszutek Wilk 2012-09-17  227  	if (early) {
cbce99527ca7c4e Christoph Hellwig     2021-03-01  228  		if (swiotlb_init_with_tbl(start, nslabs,
ac2cbab21f318e1 Yinghai Lu            2013-01-24  229  			 verbose))
ac2cbab21f318e1 Yinghai Lu            2013-01-24  230  			panic("Cannot allocate SWIOTLB buffer");
c468bdee28a1cb6 Konrad Rzeszutek Wilk 2012-09-17  231  		rc = 0;
c468bdee28a1cb6 Konrad Rzeszutek Wilk 2012-09-17  232  	} else
cbce99527ca7c4e Christoph Hellwig     2021-03-01  233  		rc = swiotlb_late_init_with_tbl(start, nslabs);
7453c549f5f6485 Konrad Rzeszutek Wilk 2016-12-20  234  
4e7372e0dc5d7d2 Stefano Stabellini    2019-05-28  235  end:
7453c549f5f6485 Konrad Rzeszutek Wilk 2016-12-20  236  	if (!rc)
7453c549f5f6485 Konrad Rzeszutek Wilk 2016-12-20  237  		swiotlb_set_max_segment(PAGE_SIZE);
7453c549f5f6485 Konrad Rzeszutek Wilk 2016-12-20  238  
b82776005369899 Konrad Rzeszutek Wilk 2012-08-23  239  	return rc;
b097186fd29d5bc Konrad Rzeszutek Wilk 2010-05-11  240  error:
f4b2f07b2ed9b46 Konrad Rzeszutek Wilk 2011-07-22  241  	if (repeat--) {
cbce99527ca7c4e Christoph Hellwig     2021-03-01  242  		nslabs = max(1024UL, /* Min is 2MB */
cbce99527ca7c4e Christoph Hellwig     2021-03-01  243  					(nslabs >> 1));
283c0972d53769e Joe Perches           2013-06-28  244  		pr_info("Lowering to %luMB\n",
cbce99527ca7c4e Christoph Hellwig     2021-03-01  245  			(nslabs << IO_TLB_SHIFT) >> 20);
f4b2f07b2ed9b46 Konrad Rzeszutek Wilk 2011-07-22  246  		goto retry;
f4b2f07b2ed9b46 Konrad Rzeszutek Wilk 2011-07-22  247  	}
283c0972d53769e Joe Perches           2013-06-28  248  	pr_err("%s (rc:%d)\n", xen_swiotlb_error(m_ret), rc);
b82776005369899 Konrad Rzeszutek Wilk 2012-08-23  249  	if (early)
5bab7864b1167f9 Konrad Rzeszutek Wilk 2012-08-23  250  		panic("%s (rc:%d)", xen_swiotlb_error(m_ret), rc);
b82776005369899 Konrad Rzeszutek Wilk 2012-08-23  251  	else
cbce99527ca7c4e Christoph Hellwig     2021-03-01  252  		free_pages((unsigned long)start, order);
b82776005369899 Konrad Rzeszutek Wilk 2012-08-23  253  	return rc;
b097186fd29d5bc Konrad Rzeszutek Wilk 2010-05-11  254  }
dceb1a6819ab2c8 Christoph Hellwig     2017-05-21  255  

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 36270 bytes --]

             reply	other threads:[~2021-11-19  1:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-19  1:56 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-01-17  2:59 drivers/xen/swiotlb-xen.c:206 xen_swiotlb_init() error: uninitialized symbol 'start' kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202111190956.AXXwpcVR-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.