All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Yunxiang Li <Yunxiang.Li@amd.com>,
	kvm@vger.kernel.org, alex.williamson@redhat.com
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	kevin.tian@intel.com, yishaih@nvidia.com, ankita@nvidia.com,
	jgg@ziepe.ca, Yunxiang Li <Yunxiang.Li@amd.com>
Subject: Re: [PATCH 2/3] vfio/pci: refactor vfio_pci_bar_rw
Date: Sat, 21 Dec 2024 04:22:48 +0800	[thread overview]
Message-ID: <202412210450.yl9DrP8o-lkp@intel.com> (raw)
In-Reply-To: <20241212205050.5737-2-Yunxiang.Li@amd.com>

Hi Yunxiang,

kernel test robot noticed the following build warnings:

[auto build test WARNING on awilliam-vfio/next]
[also build test WARNING on awilliam-vfio/for-linus linus/master v6.13-rc3 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/Yunxiang-Li/vfio-pci-refactor-vfio_pci_bar_rw/20241213-045257
base:   https://github.com/awilliam/linux-vfio.git next
patch link:    https://lore.kernel.org/r/20241212205050.5737-2-Yunxiang.Li%40amd.com
patch subject: [PATCH 2/3] vfio/pci: refactor vfio_pci_bar_rw
config: i386-buildonly-randconfig-004-20241220 (https://download.01.org/0day-ci/archive/20241221/202412210450.yl9DrP8o-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241221/202412210450.yl9DrP8o-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/202412210450.yl9DrP8o-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from drivers/vfio/pci/vfio_pci_rdwr.c:14:
   In file included from include/linux/pci.h:1650:
   In file included from include/linux/dmapool.h:14:
   In file included from include/linux/scatterlist.h:8:
   In file included from include/linux/mm.h:2213:
   include/linux/vmstat.h:518:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     518 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
>> drivers/vfio/pci/vfio_pci_rdwr.c:289:1: warning: unused label 'out' [-Wunused-label]
     289 | out:
         | ^~~~
   2 warnings generated.


vim +/out +289 drivers/vfio/pci/vfio_pci_rdwr.c

0d77ed3589ac054 Alex Williamson 2018-03-21  232  
536475109c82841 Max Gurtovoy    2021-08-26  233  ssize_t vfio_pci_bar_rw(struct vfio_pci_core_device *vdev, char __user *buf,
89e1f7d4c66d85f Alex Williamson 2012-07-31  234  			size_t count, loff_t *ppos, bool iswrite)
89e1f7d4c66d85f Alex Williamson 2012-07-31  235  {
89e1f7d4c66d85f Alex Williamson 2012-07-31  236  	struct pci_dev *pdev = vdev->pdev;
89e1f7d4c66d85f Alex Williamson 2012-07-31  237  	loff_t pos = *ppos & VFIO_PCI_OFFSET_MASK;
89e1f7d4c66d85f Alex Williamson 2012-07-31  238  	int bar = VFIO_PCI_OFFSET_TO_INDEX(*ppos);
1378a17537c2699 Yunxiang Li     2024-12-12  239  	size_t x_start, x_end;
89e1f7d4c66d85f Alex Williamson 2012-07-31  240  	resource_size_t end;
906ee99dd2a5c81 Alex Williamson 2013-02-14  241  	void __iomem *io;
906ee99dd2a5c81 Alex Williamson 2013-02-14  242  	ssize_t done;
89e1f7d4c66d85f Alex Williamson 2012-07-31  243  
a13b64591747e8a Alex Williamson 2016-02-22  244  	if (pci_resource_start(pdev, bar))
89e1f7d4c66d85f Alex Williamson 2012-07-31  245  		end = pci_resource_len(pdev, bar);
a13b64591747e8a Alex Williamson 2016-02-22  246  	else
a13b64591747e8a Alex Williamson 2016-02-22  247  		return -EINVAL;
89e1f7d4c66d85f Alex Williamson 2012-07-31  248  
906ee99dd2a5c81 Alex Williamson 2013-02-14  249  	if (pos >= end)
89e1f7d4c66d85f Alex Williamson 2012-07-31  250  		return -EINVAL;
89e1f7d4c66d85f Alex Williamson 2012-07-31  251  
906ee99dd2a5c81 Alex Williamson 2013-02-14  252  	count = min(count, (size_t)(end - pos));
89e1f7d4c66d85f Alex Williamson 2012-07-31  253  
89e1f7d4c66d85f Alex Williamson 2012-07-31  254  	if (bar == PCI_ROM_RESOURCE) {
1378a17537c2699 Yunxiang Li     2024-12-12  255  		if (iswrite)
1378a17537c2699 Yunxiang Li     2024-12-12  256  			return -EINVAL;
906ee99dd2a5c81 Alex Williamson 2013-02-14  257  		/*
906ee99dd2a5c81 Alex Williamson 2013-02-14  258  		 * The ROM can fill less space than the BAR, so we start the
906ee99dd2a5c81 Alex Williamson 2013-02-14  259  		 * excluded range at the end of the actual ROM.  This makes
906ee99dd2a5c81 Alex Williamson 2013-02-14  260  		 * filling large ROM BARs much faster.
906ee99dd2a5c81 Alex Williamson 2013-02-14  261  		 */
89e1f7d4c66d85f Alex Williamson 2012-07-31  262  		io = pci_map_rom(pdev, &x_start);
1378a17537c2699 Yunxiang Li     2024-12-12  263  		if (!io)
1378a17537c2699 Yunxiang Li     2024-12-12  264  			return -ENOMEM;
89e1f7d4c66d85f Alex Williamson 2012-07-31  265  		x_end = end;
1378a17537c2699 Yunxiang Li     2024-12-12  266  
1378a17537c2699 Yunxiang Li     2024-12-12  267  		done = vfio_pci_core_do_io_rw(vdev, 1, io, buf, pos,
1378a17537c2699 Yunxiang Li     2024-12-12  268  					      count, x_start, x_end, 0);
1378a17537c2699 Yunxiang Li     2024-12-12  269  
1378a17537c2699 Yunxiang Li     2024-12-12  270  		pci_unmap_rom(pdev, io);
0d77ed3589ac054 Alex Williamson 2018-03-21  271  	} else {
1378a17537c2699 Yunxiang Li     2024-12-12  272  		done = vfio_pci_core_setup_barmap(vdev, bar);
1378a17537c2699 Yunxiang Li     2024-12-12  273  		if (done)
1378a17537c2699 Yunxiang Li     2024-12-12  274  			return done;
89e1f7d4c66d85f Alex Williamson 2012-07-31  275  
89e1f7d4c66d85f Alex Williamson 2012-07-31  276  		io = vdev->barmap[bar];
89e1f7d4c66d85f Alex Williamson 2012-07-31  277  
89e1f7d4c66d85f Alex Williamson 2012-07-31  278  		if (bar == vdev->msix_bar) {
89e1f7d4c66d85f Alex Williamson 2012-07-31  279  			x_start = vdev->msix_offset;
89e1f7d4c66d85f Alex Williamson 2012-07-31  280  			x_end = vdev->msix_offset + vdev->msix_size;
1378a17537c2699 Yunxiang Li     2024-12-12  281  		} else {
1378a17537c2699 Yunxiang Li     2024-12-12  282  			x_start = 0;
1378a17537c2699 Yunxiang Li     2024-12-12  283  			x_end = 0;
89e1f7d4c66d85f Alex Williamson 2012-07-31  284  		}
89e1f7d4c66d85f Alex Williamson 2012-07-31  285  
1378a17537c2699 Yunxiang Li     2024-12-12  286  		done = vfio_pci_core_do_io_rw(vdev, pci_resource_flags(pdev, bar) & IORESOURCE_MEM, io, buf, pos,
bc93b9ae0151ae5 Alex Williamson 2020-08-17  287  				      count, x_start, x_end, iswrite);
1378a17537c2699 Yunxiang Li     2024-12-12  288  	}
abafbc551fddede Alex Williamson 2020-04-22 @289  out:
1378a17537c2699 Yunxiang Li     2024-12-12  290  	if (done > 0)
1378a17537c2699 Yunxiang Li     2024-12-12  291  		*ppos += done;
906ee99dd2a5c81 Alex Williamson 2013-02-14  292  	return done;
89e1f7d4c66d85f Alex Williamson 2012-07-31  293  }
84237a826b261de Alex Williamson 2013-02-18  294  

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

  parent reply	other threads:[~2024-12-20 20:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-12 20:50 [PATCH 1/3] vfio/pci: Remove shadow rom specific code paths Yunxiang Li
2024-12-12 20:50 ` [PATCH 2/3] vfio/pci: refactor vfio_pci_bar_rw Yunxiang Li
2024-12-12 23:00   ` Alex Williamson
2024-12-16 13:48     ` Li, Yunxiang (Teddy)
2024-12-20 12:36   ` kernel test robot
2024-12-20 20:22   ` kernel test robot [this message]
2024-12-12 20:50 ` [PATCH 3/3] vfio/pci: Expose setup ROM at ROM bar when needed Yunxiang Li
2024-12-12 23:00   ` Alex Williamson
2024-12-12 23:00 ` [PATCH 1/3] vfio/pci: Remove shadow rom specific code paths Alex Williamson

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=202412210450.yl9DrP8o-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=Yunxiang.Li@amd.com \
    --cc=alex.williamson@redhat.com \
    --cc=ankita@nvidia.com \
    --cc=jgg@ziepe.ca \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=yishaih@nvidia.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 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.