* [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)'
@ 2024-03-13 4:47 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-03-13 4:47 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp, Dan Carpenter
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-03-13 4:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-13 4:47 [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)' kernel test robot
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.