tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: d7b3af5a77e8d8da28f435f313e069aea5bcf172 commit: 5d1acc0d9b24e48fde5297a6a40cb9c1a682d740 [5015/5284] powerpc/book3s64/radix: remove mmu_vmemmap_psize config: powerpc-ppc64e_defconfig (https://download.01.org/0day-ci/archive/20230728/202307281617.OxcXz84j-lkp@xxxxxxxxx/config) compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project.git f28c006a5895fc0e329fe15fead81e37457cb1d1) reproduce: (https://download.01.org/0day-ci/archive/20230728/202307281617.OxcXz84j-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/202307281617.OxcXz84j-lkp@xxxxxxxxx/ All errors (new ones prefixed by >>): __do_##name al; \ ^~~~~~~~~~~~~~ <scratch space>:231:1: note: expanded from here __do_insw ^ arch/powerpc/include/asm/io.h:610:56: note: expanded from macro '__do_insw' #define __do_insw(p, b, n) readsw((PCI_IO_ADDR)_IO_BASE+(p), (b), (n)) ~~~~~~~~~~~~~~~~~~~~~^ In file included from arch/powerpc/mm/init_64.c:27: In file included from include/linux/swap.h:9: In file included from include/linux/memcontrol.h:13: In file included from include/linux/cgroup.h:26: In file included from include/linux/kernel_stat.h:9: In file included from include/linux/interrupt.h:11: In file included from include/linux/hardirq.h:11: In file included from arch/powerpc/include/asm/hardirq.h:6: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/powerpc/include/asm/io.h:672: arch/powerpc/include/asm/io-defs.h:47:1: error: performing pointer arithmetic on a null pointer has undefined behavior [-Werror,-Wnull-pointer-arithmetic] DEF_PCI_AC_NORET(insl, (unsigned long p, void *b, unsigned long c), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/powerpc/include/asm/io.h:669:3: note: expanded from macro 'DEF_PCI_AC_NORET' __do_##name al; \ ^~~~~~~~~~~~~~ <scratch space>:233:1: note: expanded from here __do_insl ^ arch/powerpc/include/asm/io.h:611:56: note: expanded from macro '__do_insl' #define __do_insl(p, b, n) readsl((PCI_IO_ADDR)_IO_BASE+(p), (b), (n)) ~~~~~~~~~~~~~~~~~~~~~^ In file included from arch/powerpc/mm/init_64.c:27: In file included from include/linux/swap.h:9: In file included from include/linux/memcontrol.h:13: In file included from include/linux/cgroup.h:26: In file included from include/linux/kernel_stat.h:9: In file included from include/linux/interrupt.h:11: In file included from include/linux/hardirq.h:11: In file included from arch/powerpc/include/asm/hardirq.h:6: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/powerpc/include/asm/io.h:672: arch/powerpc/include/asm/io-defs.h:49:1: error: performing pointer arithmetic on a null pointer has undefined behavior [-Werror,-Wnull-pointer-arithmetic] DEF_PCI_AC_NORET(outsb, (unsigned long p, const void *b, unsigned long c), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/powerpc/include/asm/io.h:669:3: note: expanded from macro 'DEF_PCI_AC_NORET' __do_##name al; \ ^~~~~~~~~~~~~~ <scratch space>:235:1: note: expanded from here __do_outsb ^ arch/powerpc/include/asm/io.h:612:58: note: expanded from macro '__do_outsb' #define __do_outsb(p, b, n) writesb((PCI_IO_ADDR)_IO_BASE+(p),(b),(n)) ~~~~~~~~~~~~~~~~~~~~~^ In file included from arch/powerpc/mm/init_64.c:27: In file included from include/linux/swap.h:9: In file included from include/linux/memcontrol.h:13: In file included from include/linux/cgroup.h:26: In file included from include/linux/kernel_stat.h:9: In file included from include/linux/interrupt.h:11: In file included from include/linux/hardirq.h:11: In file included from arch/powerpc/include/asm/hardirq.h:6: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/powerpc/include/asm/io.h:672: arch/powerpc/include/asm/io-defs.h:51:1: error: performing pointer arithmetic on a null pointer has undefined behavior [-Werror,-Wnull-pointer-arithmetic] DEF_PCI_AC_NORET(outsw, (unsigned long p, const void *b, unsigned long c), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/powerpc/include/asm/io.h:669:3: note: expanded from macro 'DEF_PCI_AC_NORET' __do_##name al; \ ^~~~~~~~~~~~~~ <scratch space>:237:1: note: expanded from here __do_outsw ^ arch/powerpc/include/asm/io.h:613:58: note: expanded from macro '__do_outsw' #define __do_outsw(p, b, n) writesw((PCI_IO_ADDR)_IO_BASE+(p),(b),(n)) ~~~~~~~~~~~~~~~~~~~~~^ In file included from arch/powerpc/mm/init_64.c:27: In file included from include/linux/swap.h:9: In file included from include/linux/memcontrol.h:13: In file included from include/linux/cgroup.h:26: In file included from include/linux/kernel_stat.h:9: In file included from include/linux/interrupt.h:11: In file included from include/linux/hardirq.h:11: In file included from arch/powerpc/include/asm/hardirq.h:6: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/powerpc/include/asm/io.h:672: arch/powerpc/include/asm/io-defs.h:53:1: error: performing pointer arithmetic on a null pointer has undefined behavior [-Werror,-Wnull-pointer-arithmetic] DEF_PCI_AC_NORET(outsl, (unsigned long p, const void *b, unsigned long c), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/powerpc/include/asm/io.h:669:3: note: expanded from macro 'DEF_PCI_AC_NORET' __do_##name al; \ ^~~~~~~~~~~~~~ <scratch space>:239:1: note: expanded from here __do_outsl ^ arch/powerpc/include/asm/io.h:614:58: note: expanded from macro '__do_outsl' #define __do_outsl(p, b, n) writesl((PCI_IO_ADDR)_IO_BASE+(p),(b),(n)) ~~~~~~~~~~~~~~~~~~~~~^ >> arch/powerpc/mm/init_64.c:201:15: error: no previous prototype for function '__vmemmap_populate' [-Werror,-Wmissing-prototypes] int __meminit __vmemmap_populate(unsigned long start, unsigned long end, int node, ^ arch/powerpc/mm/init_64.c:201:1: note: declare 'static' if the function is not intended to be used outside of this translation unit int __meminit __vmemmap_populate(unsigned long start, unsigned long end, int node, ^ static 13 errors generated. vim +/__vmemmap_populate +201 arch/powerpc/mm/init_64.c 200 > 201 int __meminit __vmemmap_populate(unsigned long start, unsigned long end, int node, 202 struct vmem_altmap *altmap) 203 { 204 bool altmap_alloc; 205 unsigned long page_size = 1 << mmu_psize_defs[mmu_vmemmap_psize].shift; 206 207 /* Align to the page size of the linear mapping. */ 208 start = ALIGN_DOWN(start, page_size); 209 210 pr_debug("vmemmap_populate %lx..%lx, node %d\n", start, end, node); 211 212 for (; start < end; start += page_size) { 213 void *p = NULL; 214 int rc; 215 216 /* 217 * This vmemmap range is backing different subsections. If any 218 * of that subsection is marked valid, that means we already 219 * have initialized a page table covering this range and hence 220 * the vmemmap range is populated. 221 */ 222 if (vmemmap_populated(start, page_size)) 223 continue; 224 225 /* 226 * Allocate from the altmap first if we have one. This may 227 * fail due to alignment issues when using 16MB hugepages, so 228 * fall back to system memory if the altmap allocation fail. 229 */ 230 if (altmap && !altmap_cross_boundary(altmap, start, page_size)) { 231 p = vmemmap_alloc_block_buf(page_size, node, altmap); 232 if (!p) 233 pr_debug("altmap block allocation failed, falling back to system memory"); 234 else 235 altmap_alloc = true; 236 } 237 if (!p) { 238 p = vmemmap_alloc_block_buf(page_size, node, NULL); 239 altmap_alloc = false; 240 } 241 if (!p) 242 return -ENOMEM; 243 244 if (vmemmap_list_populate(__pa(p), start, node)) { 245 /* 246 * If we don't populate vmemap list, we don't have 247 * the ability to free the allocated vmemmap 248 * pages in section_deactivate. Hence free them 249 * here. 250 */ 251 int nr_pfns = page_size >> PAGE_SHIFT; 252 unsigned long page_order = get_order(page_size); 253 254 if (altmap_alloc) 255 vmem_altmap_free(altmap, nr_pfns); 256 else 257 free_pages((unsigned long)p, page_order); 258 return -ENOMEM; 259 } 260 261 pr_debug(" * %016lx..%016lx allocated at %p\n", 262 start, start + page_size, p); 263 264 rc = vmemmap_create_mapping(start, page_size, __pa(p)); 265 if (rc < 0) { 266 pr_warn("%s: Unable to create vmemmap mapping: %d\n", 267 __func__, rc); 268 return -EFAULT; 269 } 270 } 271 272 return 0; 273 } 274 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki