[akpm-mm:mm-everything 254/254] kernel/kexec_handover.c:970:50: error: passing argument 1 of 'kho_restore_page' makes integer from pointer without a cast

kernel test robot
2025-09-19T02:37:41Z

tree: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
head: 46735c0743fed990d0ed8722a131ef54006c45a3
commit: 5369505b204b3fc65f839f7558640b6ecd675461 [254/254] foo
config: x86_64-randconfig-071-20250919 (https://download.01.org/0day-ci/archive/20250919/202509191034.SM82Oaij-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250919/202509191034.SM82Oaij-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/202509191034.SM82Oaij-lkp@intel.com/

All errors (new ones prefixed by >>):

kernel/kexec_handover.c: In function 'kho_restore_vmalloc':
>> kernel/kexec_handover.c:970:50: error: passing argument 1 of 'kho_restore_page' makes integer from pointer without a cast [-Wint-conversion]
970 | kho_restore_page(page, 0);
| ^~~~
| |
| struct page *
kernel/kexec_handover.c:229:50: note: expected 'phys_addr_t' {aka 'long long unsigned int'} but argument is of type 'struct page *'
229 | static struct page *kho_restore_page(phys_addr_t phys)
| ~~~~~~~~~~~~^~~~
>> kernel/kexec_handover.c:970:33: error: too many arguments to function 'kho_restore_page'
970 | kho_restore_page(page, 0);
| ^~~~~~~~~~~~~~~~
kernel/kexec_handover.c:229:21: note: declared here
229 | static struct page *kho_restore_page(phys_addr_t phys)
| ^~~~~~~~~~~~~~~~
kernel/kexec_handover.c:978:34: error: passing argument 1 of 'kho_restore_page' makes integer from pointer without a cast [-Wint-conversion]
978 | kho_restore_page(page, 0);
| ^~~~
| |
| struct page *
kernel/kexec_handover.c:229:50: note: expected 'phys_addr_t' {aka 'long long unsigned int'} but argument is of type 'struct page *'
229 | static struct page *kho_restore_page(phys_addr_t phys)
| ~~~~~~~~~~~~^~~~
kernel/kexec_handover.c:978:17: error: too many arguments to function 'kho_restore_page'
978 | kho_restore_page(page, 0);
| ^~~~~~~~~~~~~~~~
kernel/kexec_handover.c:229:21: note: declared here
229 | static struct page *kho_restore_page(phys_addr_t phys)
| ^~~~~~~~~~~~~~~~

vim +/kho_restore_page +970 kernel/kexec_handover.c

1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 926)
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 927) /**
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 928) * kho_restore_vmalloc - recreates and populates an area in vmalloc address
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 929) * space from the preserved memory.
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 930) * @preservation: preservation metadata.
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 931) *
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 932) * Recreates an area in vmalloc address space and populates it with memory that
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 933) * was preserved using kho_preserve_vmalloc().
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 934) *
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 935) * Return: pointer to the area in the vmalloc address space, NULL on failure.
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 936) */
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 937) void *kho_restore_vmalloc(const struct kho_vmalloc *preservation)
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 938) {
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 939) struct kho_vmalloc_chunk *chunk = KHOSER_LOAD_PTR(preservation->first);
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 940) unsigned int align, order, shift, vm_flags;
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 941) unsigned int idx = 0, nr;
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 942) unsigned long addr, size;
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 943) struct vm_struct *area;
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 944) struct page **pages;
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 945) int err;
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 946)
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 947) vm_flags = kho_flags_to_vmalloc(preservation->flags);
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 948) if (vm_flags & ~KHO_VMALLOC_SUPPORTED_FLAGS)
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 949) return NULL;
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 950)
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 951) nr = preservation->total_pages;
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 952) pages = kvmalloc_array(nr, sizeof(*pages), GFP_KERNEL);
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 953) if (!pages)
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 954) return NULL;
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 955) order = preservation->order;
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 956) shift = PAGE_SHIFT + order;
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 957) align = 1 << shift;
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 958)
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 959) while (chunk) {
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 960) struct page *page;
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 961)
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 962) for (int i = 0; chunk->phys[i]; i++) {
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 963) phys_addr_t phys = chunk->phys[i];
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 964)
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 965) if (idx + (1 << order) > nr)
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 966) goto err_free_pages_array;
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 967)
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 968) for (int j = 0; j < (1 << order); j++) {
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 969) page = phys_to_page(phys);
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 @970) kho_restore_page(page, 0);
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 971) pages[idx++] = page;
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 972) phys += PAGE_SIZE;
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 973) }
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 974) }
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 975)
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 976) page = virt_to_page(chunk);
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 977) chunk = KHOSER_LOAD_PTR(chunk->hdr.next);
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 978) kho_restore_page(page, 0);
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 979) __free_page(page);
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 980) }
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 981)
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 982) if (idx != nr)
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 983) goto err_free_pages_array;
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 984)
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 985) area = __get_vm_area_node(nr * PAGE_SIZE, align, shift, vm_flags,
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 986) VMALLOC_START, VMALLOC_END, NUMA_NO_NODE,
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 987) GFP_KERNEL, __builtin_return_address(0));
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 988) if (!area)
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 989) goto err_free_pages_array;
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 990)
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 991) addr = (unsigned long)area->addr;
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 992) size = get_vm_area_size(area);
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 993) err = vmap_pages_range(addr, addr + size, PAGE_KERNEL, pages, shift);
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 994) if (err)
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 995) goto err_free_vm_area;
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 996)
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 997) area->pages = pages;
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 998) area->nr_pages = nr;
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 999)
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 1000) return area->addr;
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 1001)
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 1002) err_free_vm_area:
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 1003) free_vm_area(area);
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 1004) err_free_pages_array:
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 1005) kvfree(pages);
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 1006) return NULL;
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 1007) }
1e0bdd5d414970 Mike Rapoport (Microsoft 2025-09-17 1008) EXPORT_SYMBOL_GPL(kho_restore_vmalloc);
fc33e4b44b2717 Mike Rapoport (Microsoft 2025-05-09 1009)

:::::: The code at line 970 was first introduced by commit
:::::: 1e0bdd5d4149706f75f7f3bcc952bc963f352e2b kho: add support for preserving vmalloc allocations

:::::: TO: Mike Rapoport (Microsoft) <rppt@kernel.org>
:::::: CC: Andrew Morton <akpm@linux-foundation.org>

--
0-DAY CI Kernel Test Service