All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: [linux-next:master 8114/13337] drivers/vfio/pci/nvgrace-gpu/main.c:718 nvgrace_gpu_fetch_memory_property() warn: impossible condition '(*pmemphys > ((((1 << (8 * 8 - 1 - (((-1)) < 1))) - 1) + (1 << (8 * 8 - 1 - (((-1)) < 1)))))) => (0-u64max > u64max)'
Date: Wed, 13 Mar 2024 12:47:11 +0800	[thread overview]
Message-ID: <202403131244.nouxrenP-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: Linux Memory Management List <linux-mm@kvack.org>
TO: Ankit Agrawal <ankita@nvidia.com>
CC: Alex Williamson <alex.williamson@redhat.com>
CC: Kevin Tian <kevin.tian@intel.com>
CC: Yishai Hadas <yishaih@nvidia.com>
CC: Zhi Wang <zhi.wang.linux@gmail.com>
CC: Aniket Agashe <aniketa@nvidia.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   a1184cae56bcb96b86df3ee0377cec507a3f56e0
commit: 701ab935859fcfd4a8c8a97f3ee4fb5294a9d481 [8114/13337] vfio/nvgrace-gpu: Add vfio pci variant module for grace hopper
:::::: branch date: 24 hours ago
:::::: commit date: 3 weeks ago
config: loongarch-randconfig-r081-20240312 (https://download.01.org/0day-ci/archive/20240313/202403131244.nouxrenP-lkp@intel.com/config)
compiler: loongarch64-linux-gcc (GCC) 13.2.0

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>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202403131244.nouxrenP-lkp@intel.com/

smatch warnings:
drivers/vfio/pci/nvgrace-gpu/main.c:718 nvgrace_gpu_fetch_memory_property() warn: impossible condition '(*pmemphys > ((((1 << (8 * 8 - 1 - (((-1)) < 1))) - 1) + (1 << (8 * 8 - 1 - (((-1)) < 1)))))) => (0-u64max > u64max)'
drivers/vfio/pci/nvgrace-gpu/main.c:726 nvgrace_gpu_fetch_memory_property() warn: impossible condition '(*pmemlength > ((((1 << (8 * 8 - 1 - (((-1)) < 1))) - 1) + (1 << (8 * 8 - 1 - (((-1)) < 1)))))) => (0-u64max > u64max)'

vim +718 drivers/vfio/pci/nvgrace-gpu/main.c

701ab935859fcf Ankit Agrawal 2024-02-20  702  
701ab935859fcf Ankit Agrawal 2024-02-20  703  static int
701ab935859fcf Ankit Agrawal 2024-02-20  704  nvgrace_gpu_fetch_memory_property(struct pci_dev *pdev,
701ab935859fcf Ankit Agrawal 2024-02-20  705  				  u64 *pmemphys, u64 *pmemlength)
701ab935859fcf Ankit Agrawal 2024-02-20  706  {
701ab935859fcf Ankit Agrawal 2024-02-20  707  	int ret;
701ab935859fcf Ankit Agrawal 2024-02-20  708  
701ab935859fcf Ankit Agrawal 2024-02-20  709  	/*
701ab935859fcf Ankit Agrawal 2024-02-20  710  	 * The memory information is present in the system ACPI tables as DSD
701ab935859fcf Ankit Agrawal 2024-02-20  711  	 * properties nvidia,gpu-mem-base-pa and nvidia,gpu-mem-size.
701ab935859fcf Ankit Agrawal 2024-02-20  712  	 */
701ab935859fcf Ankit Agrawal 2024-02-20  713  	ret = device_property_read_u64(&pdev->dev, "nvidia,gpu-mem-base-pa",
701ab935859fcf Ankit Agrawal 2024-02-20  714  				       pmemphys);
701ab935859fcf Ankit Agrawal 2024-02-20  715  	if (ret)
701ab935859fcf Ankit Agrawal 2024-02-20  716  		return ret;
701ab935859fcf Ankit Agrawal 2024-02-20  717  
701ab935859fcf Ankit Agrawal 2024-02-20 @718  	if (*pmemphys > type_max(phys_addr_t))
701ab935859fcf Ankit Agrawal 2024-02-20  719  		return -EOVERFLOW;
701ab935859fcf Ankit Agrawal 2024-02-20  720  
701ab935859fcf Ankit Agrawal 2024-02-20  721  	ret = device_property_read_u64(&pdev->dev, "nvidia,gpu-mem-size",
701ab935859fcf Ankit Agrawal 2024-02-20  722  				       pmemlength);
701ab935859fcf Ankit Agrawal 2024-02-20  723  	if (ret)
701ab935859fcf Ankit Agrawal 2024-02-20  724  		return ret;
701ab935859fcf Ankit Agrawal 2024-02-20  725  
701ab935859fcf Ankit Agrawal 2024-02-20 @726  	if (*pmemlength > type_max(size_t))
701ab935859fcf Ankit Agrawal 2024-02-20  727  		return -EOVERFLOW;
701ab935859fcf Ankit Agrawal 2024-02-20  728  
701ab935859fcf Ankit Agrawal 2024-02-20  729  	/*
701ab935859fcf Ankit Agrawal 2024-02-20  730  	 * If the C2C link is not up due to an error, the coherent device
701ab935859fcf Ankit Agrawal 2024-02-20  731  	 * memory size is returned as 0. Fail in such case.
701ab935859fcf Ankit Agrawal 2024-02-20  732  	 */
701ab935859fcf Ankit Agrawal 2024-02-20  733  	if (*pmemlength == 0)
701ab935859fcf Ankit Agrawal 2024-02-20  734  		return -ENOMEM;
701ab935859fcf Ankit Agrawal 2024-02-20  735  
701ab935859fcf Ankit Agrawal 2024-02-20  736  	return ret;
701ab935859fcf Ankit Agrawal 2024-02-20  737  }
701ab935859fcf Ankit Agrawal 2024-02-20  738  

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

                 reply	other threads:[~2024-03-13  4:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202403131244.nouxrenP-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=error27@gmail.com \
    --cc=oe-kbuild@lists.linux.dev \
    /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.