Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* [jgunthorpe:pcie_switch_groups 7/13] drivers/iommu/iommu.c:1512:27: error: variable has incomplete type 'struct pci_reachable_set'
@ 2025-09-16 13:21 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-09-16 13:21 UTC (permalink / raw)
  To: Jason Gunthorpe; +Cc: llvm, oe-kbuild-all, Donald Dutile

tree:   https://github.com/jgunthorpe/linux pcie_switch_groups
head:   359e58e015929f167700789bde9365e492d57b00
commit: 82200d264461e06d24e496a8b583e95995740170 [7/13] iommu: Compute iommu_groups properly for PCIe MFDs
config: i386-buildonly-randconfig-003-20250916 (https://download.01.org/0day-ci/archive/20250916/202509162131.7agRb6Ua-lkp@intel.com/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/20250916/202509162131.7agRb6Ua-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/202509162131.7agRb6Ua-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from drivers/iommu/iommu.c:24:
   include/linux/pci.h:866:2: warning: '/*' within block comment [-Wcomment]
     866 |         /*
         |         ^
   include/linux/pci.h:871:2: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
     871 |         PCIE_ISOLATED,
         |         ^
         |         int
   include/linux/pci.h:876:2: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
     871 |         PCIE_ISOLATED,
         |         int
     872 |         /*
     873 |          * The switch's DSP's are not isolated from each other but are isolated
     874 |          * from the USP.
     875 |          */
     876 |         PCIE_SWITCH_DSP_NON_ISOLATED,
         |         ^
   include/linux/pci.h:878:2: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
     871 |         PCIE_ISOLATED,
         |         int
     872 |         /*
     873 |          * The switch's DSP's are not isolated from each other but are isolated
     874 |          * from the USP.
     875 |          */
     876 |         PCIE_SWITCH_DSP_NON_ISOLATED,
     877 |         /* The above and the USP's MMIO is not isolated. */
     878 |         PCIE_NON_ISOLATED,
         |         ^
   include/linux/pci.h:884:2: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
     871 |         PCIE_ISOLATED,
         |         int
     872 |         /*
     873 |          * The switch's DSP's are not isolated from each other but are isolated
     874 |          * from the USP.
     875 |          */
     876 |         PCIE_SWITCH_DSP_NON_ISOLATED,
     877 |         /* The above and the USP's MMIO is not isolated. */
     878 |         PCIE_NON_ISOLATED,
     879 |         /*
     880 |          * A PCI/PCI-X bus, no isolation. This is like
     881 |          * PCIE_SWITCH_DSP_NON_ISOLATED in that the upstream bridge is isolated
     882 |          * from the bus. The bus itself may also have a shared alias of devfn=0.
     883 |          */
     884 |         PCI_BUS_NON_ISOLATED,
         |         ^
   include/linux/pci.h:889:2: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
     871 |         PCI_BRIDGE_NON_ISOLATED,
         |         ^
   include/linux/pci.h:889:25: error: expected ';' at end of declaration
     889 |         PCI_BRIDGE_NON_ISOLATED,
         |                                ^
         |                                ;
   include/linux/pci.h:890:1: error: extraneous closing brace ('}')
     890 | };
         | ^
   include/linux/pci.h:2099:32: warning: declaration of 'struct pci_reachable_set' will not be visible outside of this function [-Wvisibility]
    2099 |         struct pci_dev *start, struct pci_reachable_set *devfns,
         |                                       ^
   include/linux/pci.h:2103:38: error: incomplete result type 'enum pci_bus_isolation' in function definition
    2103 | static inline enum pci_bus_isolation pci_bus_isolated(struct pci_bus *bus)
         |                                      ^
   include/linux/pci.h:2103:20: note: forward declaration of 'enum pci_bus_isolation'
    2103 | static inline enum pci_bus_isolation pci_bus_isolated(struct pci_bus *bus)
         |                    ^
   include/linux/pci.h:2104:10: error: returning 'int' from a function with incompatible result type 'enum pci_bus_isolation'
    2104 | { return PCIE_NON_ISOLATED; }
         |          ^~~~~~~~~~~~~~~~~
>> drivers/iommu/iommu.c:1512:27: error: variable has incomplete type 'struct pci_reachable_set'
    1512 |         struct pci_reachable_set devfns;
         |                                  ^
   drivers/iommu/iommu.c:1512:9: note: forward declaration of 'struct pci_reachable_set'
    1512 |         struct pci_reachable_set devfns;
         |                ^
   2 warnings and 10 errors generated.


vim +1512 drivers/iommu/iommu.c

  1505	
  1506	/*
  1507	 * Return a group if the function has isolation restrictions related to
  1508	 * aliases or MFD ACS.
  1509	 */
  1510	static struct iommu_group *pci_get_function_group(struct pci_dev *pdev)
  1511	{
> 1512		struct pci_reachable_set devfns;
  1513		const unsigned int NR_DEVFNS = sizeof(devfns.devfns) * BITS_PER_BYTE;
  1514		unsigned int devfn;
  1515	
  1516		/*
  1517		 * Look for existing groups on device aliases and multi-function ACS. If
  1518		 * we alias another device or another device aliases us, use the same
  1519		 * group.
  1520		 *
  1521		 * pci_reachable_bus_set() should return the same bitmap if called for
  1522		 * any device in the set and we want all devices in the set to have the
  1523		 * same group.
  1524		 */
  1525		pci_reachable_bus_set(pdev, &devfns, pci_devs_are_same_group);
  1526		/* start is known to have iommu_group_get() == NULL */
  1527		__clear_bit(pdev->devfn, devfns.devfns);
  1528	
  1529		/*
  1530		 * When MFD functions are included in the set due to ACS we assume that
  1531		 * if ACS permits an internal loopback between functions it also permits
  1532		 * the loopback to go downstream if any function is a bridge.
  1533		 *
  1534		 * It is less clear what aliases mean when applied to a bridge. For now
  1535		 * be conservative and also propagate the group downstream.
  1536		 */
  1537		if (bitmap_empty(devfns.devfns, NR_DEVFNS))
  1538			return NULL;
  1539	
  1540		for_each_set_bit(devfn, devfns.devfns, NR_DEVFNS) {
  1541			struct iommu_group *group;
  1542			struct pci_dev *pdev_slot;
  1543	
  1544			pdev_slot = pci_get_slot(pdev->bus, devfn);
  1545			group = iommu_group_get(&pdev_slot->dev);
  1546			pci_dev_put(pdev_slot);
  1547			if (group) {
  1548				if (WARN_ON(!(group->bus_data &
  1549					      BUS_DATA_PCI_NON_ISOLATED)))
  1550					group->bus_data |= BUS_DATA_PCI_NON_ISOLATED;
  1551				return group;
  1552			}
  1553		}
  1554		return iommu_group_alloc_data(BUS_DATA_PCI_NON_ISOLATED);
  1555	}
  1556	

-- 
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:[~2025-09-16 13:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-16 13:21 [jgunthorpe:pcie_switch_groups 7/13] drivers/iommu/iommu.c:1512:27: error: variable has incomplete type 'struct pci_reachable_set' kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox