]> git.ipfire.org Git - thirdparty/linux.git/commit
powerpc/mm/book3s64: Move kfence and debug_pagealloc related calls to __init section
authorRitesh Harjani (IBM) <ritesh.list@gmail.com>
Thu, 17 Jul 2025 23:25:13 +0000 (16:25 -0700)
committerKees Cook <kees@kernel.org>
Tue, 22 Jul 2025 04:42:21 +0000 (21:42 -0700)
commit645d1b666498ef0d2c44c434a609b5560e9dc401
treeed6a5b964712cd3628941f342580bf0b03ce0c8a
parent437641a72d0a675242ae3e649a30b4c51b3ad450
powerpc/mm/book3s64: Move kfence and debug_pagealloc related calls to __init section

Move a few kfence and debug_pagealloc related functions in hash_utils.c
and radix_pgtable.c to __init sections since these are only invoked once
by an __init function during system initialization.

i.e.
- hash_debug_pagealloc_alloc_slots()
- hash_kfence_alloc_pool()
- hash_kfence_map_pool()
  The above 3 functions only gets called by __init htab_initialize().

- alloc_kfence_pool()
- map_kfence_pool()
  The above 2 functions only gets called by __init radix_init_pgtable()

This should also help fix warning msgs like:

>> WARNING: modpost: vmlinux: section mismatch in reference:
hash_debug_pagealloc_alloc_slots+0xb0 (section: .text) ->
memblock_alloc_try_nid (section: .init.text)

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202504190552.mnFGs5sj-lkp@intel.com/
Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Link: https://lore.kernel.org/r/20250717232519.2984886-8-kees@kernel.org
Signed-off-by: Kees Cook <kees@kernel.org>
arch/powerpc/mm/book3s64/hash_utils.c
arch/powerpc/mm/book3s64/radix_pgtable.c