public inbox for linux-pci@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Hans Zhang <18255117159@163.com>, manivannan.sadhasivam@linaro.org
Cc: oe-kbuild-all@lists.linux.dev, kw@linux.com, kishon@kernel.org,
	arnd@arndb.de, gregkh@linuxfoundation.org,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	rockswang7@gmail.com, Hans Zhang <18255117159@163.com>,
	Niklas Cassel <cassel@kernel.org>
Subject: Re: [v4] misc: pci_endpoint_test: Fix overflow of bar_size
Date: Wed, 1 Jan 2025 19:50:26 +0800	[thread overview]
Message-ID: <202501011917.ugP1ywJV-lkp@intel.com> (raw)
In-Reply-To: <20241231065500.168799-1-18255117159@163.com>

Hi Hans,

kernel test robot noticed the following build errors:

[auto build test ERROR on pci/next]
[also build test ERROR on pci/for-linus mani-mhi/mhi-next soc/for-next linus/master v6.13-rc5 next-20241220]
[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/Hans-Zhang/misc-pci_endpoint_test-Fix-overflow-of-bar_size/20241231-145733
base:   https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git next
patch link:    https://lore.kernel.org/r/20241231065500.168799-1-18255117159%40163.com
patch subject: [v4] misc: pci_endpoint_test: Fix overflow of bar_size
config: i386-randconfig-003-20250101 (https://download.01.org/0day-ci/archive/20250101/202501011917.ugP1ywJV-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250101/202501011917.ugP1ywJV-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202501011917.ugP1ywJV-lkp@intel.com/

All errors (new ones prefixed by >>):

   ld: drivers/misc/pci_endpoint_test.o: in function `pci_endpoint_test_bar':
>> drivers/misc/pci_endpoint_test.c:315: undefined reference to `__udivmoddi4'


vim +315 drivers/misc/pci_endpoint_test.c

2a35703a6a00e8 Niklas Cassel          2024-03-22  282  
2c156ac71c6b25 Kishon Vijay Abraham I 2017-03-27  283  static bool pci_endpoint_test_bar(struct pci_endpoint_test *test,
2c156ac71c6b25 Kishon Vijay Abraham I 2017-03-27  284  				  enum pci_barno barno)
2c156ac71c6b25 Kishon Vijay Abraham I 2017-03-27  285  {
2a35703a6a00e8 Niklas Cassel          2024-03-22  286  	void *write_buf __free(kfree) = NULL;
2a35703a6a00e8 Niklas Cassel          2024-03-22  287  	void *read_buf __free(kfree) = NULL;
cda370ec6d1f7b Kishon Vijay Abraham I 2017-08-18  288  	struct pci_dev *pdev = test->pdev;
bb17ee74a3494e Hans Zhang             2024-12-31  289  	int j, buf_size, iters, remain;
bb17ee74a3494e Hans Zhang             2024-12-31  290  	resource_size_t bar_size;
2c156ac71c6b25 Kishon Vijay Abraham I 2017-03-27  291  
2c156ac71c6b25 Kishon Vijay Abraham I 2017-03-27  292  	if (!test->bar[barno])
2c156ac71c6b25 Kishon Vijay Abraham I 2017-03-27  293  		return false;
2c156ac71c6b25 Kishon Vijay Abraham I 2017-03-27  294  
2a35703a6a00e8 Niklas Cassel          2024-03-22  295  	bar_size = pci_resource_len(pdev, barno);
2c156ac71c6b25 Kishon Vijay Abraham I 2017-03-27  296  
834b9051992580 Kishon Vijay Abraham I 2017-08-18  297  	if (barno == test->test_reg_bar)
2a35703a6a00e8 Niklas Cassel          2024-03-22  298  		bar_size = 0x4;
834b9051992580 Kishon Vijay Abraham I 2017-08-18  299  
2a35703a6a00e8 Niklas Cassel          2024-03-22  300  	/*
2a35703a6a00e8 Niklas Cassel          2024-03-22  301  	 * Allocate a buffer of max size 1MB, and reuse that buffer while
2a35703a6a00e8 Niklas Cassel          2024-03-22  302  	 * iterating over the whole BAR size (which might be much larger).
2a35703a6a00e8 Niklas Cassel          2024-03-22  303  	 */
2a35703a6a00e8 Niklas Cassel          2024-03-22  304  	buf_size = min(SZ_1M, bar_size);
2c156ac71c6b25 Kishon Vijay Abraham I 2017-03-27  305  
2a35703a6a00e8 Niklas Cassel          2024-03-22  306  	write_buf = kmalloc(buf_size, GFP_KERNEL);
2a35703a6a00e8 Niklas Cassel          2024-03-22  307  	if (!write_buf)
2a35703a6a00e8 Niklas Cassel          2024-03-22  308  		return false;
2a35703a6a00e8 Niklas Cassel          2024-03-22  309  
2a35703a6a00e8 Niklas Cassel          2024-03-22  310  	read_buf = kmalloc(buf_size, GFP_KERNEL);
2a35703a6a00e8 Niklas Cassel          2024-03-22  311  	if (!read_buf)
2a35703a6a00e8 Niklas Cassel          2024-03-22  312  		return false;
2a35703a6a00e8 Niklas Cassel          2024-03-22  313  
2a35703a6a00e8 Niklas Cassel          2024-03-22  314  	iters = bar_size / buf_size;
2a35703a6a00e8 Niklas Cassel          2024-03-22 @315  	for (j = 0; j < iters; j++)
2a35703a6a00e8 Niklas Cassel          2024-03-22  316  		if (pci_endpoint_test_bar_memcmp(test, barno, buf_size * j,
2a35703a6a00e8 Niklas Cassel          2024-03-22  317  						 write_buf, read_buf, buf_size))
2a35703a6a00e8 Niklas Cassel          2024-03-22  318  			return false;
2a35703a6a00e8 Niklas Cassel          2024-03-22  319  
2a35703a6a00e8 Niklas Cassel          2024-03-22  320  	remain = bar_size % buf_size;
2a35703a6a00e8 Niklas Cassel          2024-03-22  321  	if (remain)
2a35703a6a00e8 Niklas Cassel          2024-03-22  322  		if (pci_endpoint_test_bar_memcmp(test, barno, buf_size * iters,
2a35703a6a00e8 Niklas Cassel          2024-03-22  323  						 write_buf, read_buf, remain))
2c156ac71c6b25 Kishon Vijay Abraham I 2017-03-27  324  			return false;
2c156ac71c6b25 Kishon Vijay Abraham I 2017-03-27  325  
2c156ac71c6b25 Kishon Vijay Abraham I 2017-03-27  326  	return true;
2c156ac71c6b25 Kishon Vijay Abraham I 2017-03-27  327  }
2c156ac71c6b25 Kishon Vijay Abraham I 2017-03-27  328  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

      reply	other threads:[~2025-01-01 11:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-31  6:55 [v4] misc: pci_endpoint_test: Fix overflow of bar_size Hans Zhang
2025-01-01 11:50 ` kernel test robot [this message]

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=202501011917.ugP1ywJV-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=18255117159@163.com \
    --cc=arnd@arndb.de \
    --cc=cassel@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kishon@kernel.org \
    --cc=kw@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=rockswang7@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox