tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: c4f3ef3eb53fd7e8cbfe200d5ff6dba2b08526b5 commit: 5107c1e0490f01323cf3296f758271b06d9bb0f9 [8266/8290] treewide: add checks for the return value of memblock_alloc*() config: xtensa-allyesconfig (attached as .config) compiler: xtensa-linux-gcc (GCC) 8.2.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross git checkout 5107c1e0490f01323cf3296f758271b06d9bb0f9 # save the attached .config to linux build tree GCC_VERSION=8.2.0 make.cross ARCH=xtensa All warnings (new ones prefixed by >>): arch/xtensa/mm/kasan_init.c: In function 'populate': >> arch/xtensa/mm/kasan_init.c:49:35: warning: format '%zu' expects argument of type 'size_t', but argument 3 has type 'long unsigned int' [-Wformat=] panic("%s: Failed to allocate %zu bytes align=0x%lx\n", ~~^ %lu __func__, n_pages * sizeof(pte_t), PAGE_SIZE); ~~~~~~~~~~~~~~~~~~~~~~~ vim +49 arch/xtensa/mm/kasan_init.c 37 38 static void __init populate(void *start, void *end) 39 { 40 unsigned long n_pages = (end - start) / PAGE_SIZE; 41 unsigned long n_pmds = n_pages / PTRS_PER_PTE; 42 unsigned long i, j; 43 unsigned long vaddr = (unsigned long)start; 44 pgd_t *pgd = pgd_offset_k(vaddr); 45 pmd_t *pmd = pmd_offset(pgd, vaddr); 46 pte_t *pte = memblock_alloc(n_pages * sizeof(pte_t), PAGE_SIZE); 47 48 if (!pte) > 49 panic("%s: Failed to allocate %zu bytes align=0x%lx\n", 50 __func__, n_pages * sizeof(pte_t), PAGE_SIZE); 51 52 pr_debug("%s: %p - %p\n", __func__, start, end); 53 54 for (i = j = 0; i < n_pmds; ++i) { 55 int k; 56 57 for (k = 0; k < PTRS_PER_PTE; ++k, ++j) { 58 phys_addr_t phys = 59 memblock_phys_alloc(PAGE_SIZE, PAGE_SIZE); 60 61 if (!phys) 62 panic("Failed to allocate page table page\n"); 63 64 set_pte(pte + j, pfn_pte(PHYS_PFN(phys), PAGE_KERNEL)); 65 } 66 } 67 68 for (i = 0; i < n_pmds ; ++i, pte += PTRS_PER_PTE) 69 set_pmd(pmd + i, __pmd((unsigned long)pte)); 70 71 local_flush_tlb_all(); 72 memset(start, 0, end - start); 73 } 74 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation