* Re: [RFC 1/1] swiotlb: Reduce calls to swiotlb_find_pool()
[not found] <20240607031421.182589-1-mhklinux@outlook.com>
@ 2024-06-07 21:19 ` kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-06-07 21:19 UTC (permalink / raw)
To: mhkelley58; +Cc: llvm, oe-kbuild-all
Hi,
[This is a private test report for your RFC patch.]
kernel test robot noticed the following build errors:
[auto build test ERROR on joro-iommu/next]
[also build test ERROR on linus/master v6.10-rc2 next-20240607]
[cannot apply to xen-tip/linux-next]
[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/mhkelley58-gmail-com/swiotlb-Reduce-calls-to-swiotlb_find_pool/20240607-114732
base: https://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git next
patch link: https://lore.kernel.org/r/20240607031421.182589-1-mhklinux%40outlook.com
patch subject: [RFC 1/1] swiotlb: Reduce calls to swiotlb_find_pool()
config: hexagon-allmodconfig (https://download.01.org/0day-ci/archive/20240608/202406080445.0MtAsiAU-lkp@intel.com/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project d7d2d4f53fc79b4b58e8d8d08151b577c3699d4a)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240608/202406080445.0MtAsiAU-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/202406080445.0MtAsiAU-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from kernel/dma/mapping.c:8:
In file included from include/linux/memblock.h:12:
In file included from include/linux/mm.h:2253:
include/linux/vmstat.h:514:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
514 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
In file included from kernel/dma/mapping.c:8:
In file included from include/linux/memblock.h:13:
In file included from arch/hexagon/include/asm/dma.h:9:
In file included from arch/hexagon/include/asm/io.h:328:
include/asm-generic/io.h:548:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
548 | val = __raw_readb(PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:561:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
561 | val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
| ~~~~~~~~~~ ^
include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu'
37 | #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
| ^
In file included from kernel/dma/mapping.c:8:
In file included from include/linux/memblock.h:13:
In file included from arch/hexagon/include/asm/dma.h:9:
In file included from arch/hexagon/include/asm/io.h:328:
include/asm-generic/io.h:574:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
574 | val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
| ~~~~~~~~~~ ^
include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu'
35 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
| ^
In file included from kernel/dma/mapping.c:8:
In file included from include/linux/memblock.h:13:
In file included from arch/hexagon/include/asm/dma.h:9:
In file included from arch/hexagon/include/asm/io.h:328:
include/asm-generic/io.h:585:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
585 | __raw_writeb(value, PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:595:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
595 | __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:605:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
605 | __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
In file included from kernel/dma/mapping.c:18:
>> kernel/dma/direct.h:64:3: error: call to undeclared function 'swiotlb_sync_single_for_device'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
64 | swiotlb_sync_single_for_device(dev, paddr, size, dir, pool);
| ^
>> kernel/dma/direct.h:83:3: error: call to undeclared function 'swiotlb_sync_single_for_cpu'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
83 | swiotlb_sync_single_for_cpu(dev, paddr, size, dir, pool);
| ^
>> kernel/dma/direct.h:99:10: error: call to undeclared function 'swiotlb_map'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
99 | return swiotlb_map(dev, phys, size, dir, attrs);
| ^
kernel/dma/direct.h:107:11: error: call to undeclared function 'swiotlb_map'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
107 | return swiotlb_map(dev, phys, size, dir, attrs);
| ^
>> kernel/dma/direct.h:131:3: error: call to undeclared function 'swiotlb_tbl_unmap_single'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
131 | swiotlb_tbl_unmap_single(dev, phys, size, dir,
| ^
7 warnings and 5 errors generated.
--
In file included from kernel/dma/direct.c:7:
In file included from include/linux/memblock.h:12:
In file included from include/linux/mm.h:2253:
include/linux/vmstat.h:514:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
514 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
In file included from kernel/dma/direct.c:7:
In file included from include/linux/memblock.h:13:
In file included from arch/hexagon/include/asm/dma.h:9:
In file included from arch/hexagon/include/asm/io.h:328:
include/asm-generic/io.h:548:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
548 | val = __raw_readb(PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:561:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
561 | val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
| ~~~~~~~~~~ ^
include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu'
37 | #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
| ^
In file included from kernel/dma/direct.c:7:
In file included from include/linux/memblock.h:13:
In file included from arch/hexagon/include/asm/dma.h:9:
In file included from arch/hexagon/include/asm/io.h:328:
include/asm-generic/io.h:574:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
574 | val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
| ~~~~~~~~~~ ^
include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu'
35 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
| ^
In file included from kernel/dma/direct.c:7:
In file included from include/linux/memblock.h:13:
In file included from arch/hexagon/include/asm/dma.h:9:
In file included from arch/hexagon/include/asm/io.h:328:
include/asm-generic/io.h:585:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
585 | __raw_writeb(value, PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:595:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
595 | __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:605:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
605 | __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
In file included from kernel/dma/direct.c:16:
>> kernel/dma/direct.h:64:3: error: call to undeclared function 'swiotlb_sync_single_for_device'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
64 | swiotlb_sync_single_for_device(dev, paddr, size, dir, pool);
| ^
>> kernel/dma/direct.h:83:3: error: call to undeclared function 'swiotlb_sync_single_for_cpu'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
83 | swiotlb_sync_single_for_cpu(dev, paddr, size, dir, pool);
| ^
>> kernel/dma/direct.h:99:10: error: call to undeclared function 'swiotlb_map'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
99 | return swiotlb_map(dev, phys, size, dir, attrs);
| ^
kernel/dma/direct.h:107:11: error: call to undeclared function 'swiotlb_map'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
107 | return swiotlb_map(dev, phys, size, dir, attrs);
| ^
>> kernel/dma/direct.h:131:3: error: call to undeclared function 'swiotlb_tbl_unmap_single'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
131 | swiotlb_tbl_unmap_single(dev, phys, size, dir,
| ^
kernel/dma/direct.c:147:20: warning: shift count >= width of type [-Wshift-count-overflow]
147 | phys_limit < DMA_BIT_MASK(64) &&
| ^~~~~~~~~~~~~~~~
include/linux/dma-mapping.h:77:54: note: expanded from macro 'DMA_BIT_MASK'
77 | #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
| ^ ~~~
>> kernel/dma/direct.c:410:4: error: call to undeclared function 'swiotlb_sync_single_for_device'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
410 | swiotlb_sync_single_for_device(dev, paddr, sg->length,
| ^
8 warnings and 6 errors generated.
vim +/swiotlb_sync_single_for_device +64 kernel/dma/direct.h
55
56 static inline void dma_direct_sync_single_for_device(struct device *dev,
57 dma_addr_t addr, size_t size, enum dma_data_direction dir)
58 {
59 phys_addr_t paddr = dma_to_phys(dev, addr);
60 struct io_tlb_pool *pool;
61
62 pool = is_swiotlb_buffer(dev, paddr);
63 if (unlikely(pool))
> 64 swiotlb_sync_single_for_device(dev, paddr, size, dir, pool);
65
66 if (!dev_is_dma_coherent(dev))
67 arch_sync_dma_for_device(paddr, size, dir);
68 }
69
70 static inline void dma_direct_sync_single_for_cpu(struct device *dev,
71 dma_addr_t addr, size_t size, enum dma_data_direction dir)
72 {
73 phys_addr_t paddr = dma_to_phys(dev, addr);
74 struct io_tlb_pool *pool;
75
76 if (!dev_is_dma_coherent(dev)) {
77 arch_sync_dma_for_cpu(paddr, size, dir);
78 arch_sync_dma_for_cpu_all();
79 }
80
81 pool = is_swiotlb_buffer(dev, paddr);
82 if (unlikely(pool))
> 83 swiotlb_sync_single_for_cpu(dev, paddr, size, dir, pool);
84
85 if (dir == DMA_FROM_DEVICE)
86 arch_dma_mark_clean(paddr, size);
87 }
88
89 static inline dma_addr_t dma_direct_map_page(struct device *dev,
90 struct page *page, unsigned long offset, size_t size,
91 enum dma_data_direction dir, unsigned long attrs)
92 {
93 phys_addr_t phys = page_to_phys(page) + offset;
94 dma_addr_t dma_addr = phys_to_dma(dev, phys);
95
96 if (is_swiotlb_force_bounce(dev)) {
97 if (is_pci_p2pdma_page(page))
98 return DMA_MAPPING_ERROR;
> 99 return swiotlb_map(dev, phys, size, dir, attrs);
100 }
101
102 if (unlikely(!dma_capable(dev, dma_addr, size, true)) ||
103 dma_kmalloc_needs_bounce(dev, size, dir)) {
104 if (is_pci_p2pdma_page(page))
105 return DMA_MAPPING_ERROR;
106 if (is_swiotlb_active(dev))
107 return swiotlb_map(dev, phys, size, dir, attrs);
108
109 dev_WARN_ONCE(dev, 1,
110 "DMA addr %pad+%zu overflow (mask %llx, bus limit %llx).\n",
111 &dma_addr, size, *dev->dma_mask, dev->bus_dma_limit);
112 return DMA_MAPPING_ERROR;
113 }
114
115 if (!dev_is_dma_coherent(dev) && !(attrs & DMA_ATTR_SKIP_CPU_SYNC))
116 arch_sync_dma_for_device(phys, size, dir);
117 return dma_addr;
118 }
119
120 static inline void dma_direct_unmap_page(struct device *dev, dma_addr_t addr,
121 size_t size, enum dma_data_direction dir, unsigned long attrs)
122 {
123 phys_addr_t phys = dma_to_phys(dev, addr);
124 struct io_tlb_pool *pool;
125
126 if (!(attrs & DMA_ATTR_SKIP_CPU_SYNC))
127 dma_direct_sync_single_for_cpu(dev, addr, size, dir);
128
129 pool = is_swiotlb_buffer(dev, phys);
130 if (unlikely(pool))
> 131 swiotlb_tbl_unmap_single(dev, phys, size, dir,
--
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-06-07 21:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20240607031421.182589-1-mhklinux@outlook.com>
2024-06-07 21:19 ` [RFC 1/1] swiotlb: Reduce calls to swiotlb_find_pool() 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;
as well as URLs for NNTP newsgroup(s).