linux-stable/arch/powerpc
Jordan Niethe 27fd111105 powerpc: Always inline radix_enabled() to fix build failure
This is the same as commit acdad8fb4a ("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. <erhard_f@mailbox.org>
Suggested-by: Michael Ellerman <mpe@ellerman.id.au>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Jordan Niethe <jniethe5@gmail.com>
[mpe: Trimmed error messages in change log]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=213803
Link: https://lore.kernel.org/r/20210804013724.514468-1-jniethe5@gmail.com
2021-08-10 23:14:56 +10:00
..
boot powerpc: move the install rule to arch/powerpc/Makefile 2021-08-04 10:53:39 +10:00
configs TTY / Serial patches for 5.14-rc1 2021-07-05 14:08:24 -07:00
crypto crypto: powepc/sha1 - remove unneeded semicolon 2021-03-07 15:13:14 +11:00
include powerpc: Always inline radix_enabled() to fix build failure 2021-08-10 23:14:56 +10:00
kernel powerpc: Replace deprecated CPU-hotplug functions. 2021-08-10 23:14:56 +10:00
kexec powerpc/kexec: fix for_each_child.cocci warning 2021-08-10 23:14:55 +10:00
kvm powerpc: Replace deprecated CPU-hotplug functions. 2021-08-10 23:14:56 +10:00
lib powerpc: Only build restart_table.c for 64s 2021-07-01 22:50:54 +10:00
math-emu powerpc/64s: avoid reloading (H)SRR registers if they are still valid 2021-06-25 00:06:55 +10:00
mm pseries/drmem: update LMBs after LPM 2021-08-10 23:14:55 +10:00
net powerpc/bpf: Reject atomic ops in ppc32 JIT 2021-07-05 22:23:25 +10:00
perf powerpc/64s/perf: Always use SIAR for kernel interrupts 2021-08-04 10:53:39 +10:00
platforms powerpc: Replace deprecated CPU-hotplug functions. 2021-08-10 23:14:56 +10:00
purgatory powerpc/kexec: Don't use .machine ppc64 in trampoline_64.S 2021-04-08 21:17:43 +10:00
sysdev powerpc/xive: Fix error handling when allocating an IPI 2021-07-05 22:23:25 +10:00
tools
xmon powerpc updates for 5.14 2021-07-02 12:54:34 -07:00
Kbuild
Kconfig powerpc updates for 5.14 2021-07-02 12:54:34 -07:00
Kconfig.debug powerpc: Make PPC_IRQ_SOFT_MASK_DEBUG depend on PPC64 2021-06-25 00:07:09 +10:00
Makefile powerpc: move the install rule to arch/powerpc/Makefile 2021-08-04 10:53:39 +10:00
Makefile.postlink