Skip to content

Commit 27fd111

Browse files
iamjpnmpe
authored andcommitted
powerpc: Always inline radix_enabled() to fix build failure
This is the same as commit acdad8f ("powerpc: Force inlining of mmu_has_feature to fix build failure") but for radix_enabled(). The config in the linked bugzilla causes the following build failure: LD .tmp_vmlinux.kallsyms1 powerpc64-linux-ld: arch/powerpc/mm/pgtable.o: in function `.__ptep_set_access_flags': pgtable.c:(.text+0x17c): undefined reference to `.radix__ptep_set_access_flags' powerpc64-linux-ld: arch/powerpc/mm/pageattr.o: in function `.change_page_attr': pageattr.c:(.text+0xc0): undefined reference to `.radix__flush_tlb_kernel_range' etc. This is due to radix_enabled() not being inlined. See extract from building with -Winline: In file included from arch/powerpc/include/asm/lppaca.h:46, from arch/powerpc/include/asm/paca.h:17, from arch/powerpc/include/asm/current.h:13, from include/linux/thread_info.h:23, from include/asm-generic/preempt.h:5, from ./arch/powerpc/include/generated/asm/preempt.h:1, from include/linux/preempt.h:78, from include/linux/spinlock.h:51, from include/linux/mmzone.h:8, from include/linux/gfp.h:6, from arch/powerpc/mm/pgtable.c:21: arch/powerpc/include/asm/book3s/64/pgtable.h: In function '__ptep_set_access_flags': arch/powerpc/include/asm/mmu.h:327:20: error: inlining failed in call to 'radix_enabled': call is unlikely and code size would grow [-Werror=inline] The code relies on constant folding of MMU_FTRS_POSSIBLE at buildtime and elimination of non possible parts of code at compile time. For this to work radix_enabled() must be inlined so make it __always_inline. Reported-by: Erhard F. <[email protected]> Suggested-by: Michael Ellerman <[email protected]> Tested-by: Randy Dunlap <[email protected]> Signed-off-by: Jordan Niethe <[email protected]> [mpe: Trimmed error messages in change log] Signed-off-by: Michael Ellerman <[email protected]> Link: https://bugzilla.kernel.org/show_bug.cgi?id=213803 Link: https://lore.kernel.org/r/[email protected]
1 parent 5ae3640 commit 27fd111

File tree

1 file changed

+1
-1
lines changed
  • arch/powerpc/include/asm

1 file changed

+1
-1
lines changed

arch/powerpc/include/asm/mmu.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ static inline void assert_pte_locked(struct mm_struct *mm, unsigned long addr)
324324
}
325325
#endif /* !CONFIG_DEBUG_VM */
326326

327-
static inline bool radix_enabled(void)
327+
static __always_inline bool radix_enabled(void)
328328
{
329329
return mmu_has_feature(MMU_FTR_TYPE_RADIX);
330330
}

0 commit comments

Comments
 (0)