Re: [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

Mike Rapoport
2025-09-21T05:50:32Z

On Fri, Sep 19, 2025 at 02:04:19PM -0700, Andrew Morton wrote:
> On Fri, 19 Sep 2025 10:37:27 +0800 kernel test robot <lkp@intel.com> wrote:
>
> > 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 *'
>
> Added by "kho: add support for preserving vmalloc allocations".
>
> I wonder how this happened - was the correct version sent out?

There is a conflict between "kho: make sure page being restored is actually
from KHO" and KHO vmalloc series.

I've sent v5 of KHO vmalloc on top of last week's mm-new, it takes care of
the conflict:

https://lore.kernel.org/linux-mm/20250921054458.4043761-1-rppt@kernel.org

> How about this?

This fixes the build but won't work :)

> --- a/kernel/kexec_handover.c~kho-add-support-for-preserving-vmalloc-allocations-fix
> +++ a/kernel/kexec_handover.c
> @@ -967,7 +967,7 @@ void *kho_restore_vmalloc(const struct k
>
> for (int j = 0; j < (1 << order); j++) {
> page = phys_to_page(phys);
> - kho_restore_page(page, 0);
> + kho_restore_page(phys);
> pages[idx++] = page;
> phys += PAGE_SIZE;
> }
> @@ -975,7 +975,7 @@ void *kho_restore_vmalloc(const struct k
>
> page = virt_to_page(chunk);
> chunk = KHOSER_LOAD_PTR(chunk->hdr.next);
> - kho_restore_page(page, 0);
> + kho_restore_page(page_to_phys(page));
> __free_page(page);
> }
>
> _
>

--
Sincerely yours,
Mike.