Re: [PATCH 1/3] vfio/pci: Set VFIO_PCI_OFFSET_SHIFT to 48

From: kernel test robot

Date: Thu Feb 12 2026 - 17:48:40 EST


Hi Julian,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 05f7e89ab9731565d8a62e3b5d1ec206485eeb0b]

url: https://github.com/intel-lab-lkp/linux/commits/Julian-Ruess/vfio-pci-Set-VFIO_PCI_OFFSET_SHIFT-to-48/20260212-220938
base: 05f7e89ab9731565d8a62e3b5d1ec206485eeb0b
patch link: https://lore.kernel.org/r/20260212-vfio_pci_ism-v1-1-333262ade074%40linux.ibm.com
patch subject: [PATCH 1/3] vfio/pci: Set VFIO_PCI_OFFSET_SHIFT to 48
config: powerpc-randconfig-002-20260213 (https://download.01.org/0day-ci/archive/20260213/202602130603.5vXcHBPj-lkp@xxxxxxxxx/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260213/202602130603.5vXcHBPj-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202602130603.5vXcHBPj-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

>> drivers/vfio/pci/vfio_pci_core.c:1646:28: warning: shift count >= width of type [-Wshift-count-overflow]
1646 | int index = vma->vm_pgoff >> (VFIO_PCI_OFFSET_SHIFT - PAGE_SHIFT);
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/vfio/pci/vfio_pci_core.c:1650:9: warning: shift count >= width of type [-Wshift-count-overflow]
1650 | ((1UL << (VFIO_PCI_OFFSET_SHIFT - PAGE_SHIFT)) - 1);
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/vfio/pci/vfio_pci_core.c:1701:22: warning: shift count >= width of type [-Wshift-count-overflow]
1701 | vma->vm_pgoff >>
| ^
1702 | (VFIO_PCI_OFFSET_SHIFT - PAGE_SHIFT),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:244:9: note: expanded from macro 'dev_dbg_ratelimited'
244 | ##__VA_ARGS__); \
| ^~~~~~~~~~~
drivers/vfio/pci/vfio_pci_core.c:1729:24: warning: shift count >= width of type [-Wshift-count-overflow]
1729 | index = vma->vm_pgoff >> (VFIO_PCI_OFFSET_SHIFT - PAGE_SHIFT);
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/vfio/pci/vfio_pci_core.c:1754:9: warning: shift count >= width of type [-Wshift-count-overflow]
1754 | ((1UL << (VFIO_PCI_OFFSET_SHIFT - PAGE_SHIFT)) - 1);
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 warnings generated.


vim +1646 drivers/vfio/pci/vfio_pci_core.c

abafbc551fdded drivers/vfio/pci/vfio_pci.c Alex Williamson 2020-04-22 1642
aac6db75a9fc2c drivers/vfio/pci/vfio_pci_core.c Alex Williamson 2024-05-29 1643 static unsigned long vma_to_pfn(struct vm_area_struct *vma)
11c4cd07ba111a drivers/vfio/pci/vfio_pci.c Alex Williamson 2020-04-28 1644 {
536475109c8284 drivers/vfio/pci/vfio_pci_core.c Max Gurtovoy 2021-08-26 1645 struct vfio_pci_core_device *vdev = vma->vm_private_data;
aac6db75a9fc2c drivers/vfio/pci/vfio_pci_core.c Alex Williamson 2024-05-29 @1646 int index = vma->vm_pgoff >> (VFIO_PCI_OFFSET_SHIFT - PAGE_SHIFT);
aac6db75a9fc2c drivers/vfio/pci/vfio_pci_core.c Alex Williamson 2024-05-29 1647 u64 pgoff;
11c4cd07ba111a drivers/vfio/pci/vfio_pci.c Alex Williamson 2020-04-28 1648
aac6db75a9fc2c drivers/vfio/pci/vfio_pci_core.c Alex Williamson 2024-05-29 1649 pgoff = vma->vm_pgoff &
c298baab91b6e3 drivers/vfio/pci/vfio_pci_core.c Julian Ruess 2026-02-12 1650 ((1UL << (VFIO_PCI_OFFSET_SHIFT - PAGE_SHIFT)) - 1);
aac6db75a9fc2c drivers/vfio/pci/vfio_pci_core.c Alex Williamson 2024-05-29 1651
aac6db75a9fc2c drivers/vfio/pci/vfio_pci_core.c Alex Williamson 2024-05-29 1652 return (pci_resource_start(vdev->pdev, index) >> PAGE_SHIFT) + pgoff;
11c4cd07ba111a drivers/vfio/pci/vfio_pci.c Alex Williamson 2020-04-28 1653 }
11c4cd07ba111a drivers/vfio/pci/vfio_pci.c Alex Williamson 2020-04-28 1654

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