Skip to content

Commit 645d1b6

Browse files
riteshharjanikees
authored andcommitted
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 <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Signed-off-by: Ritesh Harjani (IBM) <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kees Cook <[email protected]>
1 parent 437641a commit 645d1b6

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

arch/powerpc/mm/book3s64/hash_utils.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ static inline bool hash_supports_debug_pagealloc(void)
343343
static u8 *linear_map_hash_slots;
344344
static unsigned long linear_map_hash_count;
345345
static DEFINE_RAW_SPINLOCK(linear_map_hash_lock);
346-
static void hash_debug_pagealloc_alloc_slots(void)
346+
static __init void hash_debug_pagealloc_alloc_slots(void)
347347
{
348348
if (!hash_supports_debug_pagealloc())
349349
return;
@@ -409,7 +409,7 @@ static DEFINE_RAW_SPINLOCK(linear_map_kf_hash_lock);
409409

410410
static phys_addr_t kfence_pool;
411411

412-
static inline void hash_kfence_alloc_pool(void)
412+
static __init void hash_kfence_alloc_pool(void)
413413
{
414414
if (!kfence_early_init_enabled())
415415
goto err;
@@ -445,7 +445,7 @@ static inline void hash_kfence_alloc_pool(void)
445445
disable_kfence();
446446
}
447447

448-
static inline void hash_kfence_map_pool(void)
448+
static __init void hash_kfence_map_pool(void)
449449
{
450450
unsigned long kfence_pool_start, kfence_pool_end;
451451
unsigned long prot = pgprot_val(PAGE_KERNEL);

arch/powerpc/mm/book3s64/radix_pgtable.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ static int __meminit create_physical_mapping(unsigned long start,
363363
}
364364

365365
#ifdef CONFIG_KFENCE
366-
static inline phys_addr_t alloc_kfence_pool(void)
366+
static __init phys_addr_t alloc_kfence_pool(void)
367367
{
368368
phys_addr_t kfence_pool;
369369

@@ -393,7 +393,7 @@ static inline phys_addr_t alloc_kfence_pool(void)
393393
return 0;
394394
}
395395

396-
static inline void map_kfence_pool(phys_addr_t kfence_pool)
396+
static __init void map_kfence_pool(phys_addr_t kfence_pool)
397397
{
398398
if (!kfence_pool)
399399
return;

0 commit comments

Comments
 (0)