tree:
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: b01d57bfdc41c8f635b08b8a5af8a31217d46936
commit: 3c583493688a0a1276f6a8c0bbc5ece84e77f086 [2778/3213] x86/vmemmap: handle
unpopulated sub-pmd ranges
config: x86_64-randconfig-s022-20210309 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-262-g5e674421-dirty
#
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commi...
git remote add linux-next
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout 3c583493688a0a1276f6a8c0bbc5ece84e77f086
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
arch/x86/mm/init_64.c: In function 'vmemmap_populate_hugepages':
> arch/x86/mm/init_64.c:1583:6: error: implicit declaration of
function 'vmemmap_use_new_sub_pmd' [-Werror=implicit-function-declaration]
1583 | vmemmap_use_new_sub_pmd(addr, next);
| ^~~~~~~~~~~~~~~~~~~~~~~
> arch/x86/mm/init_64.c:1589:4: error: implicit declaration of
function 'vmemmap_use_sub_pmd' [-Werror=implicit-function-declaration]
1589 | vmemmap_use_sub_pmd(addr, next);
| ^~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/vmemmap_use_new_sub_pmd +1583 arch/x86/mm/init_64.c
1530
1531 static int __meminit vmemmap_populate_hugepages(unsigned long start,
1532 unsigned long end, int node, struct vmem_altmap *altmap)
1533 {
1534 unsigned long addr;
1535 unsigned long next;
1536 pgd_t *pgd;
1537 p4d_t *p4d;
1538 pud_t *pud;
1539 pmd_t *pmd;
1540
1541 for (addr = start; addr < end; addr = next) {
1542 next = pmd_addr_end(addr, end);
1543
1544 pgd = vmemmap_pgd_populate(addr, node);
1545 if (!pgd)
1546 return -ENOMEM;
1547
1548 p4d = vmemmap_p4d_populate(pgd, addr, node);
1549 if (!p4d)
1550 return -ENOMEM;
1551
1552 pud = vmemmap_pud_populate(p4d, addr, node);
1553 if (!pud)
1554 return -ENOMEM;
1555
1556 pmd = pmd_offset(pud, addr);
1557 if (pmd_none(*pmd)) {
1558 void *p;
1559
1560 p = vmemmap_alloc_block_buf(PMD_SIZE, node, altmap);
1561 if (p) {
1562 pte_t entry;
1563
1564 entry = pfn_pte(__pa(p) >> PAGE_SHIFT,
1565 PAGE_KERNEL_LARGE);
1566 set_pmd(pmd, __pmd(pte_val(entry)));
1567
1568 /* check to see if we have contiguous blocks */
1569 if (p_end != p || node_start != node) {
1570 if (p_start)
1571 pr_debug(" [%lx-%lx] PMD -> [%p-%p] on node %d\n",
1572 addr_start, addr_end-1, p_start, p_end-1, node_start);
1573 addr_start = addr;
1574 node_start = node;
1575 p_start = p;
1576 }
1577
1578 addr_end = addr + PMD_SIZE;
1579 p_end = p + PMD_SIZE;
1580
1581 if (!IS_ALIGNED(addr, PMD_SIZE) ||
1582 !IS_ALIGNED(next, PMD_SIZE))
1583 vmemmap_use_new_sub_pmd(addr, next);
1584 continue;
1585 } else if (altmap)
1586 return -ENOMEM; /* no fallback */
1587 } else if (pmd_large(*pmd)) {
1588 vmemmap_verify((pte_t *)pmd, node, addr, next);
1589 vmemmap_use_sub_pmd(addr, next);
1590 continue;
1591 }
1592 if (vmemmap_populate_basepages(addr, next, node, NULL))
1593 return -ENOMEM;
1594 }
1595 return 0;
1596 }
1597
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org